-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathram.tf
More file actions
31 lines (25 loc) · 1.11 KB
/
ram.tf
File metadata and controls
31 lines (25 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#----------------------------------------
# Share the transit gateway from Region 1 to Region 3 (another account)
#----------------------------------------
resource "aws_ram_resource_share" "r1_r3_transit_gateway_resource_share" {
name = "r1-r3-transit-gateway-resource-share"
allow_external_principals = true
tags = {
Environment = var.r1_environment
}
}
resource "aws_ram_resource_association" "r1_share_transit_gateway" {
resource_arn = aws_ec2_transit_gateway.r1_tgw.arn
resource_share_arn = aws_ram_resource_share.r1_r3_transit_gateway_resource_share.arn
}
resource "aws_ram_principal_association" "r3_share_transit_gateway" {
principal = "657100425642"
resource_share_arn = aws_ram_resource_share.r1_r3_transit_gateway_resource_share.arn
}
#----------------------------------------
# Acccept the resource share in Region 2 (another account)
#----------------------------------------
resource "aws_ram_resource_share_accepter" "r3_accept_transit_gateway" {
provider = aws.rmt_eu_west_1
share_arn = aws_ram_principal_association.r3_share_transit_gateway.resource_share_arn
}