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]: expanding allowed prefixes aws_dx_gateway_association causes downtime #30085

Open
marcincuber opened this issue Mar 17, 2023 · 5 comments
Labels
bug Addresses a defect in current functionality. service/directconnect Issues and PRs that pertain to the directconnect service. service/transitgateway Issues and PRs that pertain to the transitgateway service.

Comments

@marcincuber
Copy link

marcincuber commented Mar 17, 2023

Terraform Core Version

1.4.1

AWS Provider Version

4.58

Affected Resource(s)

  • aws_dx_gateway_association
  • aws_ec2_transit_gateway_route_table_association

Expected Behavior

When updating aws_dx_gateway_association with an additional allowed_prefix. Gateway association should be updated in-place with zero impact on other prefixes.

Actual Behavior

Update to aws_dx_gateway_association resource causes aws_ec2_transit_gateway_route_table_association replacement which is disabling all the traffic through the dx gateway.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_dx_gateway" "lnd_eng_1" {
  name            = "LDN_IXN_ENG_1"
  amazon_side_asn = "6000"
}

resource "aws_dx_gateway_association" "lnd_eng_1" {
  dx_gateway_id         = aws_dx_gateway.lnd_eng_1.id
  associated_gateway_id = aws_ec2_transit_gateway.main_router.id

  allowed_prefixes = local.dx_gateway_allowed_prefixes
}

resource "aws_ec2_transit_gateway_route_table_association" "dx_gateway_lnd_eng_1" {
  transit_gateway_attachment_id  = data.aws_ec2_transit_gateway_attachment.lnd_eng_1.transit_gateway_attachment_id
  transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.main_router.id
}

Plan Output

  ~ resource "aws_dx_gateway_association" "lnd_eng_1" {
      ~ allowed_prefixes                    = [
          + "10.10.10.0/23",
            # (4 unchanged elements hidden)
        ]
        id                                  = "ga-46208b72-12345"
        # (6 unchanged attributes hidden)
    }

    # aws_ec2_transit_gateway_route_table_association.dx_gateway_lnd_eng_1 must be replaced
-/+ resource "aws_ec2_transit_gateway_route_table_association" "dx_gateway_lnd_eng_1" {
      ~ id                             = "tgw-rtb-3445_tgw-attach-1234" -> (known after apply)
      ~ resource_id                    = "46208b72-f184-12345" -> (known after apply)
      ~ resource_type                  = "direct-connect-gateway" -> (known after apply)
      ~ transit_gateway_attachment_id  = "tgw-attach-123434" # forces replacement -> (known after apply)
        # (1 unchanged attribute hidden)
    }

Steps to Reproduce

Implement aws_dx_gateway_association which is associated with transit gateway aws_ec2_transit_gateway_route_table_association.dx_gateway

Important Factoids

aws_ec2_transit_gateway_route_table_association.dx_gateway_lnd_eng_1 must be replaced action shouldn't be happening as allowed prefixes can be updated in place.

References

Related docs -> https://docs.aws.amazon.com/directconnect/latest/UserGuide/allowed-to-prefixes.html

Would you like to implement a fix?

None

@marcincuber marcincuber added bug Addresses a defect in current functionality. needs-triage Waiting for first response or review from a maintainer. labels Mar 17, 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.

@github-actions github-actions bot added service/directconnect Issues and PRs that pertain to the directconnect service. service/transitgateway Issues and PRs that pertain to the transitgateway service. labels Mar 17, 2023
@justinretzolk
Copy link
Member

Hey @marcincuber 👋 Thank you for taking the time to raise this! So that we have all of the necessary information in order to look into this, can you supply a sample Terraform configuration that exhibits this behavior?

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 17, 2023
@marcincuber
Copy link
Author

marcincuber commented Mar 18, 2023

@justinretzolk I updated the issue with sample configuration.

@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Mar 18, 2023
@per-lind
Copy link

Any news on this issue? I have the same problem and it makes it really hard to work with the transitgateway together with directconnect.

@sathishsrinu
Copy link

@marcincuber - did you find any solution on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/directconnect Issues and PRs that pertain to the directconnect service. service/transitgateway Issues and PRs that pertain to the transitgateway service.
Projects
None yet
Development

No branches or pull requests

4 participants