Terraform-provider-aws: Implement AcceptTransitGatewayVpcAttachment API call

Created on 29 Mar 2019  ·  5Comments  ·  Source: hashicorp/terraform-provider-aws

_This issue was originally opened by @KundK as hashicorp/terraform#20869. It was migrated here as a result of the provider split. The original body of the issue is below._


Current Terraform Version

Terraform 0.11.10
AWS provider 2.4.0

Use-cases


When creating a aws_ec2_transit_gateway_vpc_attachment with a shared TGW from another account the attachment goes into 'pendingAcceptance ' state.
It has to be accepted manually on the console or by the AcceptTransitGatewayVpcAttachment API call.
It seems like that API call doesn't have a provider resource.

Attempted Solutions

Proposal


Create data source and resource similar to 'aws_dx_hosted_public_virtual_interface_accepter'

References


https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AcceptTransitGatewayVpcAttachment.html

new-resource servicec2

Most helpful comment

Suggested syntax for a new aws_ec2_transit_gateway_vpc_attachment_accepter resource (modeled on aws_vpc_peering_connection_accepter):

# Creator
resource "aws_ec2_transit_gateway_vpc_attachment" "example" {
...
}

# Accepter
resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" {
  provider = "aws.alternate"

  transit_gateway_attachment_id = "${aws_ec2_transit_gateway_vpc_attachment.example.id}"
}

The exported attributes would be the attributes of the aws_ec2_transit_gateway_vpc_attachment resource:

  • transit_gateway_id
  • vpc_id
  • vpc_owner_id
  • subnet_ids
  • dns_support
  • ipv6_support

All 5 comments

For acceptance testing this depends on https://github.com/terraform-providers/terraform-provider-aws/issues/7601, https://github.com/terraform-providers/terraform-provider-aws/pull/8259 as the transit gateway must be shared to and accepted in the account to which the transit gateway VPC attachment will be made and accepted.

Suggested syntax for a new aws_ec2_transit_gateway_vpc_attachment_accepter resource (modeled on aws_vpc_peering_connection_accepter):

# Creator
resource "aws_ec2_transit_gateway_vpc_attachment" "example" {
...
}

# Accepter
resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" {
  provider = "aws.alternate"

  transit_gateway_attachment_id = "${aws_ec2_transit_gateway_vpc_attachment.example.id}"
}

The exported attributes would be the attributes of the aws_ec2_transit_gateway_vpc_attachment resource:

  • transit_gateway_id
  • vpc_id
  • vpc_owner_id
  • subnet_ids
  • dns_support
  • ipv6_support

Hi folks 👋 A new aws_ec2_transit_gateway_vpc_attachment_accepter resource has been merged and will release with version 2.13.0 of the Terraform AWS Provider, likely later this week. 👍

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

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!

Was this page helpful?
0 / 5 - 0 ratings