添加 TG 附件后自动批准待定接受状态的方法?
Way to auto-approve for pending acceptance state after TG attachment is added?
除了使用资源 aws_ec2_transit_gateway_vpc_attachment_accepter 添加 TG 附件后,是否有自动批准待接受状态?
我有一个变量,我从 aws api 获得了除当前区域之外的具有 TGW ID 的区域
例如,我在 us-east-2,我的变量是,
TGW_PEERS = [{"id": "tgw-xxx", "region": "eu-west-1", "name": "TGW0001_EUW1"}, {" id": "tgw-xxx", "region": "us-west-2", "cidr": "", "name": "TGW0001_USW2"}]
我有资源aws_ec2_transit_gateway_peering_attachment
resource "aws_ec2_transit_gateway_peering_attachment" "TGW-PEERS" {
count = length(var.TGW_PEERS)
peer_region = var.TGW_PEERS[count.index].region
peer_transit_gateway_id = var.TGW_PEERS[count.index].id
transit_gateway_id = data.aws_ec2_transit_gateway.TGW.id
tags = {
Name = format("PEER_%s", var.TGW_PEERS[count.index].name)
Side = "Initiator"
}
}
但是当我应用以上内容时,TGW 附件进入等待接受状态并且启用“自动接受共享附件”也无济于事
修复它的一种方法是我必须为每个区域执行此操作,并为除它本身以外的所有其他区域创建别名和资源语句。
我不想这样做:)
provider "aws" {
alias = "us-west-2"
region = "us-west-2"
}
resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "TGW-ACCEPTOR" {
provider = aws.us-west-2
transit_gateway_attachment_id = data.aws_ec2_transit_gateway.TGW.id
tags = {
Name = "Yo"
Side = "Accepter"
}
}
“自动接受共享附件”适用于 TG VPC attachments . However you are trying to do TG peering 个附件。对于此类附件,没有自动接受:
To activate the peering attachment, the owner of the accepter transit gateway must accept the peering attachment request. This is required even if both transit gateways are in the same account. The peering attachment must be in the pendingAcceptance state. Accept the peering attachment request from the Region that the accepter transit gateway is located in.
您尝试使用的 aws_ec2_transit_gateway_vpc_attachment_accepter
适用于 TG VPC 附件,不适用于 TG 对等附件。
除了使用资源 aws_ec2_transit_gateway_vpc_attachment_accepter 添加 TG 附件后,是否有自动批准待接受状态?
我有一个变量,我从 aws api 获得了除当前区域之外的具有 TGW ID 的区域
例如,我在 us-east-2,我的变量是,
TGW_PEERS = [{"id": "tgw-xxx", "region": "eu-west-1", "name": "TGW0001_EUW1"}, {" id": "tgw-xxx", "region": "us-west-2", "cidr": "", "name": "TGW0001_USW2"}]
我有资源aws_ec2_transit_gateway_peering_attachment
resource "aws_ec2_transit_gateway_peering_attachment" "TGW-PEERS" {
count = length(var.TGW_PEERS)
peer_region = var.TGW_PEERS[count.index].region
peer_transit_gateway_id = var.TGW_PEERS[count.index].id
transit_gateway_id = data.aws_ec2_transit_gateway.TGW.id
tags = {
Name = format("PEER_%s", var.TGW_PEERS[count.index].name)
Side = "Initiator"
}
}
但是当我应用以上内容时,TGW 附件进入等待接受状态并且启用“自动接受共享附件”也无济于事
修复它的一种方法是我必须为每个区域执行此操作,并为除它本身以外的所有其他区域创建别名和资源语句。 我不想这样做:)
provider "aws" {
alias = "us-west-2"
region = "us-west-2"
}
resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "TGW-ACCEPTOR" {
provider = aws.us-west-2
transit_gateway_attachment_id = data.aws_ec2_transit_gateway.TGW.id
tags = {
Name = "Yo"
Side = "Accepter"
}
}
“自动接受共享附件”适用于 TG VPC attachments . However you are trying to do TG peering 个附件。对于此类附件,没有自动接受:
To activate the peering attachment, the owner of the accepter transit gateway must accept the peering attachment request. This is required even if both transit gateways are in the same account. The peering attachment must be in the pendingAcceptance state. Accept the peering attachment request from the Region that the accepter transit gateway is located in.
您尝试使用的 aws_ec2_transit_gateway_vpc_attachment_accepter
适用于 TG VPC 附件,不适用于 TG 对等附件。