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

[BUG] availability zones are hard coded to us-east-1 values #26

Open
DataBoyTX opened this issue Mar 12, 2023 · 3 comments
Open

[BUG] availability zones are hard coded to us-east-1 values #26

DataBoyTX opened this issue Mar 12, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@DataBoyTX
Copy link

Describe the bug
the region is a terraform variable the user can set in terraform.tfvars (misnamed "availability_zone_name", should likely be changed to region for clarity), but if you switch something other than the default of us-east-1, that results in several errors similar to the below, because the azs are hardcoded to us-east-1x azs

azs = ["us-east-1a", "us-east-1b", "us-east-1c"]

│ Error: error creating EC2 Subnet: InvalidParameterValue: Value (us-east-1a) for parameter availabilityZone is invalid. Subnets can currently only be created in the following availability zones: us-east-2a, us-east-2b, us-east-2c.
│ 	status code: 400, request id: f1c03dc3-e39b-49ab-8985-f3ff04673721
│
│   with module.vpc.aws_subnet.public[0],
│   on .terraform/modules/vpc/main.tf line 350, in resource "aws_subnet" "public":
│  350: resource "aws_subnet" "public" {
│

To Reproduce
change the region to something other us-east-1 in terraform.tfvars and run terraform plan or apply

Expected behavior

  • rename availability_zone_name to region in terraform.tfvars, vars.tf and align in main.tf
  • add availability zones to vars.tf, terraform.tfvars or come up with an alternative to hard coding the values

Actual behavior

results in errors like:

│ Error: error creating EC2 Subnet: InvalidParameterValue: Value (us-east-1a) for parameter availabilityZone is invalid. Subnets can currently only be created in the following availability zones: us-east-2a, us-east-2b, us-east-2c.
│ 	status code: 400, request id: f1c03dc3-e39b-49ab-8985-f3ff04673721
│
│   with module.vpc.aws_subnet.public[0],
│   on .terraform/modules/vpc/main.tf line 350, in resource "aws_subnet" "public":
│  350: resource "aws_subnet" "public" {
│
@DataBoyTX DataBoyTX added the bug Something isn't working label Mar 12, 2023
@webcoderz
Copy link
Contributor

Yea iirc I couldn't add a var right there but will check agn thx!

@webcoderz
Copy link
Contributor

Or actually I think it was I thought it redundant to have to specify az by just us east , and then subnet in a diff var so I thought verbosity here made more sense

@webcoderz
Copy link
Contributor

should be solved here : 131471c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants