Skip to content
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

Merged
merged 11 commits into from Jun 20, 2019

Conversation

Jamie-BitFlight
Copy link
Contributor

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 of 0 will create no private subnets, and any other value will create that many subnets, to a max of max_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 of 0 will create no public subnets, and any other value will create that many subnets, to a max of max_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.

@Jamie-BitFlight
Copy link
Contributor Author

This closes #33

@Jamie-BitFlight
Copy link
Contributor Author

This closes #36

@osterman osterman requested a review from aknysh June 11, 2019 22:46
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 {
Copy link
Member

@aknysh aknysh Jun 12, 2019

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have revised.

@Jamie-BitFlight
Copy link
Contributor Author

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.

@osterman osterman requested a review from aknysh June 12, 2019 17:23
variables.tf Outdated Show resolved Hide resolved
@osterman
Copy link
Member

@Jamie-BitFlight please rebase. We've added tests.

@Jamie-BitFlight
Copy link
Contributor Author

@osterman its rebased!

@osterman osterman merged commit d7b8237 into cloudposse:master Jun 20, 2019
@osterman osterman mentioned this pull request Jun 20, 2019
@aknysh aknysh mentioned this pull request Jun 21, 2019
aknysh added a commit that referenced this pull request Jun 21, 2019
aknysh added a commit that referenced this pull request Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants