copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2024-12-18 |
editing, managing, manage, edit, add, connection |
transit-gateway |
{{site.data.keyword.attribute-definition-list}}
{: #deleting-connections}
{: #deleting-connections-ui} {: ui}
To delete a connection from a transit gateway, follow these steps:
-
From your browser, open the {{site.data.keyword.cloud_notm}} console{: external} and log in to your account.
-
Select the Navigation Menu icon
from the upper left, then click Infrastructure > Network > Transit Gateway.
-
Click the name of the transit gateway where you want to delete a connection.
If you are in the expanded view, click View details. {: tip}
-
From the Connections page, click the Actions menu
next to the connection that you want to delete and select Delete.
{: #deleting-connections-cli} {: cli}
You can delete an existing connection with the CLI with the following command:
ibmcloud tg connection-delete|cd GATEWAY_ID CONNECTION_ID [-f, --force] [-h, --help]
{: pre}
Where:
-
GATEWAY_ID: ID of the gateway of the connection being deleted.
-
CONNECTION_ID: ID of the connection being deleted.
-
--force | -f: Optional: Force the delete without confirmation.
-
--help | -h: Optional: Get help on this command.
{: #connection-delete-example}
This example illustrates deleting a connection without confirmation:
ibmcloud tg cd $gateway $connection -f
{: pre}
{: #deleting-connections-api} {: api}
You can delete a connection with the API.
After the specified connection is detached, entities still within the transit gateway will no longer be able to communicate directly to it through the IBM Cloud private backbone. {: note}
{: #deleting-connections-api-request-example}
This example request illustrates deleting a connection:
curl -X DELETE "https://transit.cloud.ibm.com/v1/transit_gateways/$TRANSIT_GATEWAY_ID/connections/$CONNECTION_ID?version=2022-02-09" -H "accept: */*"
{: pre}
{: #example-returned-response}
This example illustrates the returned response when the connection could not be found:
{
"errors": [
{
"code": "not_found",
"message": "Cannot find Connection",
"more_info": "https://cloud.ibm.com/apidocs/transit-gateway#error-handling"
}
],
"trace": "request_id"
}
{: pre}
For more information, see Removes a connection from Transit Gateway in the Transit Gateway API reference. {: note}
{: #deleting-connections-terraform} {: terraform}
To delete a connection, perform the following command:
terraform destroy -target=resource_type.resource_name
{: pre}
Where:
-
resource_type: ibm_tg_connection
-
resource_name: Name of connection
{: #deleting-connections-terraform-example}
This example illustrates deleting a connection using Terraform:
terraform destroy -target=ibm_tg_connection.test_ibm_tg_connection
{: pre}