-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b5de278
Showing
4 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#Azure Compute Module | ||
|
||
##Who Maintains and Approves this Module? | ||
|
||
##Usage | ||
|
||
##Inputs | ||
|
||
##Outputs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
resource "random_integer" "tvpc_subnet" { | ||
min = 1 | ||
max = 250 | ||
} | ||
|
||
resource "aviatrix_vpc" "aws_transit" { | ||
cloud_type = var.cloud_type | ||
account_name = var.account_name | ||
region = var.region | ||
name = "transit-vpc${var.cloud_type}" | ||
cidr = cidrsubnet("10.0.0.0/8", 8, random_integer.tvpc_subnet.result) | ||
aviatrix_transit_vpc = (var.cloud_type == 1) ? true : false | ||
aviatrix_firenet_vpc = (var.cloud_type == 1) ? false: true | ||
} | ||
|
||
resource "aviatrix_transit_gateway" "transit_gateway_tvpc" { | ||
cloud_type = var.cloud_type | ||
vpc_reg = var.region | ||
vpc_id = aviatrix_vpc.aws_transit.vpc_id | ||
account_name = aviatrix_vpc.aws_transit.account_name | ||
gw_name = "tvpc-gw${var.cloud_type}" | ||
ha_gw_size = var.avtx_gw_size | ||
gw_size = var.avtx_gw_size | ||
subnet = (var.cloud_type == 1) ? aviatrix_vpc.aws_transit.subnets[5].cidr : aviatrix_vpc.aws_transit.subnets[2].cidr | ||
ha_subnet = (var.cloud_type == 1) ? aviatrix_vpc.aws_transit.subnets[7].cidr : aviatrix_vpc.aws_transit.subnets[3].cidr | ||
enable_active_mesh = true | ||
enable_hybrid_connection = (var.cloud_type == 1) ? true : false | ||
connected_transit = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
output "tvpc_id" { | ||
value = aviatrix_vpc.aws_transit.vpc_id | ||
} | ||
|
||
output "avtx_gw_name" { | ||
value = aviatrix_transit_gateway.transit_gateway_tvpc.gw_name | ||
} | ||
|
||
output "transit_gw_public_ip" { | ||
value = aviatrix_transit_gateway.transit_gateway_tvpc.eip | ||
} | ||
|
||
output "transit_gw_private_ip" { | ||
value = aviatrix_transit_gateway.transit_gateway_tvpc.private_ip | ||
} | ||
|
||
output "transit_hagw_public_ip" { | ||
value = aviatrix_transit_gateway.transit_gateway_tvpc.ha_eip | ||
} | ||
|
||
output "tvpc_cidr" { | ||
value = aviatrix_vpc.aws_transit.cidr | ||
} | ||
#output "transit_hagw_private_ip" { | ||
# value = aviatrix_transit_gateway.transit_gateway_tvpc.eip | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
locals { | ||
aws = 1 | ||
gcp = 4 | ||
azure = 8 | ||
} | ||
|
||
variable cloud_type { | ||
default = 1 | ||
} | ||
|
||
variable region { | ||
default = "us-east-1" | ||
} | ||
|
||
variable avtx_gw_size { | ||
default = "t2.micro" | ||
} | ||
|
||
variable hpe { | ||
default = false | ||
} | ||
|
||
variable account_name {} | ||
#variable aws_transit_gw {} |