With the IBM Cloud® Transit Gateway action module, you can approve or reject connection requests for a cross-account VPCs connection that uses a transit gateway. This scenario expects one account to own the transit gateway and one of the VPCs and a different account to own the second VPC. That second account receives an approval request that must be approved before the connection can be established.
For more information, see adding a cross-account connection in the IBM Cloud Docs.
# provider for account B
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key_ext # pragma: allowlist secret external account apikey
region = var.region_account_b
alias = "accountB"
}
module "tg_gateway_connection_crossaccounts_approve" {
source = "terraform-ibm-modules/transit-gateway/ibm//modules/terraform-ibm-transit-gateway-action"
version = "latest" # Replace "latest" with a release version to lock into a specific release
vpc_connection_ids = ["1f6df0af-c2b6-4f1a-97dd-29ed50a8e1f3"] // ID of the transit gateway connection resource
transit_gw_id = module.tg_gateway_connection.tg_id // ID of the transit gateway resource
action = "approve"
providers = {
ibm = ibm.accountB
}
}
Name | Version |
---|---|
terraform | >= 1.0.0 |
ibm | >= 1.52.0, < 2.0.0 |
No modules.
Name | Type |
---|---|
ibm_tg_connection_action.classic_tg_cross_connection_approval | resource |
ibm_tg_connection_action.vpc_tg_cross_connection_approval | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
action | Action to peform on the list of cnnection ids. Allowed values are 'approve' or 'reject' | string |
n/a | yes |
classic_connection_ids | The list of classic connection IDs to perform the action for the account owner of ibmcloud_api_key | list(string) |
[] |
no |
transit_gw_id | ID to the transit gateway where the cross-account connection is created | string |
n/a | yes |
vpc_connection_ids | The list of vpc connection IDs to perform the action for the account owner of ibmcloud_api_key | list(string) |
[] |
no |
Name | Description |
---|---|
classic_tg_crossaacount_approvals | Result for classic crossaccount actions |
vpc_tg_crossaacount_approvals | Result for vpc crossaccount actions |
To set up your local development environment, see Local development setup in the project documentation.