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

aws_vpc_peering_connection fails to manage "requester" options when using peering across accounts #3676

Closed
cornfeedhobo opened this issue Mar 8, 2018 · 6 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@cornfeedhobo
Copy link

cornfeedhobo commented Mar 8, 2018

Terraform Version

Terraform v0.11.3

Affected Resource(s)

  • aws_vpc_peering_connection

Terraform Configuration Files

resource "aws_vpc_peering_connection" "requester" {
  provider = "aws.requester"

  count = "${local.enabled}"
  tags  = "${merge(local.tags, map("Side", "Requestor"))}"

  peer_owner_id = "${var.accepter-account_id}"
  peer_vpc_id   = "${var.accepter-vpc_id}"
  vpc_id        = "${var.requester-vpc_id}"

  requester {
    allow_remote_vpc_dns_resolution = "true" // this isn't allowed using cross-account?
  }

  accepter {
    allow_remote_vpc_dns_resolution = "true" // this is ignored when not using auto-accept?
  }
}

resource "aws_vpc_peering_connection_accepter" "accepter" {
  provider = "aws.accepter"

  count = "${local.enabled}"
  tags  = "${merge(local.tags, map("Side", "Acceptor"))}"

  vpc_peering_connection_id = "${aws_vpc_peering_connection.requester.id}"
  auto_accept               = "true"
}

Expected Behavior

The requester block should apply, but there is no mechanism to supply different credentials for just that operation.

Actual Behavior

* aws_vpc_peering_connection.requester: Error modifying VPC Peering Connection options: OperationNotPermitted: User 012345678901 does not have permission to modify the accepter side peering options

Steps to Reproduce

  1. terraform apply

Important Factoids

This seems to only relate to peering VPCs in different accounts.

Suggested solution

If the AST has a aws_vpc_peering_connection_accepter, use it, and it's provider, to apply the configuration block.

@ajcann
Copy link

ajcann commented Mar 20, 2018

I've also just run into this issue.

@ewbankkit
Copy link
Contributor

I think this is the same problem with the allow_remote_vpc_dns_resolution attribute as in

See also #3097.

@ewbankkit
Copy link
Contributor

See my comments here that attempt to explain why this can't be resolved without a new aws_vpc_peering_connection_options resource.

@vancluever vancluever added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels Mar 28, 2018
@bflad bflad added this to the v1.17.0 milestone Apr 30, 2018
@bflad
Copy link
Contributor

bflad commented Apr 30, 2018

The new aws_vpc_peering_connection_options resource for managing these dependency issues has been merged via #3909 and will release with v1.17.0 of the AWS provider, likely in two days.

@bflad bflad closed this as completed Apr 30, 2018
@bflad
Copy link
Contributor

bflad commented May 2, 2018

The new resource has been released in version 1.17.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 6, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

No branches or pull requests

5 participants