Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant ec2:ModifyNetworkInterfaceAttribute call when updating aws_network_interface #11273

Closed
nozaq opened this issue Dec 12, 2019 · 3 comments · Fixed by #11277
Closed

Redundant ec2:ModifyNetworkInterfaceAttribute call when updating aws_network_interface #11273

nozaq opened this issue Dec 12, 2019 · 3 comments · Fixed by #11277
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@nozaq
Copy link

nozaq commented Dec 12, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.18
+ provider.archive v1.3.0
+ provider.aws v2.41.0
+ provider.null v2.1.2
+ provider.template v2.1.2

Affected Resource(s)

  • aws_network_interface

Terraform Configuration Files

1st Apply

First, apply the following tf file.

module "this_vpc" {
  source = "terraform-aws-modules/vpc/aws"

  name = "eni-test"
  cidr = "192.168.0.0/24"

  azs            = ["ap-northeast-1a"]
  public_subnets = ["192.168.0.0/25"]

  enable_nat_gateway = false
}

resource "aws_network_interface" "eni" {
  subnet_id         = module.this_vpc.public_subnets[0]
  source_dest_check = false
}

2nd Apply

Then, add tags attribute to aws_network_interface.eni and apply.

module "this_vpc" {
  source = "terraform-aws-modules/vpc/aws"

  name = "eni-test"
  cidr = "192.168.0.0/24"

  azs            = ["ap-northeast-1a"]
  public_subnets = ["192.168.0.0/25"]

  enable_nat_gateway = false
}

resource "aws_network_interface" "eni" {
  subnet_id         = module.this_vpc.public_subnets[0]
  source_dest_check = false

  tags = {
    "DummyTag" = 1
  }
}

Debug Output

A part of the debug output from 2nd apply (full log not provided for security purpose).
https://gist.github.com/nozaq/b872123c8ceb7961089a8fee0c30ff8a

Panic Output

Terraform doesn't produce a panic.

Expected Behavior

On 2nd apply, only ec2:CreateTags is called to update tags on aws_network_interface.eni.

Actual Behavior

On 2nd apply, ec2:ModifyNetworkInterfaceAttribute is called with SourceDestCheck paramter before ec2:CreateTags.

ec2:ModifyNetworkInterfaceAttribute call is redundant since SourceDestCheck parameter doesn't change on this apply.

Steps to Reproduce

  1. terraform apply with the 1st Apply code above.
  2. terraform apply with the 2nd Apply code above.

Important Factoids

None

References

None

@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label Dec 12, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Dec 12, 2019
@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 13, 2019
@bflad bflad added this to the v2.42.0 milestone Dec 13, 2019
@bflad
Copy link
Contributor

bflad commented Dec 13, 2019

The fix for this has been merged and will release with version 2.42.0 of the Terraform AWS Provider, later today. Thanks to @nozaq for the implementation. 👍

@ghost
Copy link

ghost commented Dec 13, 2019

This has been released in version 2.42.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 28, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants