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

Allow aws_dx_gateway_association and aws_dx_private_virtual_interface to reference Transit Gateway #8490

Closed
heycasey opened this issue Apr 30, 2019 · 14 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/directconnect Issues and PRs that pertain to the directconnect service.
Milestone

Comments

@heycasey
Copy link

heycasey commented Apr 30, 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 "me too" comments, 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

Description

Transit Gateway now allows support for Direct Connect via a Direct Connect Gateway. The aws_dx_gateway_association should be updated to allow a transit_gateway_id argument. In addition, the aws_dx_private_virtual_interface should be updated to allow a Transit virtual interface type, or a new aws_dx_transit_virtual_interface resource can be introduced.

New or Affected Resource(s)

  • aws_dx_gateway_association
  • aws_dx_private_virtual interface (or create a new awx_dx_transit_virtual_interface)

Potential Terraform Configuration

resource "aws_dx_gateway_association" "example" {
  dx_gateway_id  = "${aws_dx_gateway.example.id}"
  transit_gateway_id = "${aws_ec2_transit_gateway.example.id}"
}
@heycasey heycasey added the enhancement Requests to existing resources that expand the functionality or scope. label Apr 30, 2019
@heycasey heycasey changed the title Allow aws_dx_gateway_association to reference Transit Gateway Allow aws_dx_gateway_association and aws_dx_private_virtual_interface to reference Transit Gateway Apr 30, 2019
@ewbankkit
Copy link
Contributor

AWS blog post.
Requires:

@ewbankkit
Copy link
Contributor

I would suggest awx_dx_transit_virtual_interface as we already have separate aws_dx_private_virtual_interface and aws_dx_public_virtual_interface resources.
We'll also need the corresponding awx_dx_hosted_transit_virtual_interface and awx_dx_hosted_transit_virtual_interface_accepter resources.

Changes to aws_dx_gateway_association should build on #8320 and #8455.

@ewbankkit
Copy link
Contributor

ewbankkit commented May 3, 2019

@ewbankkit
Copy link
Contributor

@heycasey
Copy link
Author

heycasey commented May 6, 2019

Associating a DX Gateway with a Transit Gateway automatically creates the Transit Gateway Attachment for the DX Gateway. This differs from connecting a VPC to a Transit Gateway where you would use the aws_ec2_transit_gateway_vpc_attachment resource to create a Transit Gateway Attachment.

Will there be a way to get the ID of this auto-created Transit Gateway Attachment when using the aws_dx_gateway_association resource?

@heycasey
Copy link
Author

heycasey commented May 6, 2019

I'm going to split the work into separate PRs to keep the change sets smaller:

@ewbankkit I wanted to point out that I made a typo in a previous post of awx instead of aws and it got copied/pasted to a previous post. However, looks like your PRs have the correct spelling.

@ewbankkit
Copy link
Contributor

@heycasey RE #8490 (comment) - I'll investigate. It doesn't look like the EC2 API TransitGatewayAttachment has been updated with a Direct Connect Gateway resourceType yet.

@ewbankkit
Copy link
Contributor

ewbankkit commented May 9, 2019

@heycasey If I associate a DX Gateway with a transit gateway the transit gateway association is created with resource type direct-connect-gateway:

$ aws --region us-west-2 ec2 describe-transit-gateway-attachments
{
    "TransitGatewayAttachments": [
        {
            "ResourceOwnerId": "000000000000", 
            "TransitGatewayAttachmentId": "tgw-attach-00000000000000000", 
            "ResourceType": "direct-connect-gateway", 
            "ResourceId": "00000000-0000-0000-0000-000000000000", 
            "Tags": [], 
            "CreationTime": "2019-05-09T15:31:38.000Z", 
            "State": "available", 
            "TransitGatewayId": "tgw-00000000000000000", 
            "TransitGatewayOwnerId": "000000000000", 
            "Association": {
                "State": "associated", 
                "TransitGatewayRouteTableId": "tgw-rtb-00000000000000000"
            }
        }
    ]
}

It looks like we'll need a new aws_ec2_transit_gateway_dx_gateway_attachment data source.
I'll create an issue for that: #8590.

@ewbankkit
Copy link
Contributor

@heycasey I think I'll also add the transit gateway attachment ID as a Computed attribute on the DX Gateway association as I will need to obtain it at some point in order to ensure that the attachment is deleted when the association is deleted. Otherwise we'll get errors like

aws_dx_gateway_association.test: Destruction complete after 8m0s
aws_ec2_transit_gateway.test: Destroying... (ID: tgw-00000000000000000)

Error: Error applying plan:

1 error(s) occurred:

* aws_ec2_transit_gateway.test (destroy): 1 error(s) occurred:

* aws_ec2_transit_gateway.test: error deleting EC2 Transit Gateway: IncorrectState: tgw-00000000000000000 has non-deleted DirectConnect Gateway Attachments: tgw-attach-00000000000000000.
	status code: 400, request id: 00000000-0000-0000-0000-000000000000

plus the acceptance tests will fail with the same error.

@spasam
Copy link

spasam commented May 29, 2019

Hi there, is there anything holding back the PRs? Looks like @heycasey addressed the comments! Thanks

@bflad
Copy link
Contributor

bflad commented Nov 22, 2019

Two new resources aws_dx_hosted_transit_virtual_interface and aws_dx_hosted_transit_virtual_interface_accepter have been merged and will release with version 2.40.0 of the Terraform AWS Provider, next week. Many thanks to @ewbankkit for the implementation work and @devonbleak for testing assistance.

@heycasey / @ewbankkit does anything else need to be completed for this issue?

@bflad bflad added this to the v2.40.0 milestone Nov 22, 2019
@bflad
Copy link
Contributor

bflad commented Nov 22, 2019

I believe we have covered most, if not all, of the required functionality of this issue with the upcoming 2.40.0 release of the Terraform AWS Provider. Please use new feature request issues for anything still outstanding. 👍

@bflad bflad closed this as completed Nov 22, 2019
@ghost
Copy link

ghost commented Nov 27, 2019

This has been released in version 2.40.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 29, 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 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/directconnect Issues and PRs that pertain to the directconnect service.
Projects
None yet
Development

No branches or pull requests

4 participants