Skip to content

Commit

Permalink
Merge pull request #5 from clouddrove/slave
Browse files Browse the repository at this point in the history
fix: Updated Files
  • Loading branch information
Sohan Yadav committed Apr 28, 2020
2 parents 040e2c0 + aea395f commit 5a1379f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ module "transit-gateway" {
use_existing_transit_gateway_id = true
transit_gateway_id = "tgw-XXXXXXXXXXX"
destination_cidr_block = ["10.0.0.0/8", "172.16.0.0/12"]

}
}
File renamed without changes.
14 changes: 7 additions & 7 deletions _example/single-account/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module "vpc-other" {
environment = "test"
label_order = ["environment", "application", "name"]

cidr_block = "10.20.0.0/16"
cidr_block = "192.168.0.0/16"
}

module "subnets-other" {
Expand Down Expand Up @@ -64,7 +64,7 @@ module "transit-gateway" {
amazon_side_asn = 64512
auto_accept_shared_attachments = "enable"
default_route_table_propagation = "enable"
description = "This transit Gateway create for testung purpose"
description = "This transit Gateway create for testing purpose"

#TGW Share
resource_share_enable = false
Expand All @@ -74,7 +74,7 @@ module "transit-gateway" {
# VPC Attachements
vpc_attachement_create = false # Enable After once create the subnets
vpc_id = module.vpc.vpc_id
destination_cidr_block = [ "10.0.0.0/8", "172.16.0.0/12"]
destination_cidr_block = ["192.168.0.0/16"]

}

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

# VPC Attachements
vpc_id = module.vpc-other.vpc_id
destination_cidr_block = ["10.0.0.0/8", "172.16.0.0/12"]
vpc_attachement_create = false # Enable After once create the subnets
vpc_id = module.vpc-other.vpc_id
destination_cidr_block = ["10.10.0.0/16"]
vpc_attachement_create = false # Enable After once create the subnets
use_existing_transit_gateway_id = true
transit_gateway_id = module.transit-gateway.transit_gateway_id
}
}
13 changes: 11 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ resource "aws_ec2_transit_gateway_vpc_attachment" "main" {
"Name" = format("%s-vpc-attachment", module.labels.id)
}
)

depends_on = [
data.aws_subnet_ids.main
]
}

#Module : AWS RAM RESOURCE SHARE
Expand Down Expand Up @@ -90,6 +94,11 @@ resource "aws_ram_resource_association" "main" {
data "aws_route_tables" "main" {
count = var.enable && var.vpc_attachement_create ? 1 : 0
vpc_id = var.vpc_id

filter {
name = "tag:Application"
values = [var.application]
}
}

#Module : AWS ROUTE
Expand All @@ -102,12 +111,12 @@ resource "aws_route" "main" {
transit_gateway_id = var.use_existing_transit_gateway_id == false ? join("", aws_ec2_transit_gateway.main.*.id) : var.transit_gateway_id
depends_on = [
data.aws_route_tables.main,
data.aws_subnet_ids.main,
aws_ec2_transit_gateway_vpc_attachment.main,
]
}

resource "aws_ram_resource_share_accepter" "receiver_accept" {
count = var.enable && var.aws_ram_resource_share_accepter ? 1 : 0
share_arn = var.resource_share_arn
}

}
3 changes: 1 addition & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ output "resource_share_arn" {
output "tags" {
value = module.labels.tags
description = "A mapping of tags to assign to the resource."
}

}
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ variable "aws_ram_resource_share_accepter" {
type = bool
default = false
description = "Accepter the RAM."
}
}

0 comments on commit 5a1379f

Please sign in to comment.