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

[Bug]: Forced replacement of aws_vpclattice_service_network_vpc_association when using ARN as service_network_identifier #31896

Closed
nmoutschen opened this issue Jun 12, 2023 · 3 comments · Fixed by #32658
Labels
bug Addresses a defect in current functionality. service/vpclattice Issues and PRs that pertain to the vpclattice service.
Milestone

Comments

@nmoutschen
Copy link
Contributor

nmoutschen commented Jun 12, 2023

Terraform Core Version

1.4.6

AWS Provider Version

4.67.0

Affected Resource(s)

  • aws_vpclattice_service_network_vpc_association

Expected Behavior

aws_vpclattice_service_network_vpc_association should not replace resources when passing an ARN for the service_network_identifier.

According to the resource documentation passing an ARN is mandatory when using a different AWS account, thus this should never cause a problem.

Actual Behavior

Terraform will replace the aws_vpclattice_service_network_vpc_association every single time, due to the desired value (ARN) mismatching the stored value, despite them referring to the same service network.

Example with all sensitive values removed:

    # aws_vpclattice_service_network_vpc_association.this must be replaced
-/+ resource "aws_vpclattice_service_network_vpc_association" "this" {
      ~ arn                        = "arn:aws:vpc-lattice:{REGION}:{ACCOUNT_ID}:servicenetworkvpcassociation/{ASSOCIATION_ID}" -> (known after apply)
      ~ created_by                 = "{ACCOUNT_ID}" -> (known after apply)
      ~ id                         = "{ASSOCIATION_ID}" -> (known after apply)
      ~ service_network_identifier = "{SERVICE_NETWORK_ID}" -> "arn:aws:vpc-lattice:{REGION}:{ACCOUNT_ID}:servicenetwork/{SERVICE_NETWORK_ID}" # forces replacement
      ~ status                     = "ACTIVE" -> (known after apply)
        # (3 unchanged attributes hidden)
    }

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

I have not tested this example, but this should suffice to replicate the issue:

resource "aws_vpc" "this" {
  cidr_block = "10.42.0.0/16"
}

resource "aws_vpclattice_service_network" "this" {
  name      = "some_service_network"
  auth_type = "AWS_IAM"
}

resource "aws_vpclattice_service_network_vpc_association" "this" {
  vpc_identifier             = aws_vpc.this.id
  service_network_identifier = aws_vpclattice_service_network.this.arn
}

Steps to Reproduce

  • Create an aws_vpclattice_service_network_vpc_association that refers to a service network by ARN
  • terraform apply
  • terraform plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@nmoutschen nmoutschen added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Jun 12, 2023
@github-actions github-actions bot added service/vpc Issues and PRs that pertain to the vpc service. service/vpclattice Issues and PRs that pertain to the vpclattice service. labels Jun 12, 2023
@github-actions
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@justinretzolk justinretzolk removed needs-triage Waiting for first response or review from a maintainer. service/vpc Issues and PRs that pertain to the vpc service. labels Jun 12, 2023
@github-actions github-actions bot added this to the v5.10.0 milestone Jul 26, 2023
@github-actions
Copy link

This functionality has been released in v5.10.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. Thank you!

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2023
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/vpclattice Issues and PRs that pertain to the vpclattice service.
Projects
None yet
2 participants