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

Enabling database subnets with NAT gateway routes fails with one NAT gateway per AZ #516

Closed
Chili-Man opened this issue Oct 6, 2020 · 3 comments · Fixed by #518
Closed

Comments

@Chili-Man
Copy link
Contributor

When provisioning a VPC with the following options (in us-east-1 for example):

  database_subnets  = [
    "10.50.160.0/22",
    "10.50.164.0/22",
    "10.50.168.0/22",
    "10.50.172.0/22",
    "10.50.176.0/22",
   ]

  create_database_subnet_route_table = true
  create_database_nat_gateway_route  = true 
  create_database_subnet_group       = false


  enable_nat_gateway       = true
  one_nat_gateway_per_az   = true
  single_nat_gateway       = false

The following error occurs:

Error: Error creating route: RouteAlreadyExists: The route identified by 0.0.0.0/0 already exists.
	status code: 400, request id: 6739c57a-097a-433d-a032-28fe6835033f

Error: Error creating route: RouteAlreadyExists: The route identified by 0.0.0.0/0 already exists.
	status code: 400, request id: c4ab4221-dcc8-4eb0-b976-e5f15f6c7f47

Error: Error creating route: RouteAlreadyExists: The route identified by 0.0.0.0/0 already exists.
	status code: 400, request id: 99a91d24-cb7b-4b4c-90db-e68e8faf1625

Error: Error creating route: RouteAlreadyExists: The route identified by 0.0.0.0/0 already exists.
	status code: 400, request id: ad82436e-223e-4f90-91e9-5b12fc096c11

The problem lies here:

Only one database route table for all of the database subnets is created, but when enabling the create_database_nat_gateway_route and one_nat_gateway_per_az option, the database route rule resource expects there to be more then 1 database route table. However, what ends up happening is that it tries to modify that single database route table the same number of times there are nat gateways which causes the above RouteAlreadyExists error.

The solution would be to create multiple database route tables when both create_database_nat_gateway_route and one_nat_gateway_per_az are enabled, then it should work as expected.

@Chili-Man
Copy link
Contributor Author

It appears that someone else recently ran into this issue and has a pr open to address it: #494

@Chili-Man
Copy link
Contributor Author

new pr to address these issues: #518

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant