File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,14 @@ resource "hcp_hvn" "main" {
2727
2828resource "aws_vpc" "example" {
2929 cidr_block = "172.31.0.0/16"
30+ tags = {
31+ Name = "example-vpc"
32+ }
33+ }
34+
35+ resource "aws_subnet" "example" {
36+ vpc_id = aws_vpc.example.id
37+ cidr_block = "172.31.1.0/24"
3038}
3139
3240resource "aws_ec2_transit_gateway" "example" {
@@ -35,6 +43,12 @@ resource "aws_ec2_transit_gateway" "example" {
3543 }
3644}
3745
46+ resource "aws_ec2_transit_gateway_vpc_attachment" "example" {
47+ subnet_ids = [aws_subnet.example.id]
48+ transit_gateway_id = aws_ec2_transit_gateway.example.id
49+ vpc_id = aws_vpc.example.id
50+ }
51+
3852resource "aws_ram_resource_share" "example" {
3953 name = "example-resource-share"
4054 allow_external_principals = true
@@ -76,7 +90,10 @@ resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" {
7690resource "aws_route" "example" {
7791 route_table_id = aws_vpc.example.main_route_table_id
7892 destination_cidr_block = hcp_hvn.main.cidr_block
79- transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment_accepter.example.id
93+ transit_gateway_id = aws_ec2_transit_gateway.example.id
94+ depends_on = [
95+ aws_ec2_transit_gateway_vpc_attachment.example
96+ ]
8097}
8198```
8299
You can’t perform that action at this time.
0 commit comments