_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._
Terraform 0.11.10
AWS provider 2.4.0
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.
Create data source and resource similar to 'aws_dx_hosted_public_virtual_interface_accepter'
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AcceptTransitGatewayVpcAttachment.html
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_idvpc_idvpc_owner_idsubnet_idsdns_supportipv6_supportHi 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!
Most helpful comment
Suggested syntax for a new
aws_ec2_transit_gateway_vpc_attachment_accepterresource (modeled onaws_vpc_peering_connection_accepter):The exported attributes would be the attributes of the
aws_ec2_transit_gateway_vpc_attachmentresource:transit_gateway_idvpc_idvpc_owner_idsubnet_idsdns_supportipv6_support