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

Default Subnets not creating #191

Closed
domdepasquale opened this issue Jun 14, 2021 · 3 comments
Closed

Default Subnets not creating #191

domdepasquale opened this issue Jun 14, 2021 · 3 comments

Comments

@domdepasquale
Copy link
Contributor

Having an issue creating the default subnets as introduced in 35603a7

Strangely, it will create some of the subnets but not all. The error reported is

Error: Default subnet not found

  on main.tf line 47, in resource "aws_default_subnet" "default":
  47: resource "aws_default_subnet" "default" {

my provider is set to

provider "aws" {
  region = "ap-northeast-2"
}

for local testing.

I've tried terraform 13 and terraform 14 with no luck.

If I figure out what's causing the issue, i'll submit the PR.

@domdepasquale
Copy link
Contributor Author

FWIW, the current created state is

❯ terraform-14 state list
data.aws_availability_zones.all
aws_default_network_acl.default[0]
aws_default_route_table.default[0]
aws_default_security_group.default[0]
aws_default_subnet.default[0]
aws_default_subnet.default[1]
aws_default_subnet.default[2]
aws_default_vpc.default[0]

I've disabled flow log creation to narrow the scope of troubleshooting

@domdepasquale
Copy link
Contributor Author

Failing pattern seems to be

  1. Default Subnets created (by terraform?)
  2. Subnets deleted (by anything not terraform)
  3. Terraform can't put them back (even when state does not exist)
  4. Put them back via AWS CLI
  5. Terraform can regain control

Unsure what caused the deletion of these default subnets in the first place. But at this point I'll attribute this to something in our account setup, not this module. I'll close this issue.

@nozaq
Copy link
Owner

nozaq commented Jul 3, 2021

@dad264 Sorry for being late here. Yes, currently this module throws an error when a default subnet does not exists in any availability zones. The workaround would be to create missing default subnets.
Please check #198 for further information!

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

2 participants