-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Can't figure out how to connect cross-region peer with vpc-peering
#42
Comments
vpc-peering
vpc-peering
Your configuration is correct. I had the same problem myself. I looked into the code of this module and realised that it does not support cross-region VPC peering. I think it might be tricky to implement and support with the way that this module is designed. However, that being said, there is another module by cloudposse that supports multi-region, multi-account VPC peering.12 It requires passing in credentials to the accounts where the resources are being provisioned. I have tested the module and got it to work as expected. If you are security-conscious, you could set up separate IAM Roles with bare minimum permissions that are required and pass them to the module to assume and create the resources. But that is involved and complicated if you are only trying to import an existing peering connection into your terraform state. Footnotes |
Same issue here, this is still unresolved. |
this module works both cross-region and cross-account https://github.com/cloudposse/terraform-aws-vpc-peering-multi-account You can use it in the same account, but cross-region as well |
the accepter and requester both use separate AWS providers, e.g. https://github.com/cloudposse/terraform-aws-vpc-peering-multi-account/blob/master/accepter.tf provider "aws" {
alias = "accepter"
region = var.accepter_region
profile = var.accepter_aws_profile
skip_metadata_api_check = var.skip_metadata_api_check
dynamic "assume_role" {
for_each = local.enabled && var.accepter_aws_assume_role_arn != "" ? ["true"] : []
content {
role_arn = var.accepter_aws_assume_role_arn
}
}
access_key = var.accepter_aws_access_key
secret_key = var.accepter_aws_secret_key
token = var.accepter_aws_token
} you can set the regions to be diff - in this case it will be cross-region. Or the same, in which case it will be in the same region You can set So cross-account and cross-region can be controlled separately |
Can't figure out how to connect cross-region Peer with
vpc-peering
Given a module like this with an intended peering connection with peer "XXXX" in us-west-2 with a vpc "YYYY" in us-east-1:
It can't detect the "YYYY" vpc_id in the other region, when running
terraform plan
, so returns something likeApologies if this is just be my inexperience & not understanding how to configure this. Is there something I should be providing in attributes, provider, or in the acceptor_vpc_id itself? Or is there a missing configuration option in this module?
I am trying to import an existing vpc-peer into terraform. I've imported one with VPCs in the same region & this is my 1st attempt at getting cross-regional VPC peer.
Expected Behavior
The VPC visible to terraform plan & appropriate "to add" messages are returned
.
Steps to Reproduce
Steps to reproduce the behavior:
and a module like "vpc_peering_test" in bug description above, with requestor vpc in us-west-2 and acceptor vpc in us-east-1
2. Run
terraform init
3. Enter 'terraform plan`
4. See error
Environment (please complete the following information):
Anything that will help us triage the bug will help. Here are some ideas:
Thank you so much for your consideration and for writing
terraform-aws-vpc-peering
!The text was updated successfully, but these errors were encountered: