Skip to content

Commit 2229a65

Browse files
Updated Files
1 parent 040e2c0 commit 2229a65

File tree

6 files changed

+37
-18
lines changed

6 files changed

+37
-18
lines changed

_example/diffrent-account/example.tf renamed to _example/different-account/example.tf

+28-7
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,36 @@ module "transit-gateway" {
3434
environment = "test"
3535
label_order = ["environment", "application", "name"]
3636

37-
#Transit gateway invitation accepter
38-
aws_ram_resource_share_accepter = true
39-
resource_share_arn = "arn:aws:ram:eu-west-1:XXXXXXXXXXX:resource-share/XXXXXXXXXXXXXXXXXXXXXXXXXX"
37+
amazon_side_asn = 64512
38+
auto_accept_shared_attachments = "enable"
39+
default_route_table_propagation = "enable"
40+
description = "This transit Gateway create for testing purpose"
41+
42+
#TGW Share
43+
resource_share_enable = true
44+
resource_share_allow_external_principals = true
45+
resource_share_account_ids = ["XXXXXXXXXXXXX"]
46+
47+
# VPC Attachements
48+
vpc_attachement_create = false # Enable After once create the subnets
49+
vpc_id = module.vpc.vpc_id
50+
destination_cidr_block = ["10.10.0.0/16", "10.20.0.0/16"]
51+
52+
module "vpc-attachement" {
53+
source = "./../../"
54+
name = "transit-gateway"
55+
application = "clouddrove"
56+
environment = "test"
57+
label_order = ["environment", "application", "name"]
4058

4159
# VPC Attachements
60+
vpc_id = module.vpc-other.vpc_id
61+
destination_cidr_block = ["10.10.0.0/16", "10.20.0.0/16"]
4262
vpc_attachement_create = false # Enable After once create the subnets
43-
vpc_id = module.vpc.vpc_id
4463
use_existing_transit_gateway_id = true
45-
transit_gateway_id = "tgw-XXXXXXXXXXX"
46-
destination_cidr_block = ["10.0.0.0/8", "172.16.0.0/12"]
64+
transit_gateway_id = module.transit-gateway.transit_gateway_id
4765

48-
}
66+
#Transit gateway invitation accepter
67+
aws_ram_resource_share_accepter = true
68+
resource_share_arn = module.transit-gateway.resource_share_arn
69+
}

_example/single-account/example.tf

+6-6
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module "transit-gateway" {
6464
amazon_side_asn = 64512
6565
auto_accept_shared_attachments = "enable"
6666
default_route_table_propagation = "enable"
67-
description = "This transit Gateway create for testung purpose"
67+
description = "This transit Gateway create for testing purpose"
6868

6969
#TGW Share
7070
resource_share_enable = false
@@ -74,7 +74,7 @@ module "transit-gateway" {
7474
# VPC Attachements
7575
vpc_attachement_create = false # Enable After once create the subnets
7676
vpc_id = module.vpc.vpc_id
77-
destination_cidr_block = [ "10.0.0.0/8", "172.16.0.0/12"]
77+
destination_cidr_block = ["10.10.0.0/16", "10.20.0.0/16"]
7878

7979
}
8080

@@ -86,9 +86,9 @@ module "vpc-attachement" {
8686
label_order = ["environment", "application", "name"]
8787

8888
# VPC Attachements
89-
vpc_id = module.vpc-other.vpc_id
90-
destination_cidr_block = ["10.0.0.0/8", "172.16.0.0/12"]
91-
vpc_attachement_create = false # Enable After once create the subnets
89+
vpc_id = module.vpc-other.vpc_id
90+
destination_cidr_block = ["10.10.0.0/16", "10.20.0.0/16"]
91+
vpc_attachement_create = false # Enable After once create the subnets
9292
use_existing_transit_gateway_id = true
9393
transit_gateway_id = module.transit-gateway.transit_gateway_id
94-
}
94+
}

main.tf

+1-2
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,4 @@ resource "aws_route" "main" {
109109
resource "aws_ram_resource_share_accepter" "receiver_accept" {
110110
count = var.enable && var.aws_ram_resource_share_accepter ? 1 : 0
111111
share_arn = var.resource_share_arn
112-
}
113-
112+
}

outputs.tf

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ output "resource_share_arn" {
1414
output "tags" {
1515
value = module.labels.tags
1616
description = "A mapping of tags to assign to the resource."
17-
}
18-
17+
}

variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@ variable "aws_ram_resource_share_accepter" {
167167
type = bool
168168
default = false
169169
description = "Accepter the RAM."
170-
}
170+
}

0 commit comments

Comments
 (0)