terraform-aws-vpc
terraform-aws-vpc copied to clipboard
Add VPC custom subnet blocks
Is your request related to a new offering from AWS?
- No π
Is your request related to a problem? Please describe.
I need to create 3 subnets in us-east-1a to comunicate to my on-prem network. It does not need HA. To achieve that, I have to create 9 new subnets, distributed trough my var.azs = ["us-east-1a", "us-east-1b", "us-east-1c"].
The other 6 subnets will never be used. I need only the us-east-1a subnets.
Describe the solution you'd like.
Add customized private subnet blocks (like groups) with the possibility to define different AZ(s) and subnet_suffix (Name tags).
There are some standard blocks, like:
public_subnets: name-subnet-public-us-east-1a database_subnets: name-subnet-database-us-east-1a private_subnets: name-subnet-private-us-east-1a And so on...
They are distributed trough the var.azs.
However, It would be great if I could define aditional subnets that can be allocated in a specific AZ:
private_custom_blocks:
name-subnet-foo-us-west-1a name-subnet-bar-us-west-1a And so on...
Input a new optional variable to the module:
private_custom_blocks = {
foo = {
azs = ["us-west-2a"]
subnet_suffix = "subnet-foo"
tags = {}
subnets = ["10.10.192.0/27", "10.10.192.32/27", "10.10.192.64/27"]
},
bar = {
azs = ["us-west-2a", "us-west-2b", "us-west-2c"]
subnet_suffix = "subnet-bar"
tags = {}
subnets = ["10.10.224.0/27", "10.10.224.32/27", "10.10.224.64/27"]
},
xpto = {
azs = ["us-west-2a", "us-west-2b", "us-west-2c"]
subnet_suffix = "subnet-xpto"
tags = {
Foo = "bar"
}
subnets = ["10.10.240.0/27", "10.10.240.32/27", "10.10.240.64/27"]
}
}
Describe alternatives you've considered.
- Create a lot of subnets distributed trough
var.azsthat will never be alocated. - Create my own terraform module, but it wouldn't be available to community.
- Use other blocks, like
elasticache_subnets, to create the specific subnets, but it's not the right use for these vars.
Additional context
There is an initial PR describing the idea: #805