Editing a connection
Editing a connection in the UI
To edit a connection to a transit gateway, follow these steps:
-
From your browser, open the IBM Cloud console 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 edit a connection.
If you are in the expanded view, click View details.
-
From the Connections page, click the Actions menu
next to the connection that you want to edit and select Edit.
From here, you can change the name of the selected network connection.
Editing a connection from the CLI
To edit a connection from the CLI, execute this command:
ibmcloud tg connection-update|cu GATEWAY_ID CONNECTION_ID --name NAME [--output json] [-h, --help]
Where:
-
GATEWAY_ID: ID of the gateway the connection being updated is on.
-
CONNECTION_ID: ID of the connection to update.
-
--name: New name of the connection.
-
--output json: Optional: Specify if you want the output displayed in JSON format.
-
--help | -h: Optional: Get help on this command.
Example
This example illustrates updating the name of a connection to MyConn2
:
ibmcloud tg cu $gateway $connection --name MyConn2
Editing a connection with the API
You can update the name of a connection for a transit gateway with the API.
Example Request
This example illustrates editing the name of a transit gateway connection:
curl -H "Content-Type: application/json" -X PATCH https://$TS_ENDPOINT/v1/transit_gateways/$GATEWAY_ID/connections/$CONNECTION_ID?version=2020-03-31 -H "authorization: Bearer $IAM_TOKEN" -d '{
"name": "Transit_Service_BWTN_SJ_DL",
"prefix_filters_default": "permit"
}'
Example Response
The following response indicates that the connection was updated successfully:
{
"name": "Transit_Service_BWTN_SJ_DL",
"network_id": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b",
"network_type": "vpc",
"id": "1a15dca5-7e33-45e1-b7c5-bc690e569531",
"base_connection_id": "975f58c1-afe7-469a-9727-7f3d720f2d32",
"created_at": "2022-02-10T14:52:54.918Z",
"local_bgp_asn": 64490,
"local_gateway_ip": "192.168.100.1",
"local_tunnel_ip": "192.168.129.2",
"mtu": 9000,
"network_account_id": "28e4d90ac7504be694471ee66e70d0d5",
"prefix_filters": [
{
"action": "permit",
"before": "1a15dcab-7e40-45e1-b7c5-bc690eaa9782",
"created_at": "2022-02-10T14:52:54.918Z",
"ge": 0,
"id": "1a15dcab-7e30-45e1-b7c5-bc690eaa9865",
"le": 32,
"prefix": "192.168.100.0/24",
"updated_at": "2022-02-10T14:52:54.918Z"
}
],
"prefix_filters_default": "permit",
"remote_bgp_asn": 65010,
"remote_gateway_ip": "10.242.63.12",
"remote_tunnel_ip": "192.168.129.1",
"request_status": "pending",
"status": "attached",
"updated_at": "2022-02-10T14:52:54.918Z",
"zone": {
"name": "us-south-1"
}
}
For more information, see Updates specified Transit Gateway connection in the Transit Gateway API reference.
Editing a connection using terraform
You can specify the following argument references for your resource when editing a transit gateway connection:
Argument | Details |
---|---|
gateway Required String |
Enter the transit gateway identifier. |
network_type Required String |
Enter the network type. Allowed values are classic, directlink, gre_tunnel, unbound_gre_tunnel, and vpc |
name Optional String |
Enter a name. If the name is not given, the default name is provided based on the network type, such as vpc for network type VPC and classic for network type classic. |
Example
This example illustrates editing a transit gateway connection in Terraform:
resource "ibm_tg_connection" "test_ibm_tg_connection" {
gateway = ibm_tg_gateway.test_tg_gateway.id
network_type = "vpc"
name = "myconnection"
}