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

Apply aws_route to multiple peering connections #14740

Closed
ctippur opened this issue May 22, 2017 · 6 comments
Closed

Apply aws_route to multiple peering connections #14740

ctippur opened this issue May 22, 2017 · 6 comments

Comments

@ctippur
Copy link

ctippur commented May 22, 2017

Hello,

I have 3 vps's - A, B, C

I need bi directional connection from A to B and B to C

When I get to B which is common between the peering connections, I seem to have hit a issue. If I have B - A before B-> C, B -> C route gets deleted.

For example

resource "aws_route" "r" {
  route_table_id            = "rtb-4fbb3ac4"
  destination_cidr_block    = "10.0.1.0/22"
  vpc_peering_connection_id = "pcx-45ff3dc1"
}

resource "aws_route" "r" {
  route_table_id            = "rtb-4fbb3ac4"
  destination_cidr_block    = "10.0.2.0/22"
  vpc_peering_connection_id = "pcx-45dd4ca2"
}

The connection to 10.0.2.0/22 trumps over 10.0.1.0/22. Wondering if this is a known issue or something that I am doing wrong.
Appreciate any input.

  • S
@ctippur
Copy link
Author

ctippur commented May 24, 2017

Any updates on this pls?

@ctippur
Copy link
Author

ctippur commented May 24, 2017

I need to add more information to this.

Here is the structure:

├── modules
│   └── vpc_stg
│       ├── main.tf
│       ├── outputs.tf
│       └── variables.tf
│   ├── app_server
│   │   ├── main.tf
│   │   ├── outputs.tf
│   │   ├── user_data.sh
│   │   └── variables.tf
└── stg
    ├── main.tf
    ├── notes
    ├── outputs.tf
    ├── terraform.tfstate.backup
    ├── terraform.tfvars
    └── variables.tf

I am creating a aws_route_table resource in app_server which creates a route table for 2 subnets. I am trying to access this in vpc_stg and trying to add routes to that via:

resource "aws_route" "new2prod" {
  count = 2
  route_table_id = "${element(var.route_table_nat_id, count.index)}"
  destination_cidr_block = "10.0.0.0/16"
  vpc_peering_connection_id = "${aws_vpc_peering_connection.prod.id}"
}

resource "aws_route" "new2dev" {
  count = 2
  route_table_id = "${element(var.route_table_nat_id, count.index)}"
  destination_cidr_block = "172.31.0.0/16"
  vpc_peering_connection_id = "${aws_vpc_peering_connection.peer.id}"
}

These routes are not getting added. Appreciate any help.

  • S

@ctippur
Copy link
Author

ctippur commented May 24, 2017

I see a similar reference here #3548
Not sure how to implement this.

@ctippur
Copy link
Author

ctippur commented May 30, 2017

Any updates on this please?

@Puneeth-n
Copy link
Contributor

Puneeth-n commented May 31, 2017

@ctippur can you share the aws_route_table resource in app_server module? and how you are linking both the modules in stg

@ghost
Copy link

ghost commented Apr 9, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants