NEW: sharing transit gateway via RAM
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
resource "aws_ram_resource_share_accepter" "tgw-accepter" {
|
||||
share_arn = "arn:aws:ram:ap-southeast-1:573340405480:resource-share/70e66c50-c169-4f31-a199-f3a09adb27ce"
|
||||
lifecycle {
|
||||
ignore_changes = all
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
tgw-id = split("/", aws_ram_resource_share_accepter.tgw-accepter.resources[0])[1]
|
||||
}
|
||||
|
||||
data "aws_ec2_transit_gateway" shared-tgw {
|
||||
id = local.tgw-id
|
||||
}
|
||||
|
||||
data "aws_subnet_ids" subnet-ids {
|
||||
vpc_id = data.aws_vpc.vpc1.id
|
||||
}
|
||||
|
||||
resource "aws_ec2_transit_gateway_vpc_attachment" tgw-attach {
|
||||
vpc_id = data.aws_vpc.vpc1.id
|
||||
subnet_ids = [tolist(data.aws_subnet_ids.subnet-ids.ids)[0]]
|
||||
transit_gateway_id = data.aws_ec2_transit_gateway.shared-tgw.id
|
||||
tags = local.default-tags
|
||||
}
|
||||
Reference in New Issue
Block a user