Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.

default AZ for the region - #12

Merged
achille-roussel merged 4 commits into
masterfrom
default-az
Jun 19, 2016
Merged

achille-roussel merged 4 commits into
masterfrom
default-az

Conversation

@achille-roussel

Copy link
Copy Markdown
Contributor

@segmentio/infra

This adds a mapping of default availability zones for each AWS region, that way when a stack module is instantiated, only the region can be specified and the config dynamically figures out what AZ to use.

Note that the AZ may be changing from time to time so we'll likely have to edit these values in the future.

Comment thread main.tf Outdated
description = "a mapping of the default availability zones for each AWS region"

default = {
us-east-1 = "us-east-1a,us-east-1b,us-east-1c,us-east-1e"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice this looks good.

This reminds me, we may want to re-work how we're doing the VPC networking in this case since we'd also need the CIDR blocks depending on the count of availability zones.

We could definitely achieve it, but we'll need a bit more to get there, something like:

count = "${length($split(",", var.availability_zones))}"

]https://github.com/segmentio/stack-old/pull/96/files

@calvinfo

Copy link
Copy Markdown
Contributor

one note about the different az-counts, lgtm otherwise!

@achille-roussel

Copy link
Copy Markdown
Contributor Author

I revisited the implementation, gave up on trying to generate stuff dynamically and instead added documentation to help understand what needs to be set.
We're really pushing terraform to its edges here unfortunately, I'd rather avoid increasing the internal complexity when the work around is quite simple (simply setting a couple more properties to change the region).

@calvinfo

Copy link
Copy Markdown
Contributor

Sounds fair to me. Yeah, I wouldn't want to break too many of the abstractions just to handle this other case

@achille-roussel
achille-roussel merged commit e51e343 into master Jun 19, 2016
@achille-roussel
achille-roussel deleted the default-az branch June 19, 2016 01:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants