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

VPC: Invalid availability zone #36

Closed
fiducioso-dan opened this issue Nov 9, 2016 · 11 comments
Closed

VPC: Invalid availability zone #36

fiducioso-dan opened this issue Nov 9, 2016 · 11 comments

Comments

@fiducioso-dan
Copy link

Apparently us-east-1b isn't a valid AZ for creating subnets in my account.

CREATE_FAILED	AWS::EC2::Subnet	SubnetBPrivate	Value (us-east-1b) for parameter availabilityZone is invalid. Subnets can currently only be created in the following availability zones: us-east-1d, us-east-1e, us-east-1a, us-east-1c.
@andreaswittig
Copy link
Contributor

We are using Fn::GetAZs to determine a valid availability zone. So this should not happen. :)

Which template are you using? The newest version?

@fiducioso-dan
Copy link
Author

I clicked the Launch Stack button on this page for 3 AZs.

The AZ us-east-1b is a valid AZ in my account, but I cannot create new subnets in that AZ. It seems that Fn::GetAZs lists all AZs, not just the ones that subnets may be created in, see this SO question.

@andreaswittig
Copy link
Contributor

Fine, didn't expect that behavior. Any ideas for a solution, that is still simple to use?

Am 10.11.2016 um 19:18 schrieb Dan McDonald notifications@github.com:

I clicked the Launch Stack button on this page for 3 AZs.

The AZ us-east-1b is a valid AZ in my account, but I cannot create new subnets in that AZ. It seems that Fn::GetAZs lists all AZs, not just the ones that subnets may be created in, see this SO question.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@fiducioso-dan
Copy link
Author

I don't think there's any reasonable way to detect and skip AZs that are invalid for VPC subnets in CloudFormation.

Probably the least painful solution is to add a parameter of type List<AWS::EC2::AvailabilityZone::Name> and let users pick which AZs to use.

@michaelwittig
Copy link
Contributor

For the EC2-VPC platform, the Fn::GetAZs function returns only Availability Zones that have a default subnet unless none of the Availability Zones has a default subnet; in that case, all Availability Zones are returned.
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getavailabilityzones.html

@michaelwittig
Copy link
Contributor

@fiducioso-dan can you check if you have a default vpc in the region where you deploy the stack? You will find the VPCs here: https://console.aws.amazon.com/vpc/home#vpcs:
There is a Default VPC column to indicate if the VPC is a default vpc.

@Ruprect
Copy link

Ruprect commented Nov 15, 2016

@michaelwittig Yes I do have a default VPC:

image

Should I reference that instead of 10.200.0.0/16 that I have entered as a value for when I ran the template?

@btsuhako
Copy link
Contributor

Just another datapoint for troubleshooting: I was able to successfully launch the 3 AZ template into the us-west-2 region in Oregon. I did not have a default VPC resource before doing so.

@michaelwittig
Copy link
Contributor

@fiducioso-dan do you have developer, business or enterprise support in the AWS account where the template fails? I can not reproduce the issue in any of my accounts where I have a support plan. Would be interested in what the AWS Support has to say.

@michaelwittig
Copy link
Contributor

michaelwittig commented Nov 17, 2016

@fiducioso-dan the issue in #37 was that there was a default vpc but not a subnet in each availability zone. Can you please double check if you have a subnet in each AZ for the default vpc.

@mfonsen
Copy link

mfonsen commented Dec 23, 2016

With classic AWS account without default VPCs I ran into this issue as well.

Contacted AWS support and they confirmed that there's no way to automatically determine available AZs for subnet creation in CloudFormation. Their suggestion was similar to SO answer mentioned above which requires manual steps.

Thank you for the valuable templates. This was not the first time I found helpful examples from your repository.

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

No branches or pull requests

6 participants