New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/set subnet counts #54
Feature/set subnet counts #54
Conversation
… or private). Added Example
… nested aws provider within the module
This closes #33 |
This closes #36 |
… nested aws provider within the module
variables.tf
Outdated
variable "max_subnet_count" { | ||
default = 0 | ||
description = "Sets the maximum amount of subnets to deploy. 0 will deploy a subnet for every provided availablility zone (in `availability_zones` variable) within the region" | ||
locals { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove locals
from variables.tf
and place into other TF files, e.g main.tf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have revised.
…cals in to it. Moved the public and private subnet locals into public.tf and private.tf.
This pull also resolves the issue brought up in #55 by having the region variable pass to the provider correctly, as it was missing before. |
@Jamie-BitFlight please rebase. We've added tests. |
@osterman its rebased! |
what
made the
availability_zones
list variable optional, when left empty it will use all az's available, otherwise it will only use the az's provided in the list.max_subnet_count
variable is depreciated, but kept in for now for backwards compatibility.By default max_subnet_count is
-1
which makes its length equivalent to the number of availability zones in the region or if AZ's are provided, it uses that number instead.If you are wanting to use 3 AZ's, but create 100 public subnets, you would need to set this value to
100
for now. In the future, this variable will be removed in favour of just setting a limit on the public, or private subnets.added
private_subnet_count
variable which can take a value of-1
to create a 1:1 subnet to availability zone count, a value of0
will create no private subnets, and any other value will create that many subnets, to a max ofmax_subnet_count
.added
public_subnet_count
variable which can take a value of-1
to create a 1:1 subnet to availability zone count, a value of0
will create no public subnets, and any other value will create that many subnets, to a max ofmax_subnet_count
.why
I needed a dynamic subnet that was public only for a project I was on, but found that this module would create an even number of private subnets that weren't being used. I wanted to tidy this up so one could specify the number of subnets of public or private type that were needed.