GithubHelp home page GithubHelp logo

Comments (9)

morp86 avatar morp86 commented on August 10, 2024

Hey @2stacks, did you ever figure out this issue? Im bumping into the exact same problem.

As you mentioned, the VPC attachment needs to be created in Account B but the association/propagation or routes need to be created in Account A. The module tries to create all resources in Account B and fails.

Any help would be appreciated.

from terraform-aws-transit-gateway.

2stacks avatar 2stacks commented on August 10, 2024

from terraform-aws-transit-gateway.

morp86 avatar morp86 commented on August 10, 2024

Thanks for your quick reply. Id be mainly interested in the part you used to get the association / propagation working for attachments created in other accounts, if thats included in your code.

If you wouldn't mind sharing your TGW code, I might be able to figure out / pull the parts I need.

from terraform-aws-transit-gateway.

ThisIsQasim avatar ThisIsQasim commented on August 10, 2024

Quite a few people are reporting this issue (including myself) @antonbabenko @tfhartmann can you take a look here? Any help would be appreciated.

from terraform-aws-transit-gateway.

2stacks avatar 2stacks commented on August 10, 2024

Was there supposed to be a link? I plan to upload what I have for comment/collaboration. It's fairly opinionated so it may not make a good module but perhaps it can be used to improve the existing TGW module.

from terraform-aws-transit-gateway.

morp86 avatar morp86 commented on August 10, 2024

To close the loop here. I ended rewriting allot of the code as well. The way to get around creating the resources in the wrong account is by adding an addition config block to you TGW module section.

Section for TGW account:

module "transit_gateway" {
source = "../../"

#Takes care of sharing the TGW resource to other accounts using AWS RAM.
ram_resource_share_enabled = true
ram_principal = var.customer_account_numbers
allow_external_principals = true

providers = {
aws = aws.network
}

tags_name = "xxxxx"
description = "xxxxx"
tags_environment = "prod"

#Creates TGW in Networking account
create_transit_gateway = true
create_transit_gateway_route_table = true
default_route_table_association = "enable"
default_route_table_propagation = "disable"
create_transit_gateway_route_table_association = false
create_transit_gateway_route_table_propagation = true
existing_transit_gateway_route_table_id = module.transit_gateway.transit_gateway_shared_route_table_id
create_transit_gateway_route_table_association_and_propagation = false

#Create route table association and propagation for Customer VPC attachments
config = {

#  vpc-123456 = {                              <-- Please use VPC-ID for name.
#  vpc_id                            = null             <-- Can be set to null, as we arent create an attachment.
#  subnet_ids                        = null             <-- Can be set to null, as we arent create an attachment.
#  transit_gateway_vpc_attachment_id = module.account1234567890.transit_gateway_vpc_attachment_ids["vpc-123456"]   <-- Reuse attachment ID create by the Customer account module.
#},

#Module for attachment in customer account:

module "account1234567890" {
source = "../../"

providers = {
aws = aws.account1234567890
}

ram_resource_share_enabled = true
ram_principal = null
ram_resource_share_arn = module.transit_gateway.ram_resource_share_id
existing_transit_gateway_id = module.transit_gateway.transit_gateway_id
existing_transit_gateway_route_table_id = module.transit_gateway.transit_gateway_shared_route_table_id
create_transit_gateway = false
create_transit_gateway_route_table = false
create_transit_gateway_vpc_attachment = true
create_transit_gateway_route_table_association = false
create_transit_gateway_route_table_propagation = false
create_transit_gateway_route_table_association_and_propagation = false

config = {
vpc-123456 = {
vpc_id = "vpc-123456"
subnet_ids = ["subnet-11111111","subnet-2222222","subnet-3333333"]
transit_gateway_vpc_attachment_id = null # <-- this wont be used in module for customers.
accountnumber = "123456" # <--- Im using this for RAM sharing
}
}
}

Hope this helps!

from terraform-aws-transit-gateway.

github-actions avatar github-actions commented on August 10, 2024

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

from terraform-aws-transit-gateway.

github-actions avatar github-actions commented on August 10, 2024

This issue was automatically closed because of stale in 10 days

from terraform-aws-transit-gateway.

github-actions avatar github-actions commented on August 10, 2024

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.

from terraform-aws-transit-gateway.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.