1. Packages
  2. Volcengine
  3. API Docs
  4. direct_connect
  5. GatewayRoute
Volcengine v0.0.28 published on Thursday, Apr 24, 2025 by Volcengine

volcengine.direct_connect.GatewayRoute

Explore with Pulumi AI

Provides a resource to manage direct connect gateway route

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";

const foo = new volcengine.direct_connect.GatewayRoute("foo", {
    destinationCidrBlock: "192.168.40.0/24",
    directConnectGatewayId: "dcg-172frxs5utjb44d1w33op****",
    nextHopId: "dcv-1729lrbfx7fuo4d1w34pk****",
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo = volcengine.direct_connect.GatewayRoute("foo",
    destination_cidr_block="192.168.40.0/24",
    direct_connect_gateway_id="dcg-172frxs5utjb44d1w33op****",
    next_hop_id="dcv-1729lrbfx7fuo4d1w34pk****")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/direct_connect"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := direct_connect.NewGatewayRoute(ctx, "foo", &direct_connect.GatewayRouteArgs{
			DestinationCidrBlock:   pulumi.String("192.168.40.0/24"),
			DirectConnectGatewayId: pulumi.String("dcg-172frxs5utjb44d1w33op****"),
			NextHopId:              pulumi.String("dcv-1729lrbfx7fuo4d1w34pk****"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var foo = new Volcengine.Direct_connect.GatewayRoute("foo", new()
    {
        DestinationCidrBlock = "192.168.40.0/24",
        DirectConnectGatewayId = "dcg-172frxs5utjb44d1w33op****",
        NextHopId = "dcv-1729lrbfx7fuo4d1w34pk****",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.direct_connect.GatewayRoute;
import com.pulumi.volcengine.direct_connect.GatewayRouteArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var foo = new GatewayRoute("foo", GatewayRouteArgs.builder()        
            .destinationCidrBlock("192.168.40.0/24")
            .directConnectGatewayId("dcg-172frxs5utjb44d1w33op****")
            .nextHopId("dcv-1729lrbfx7fuo4d1w34pk****")
            .build());

    }
}
Copy
resources:
  foo:
    type: volcengine:direct_connect:GatewayRoute
    properties:
      destinationCidrBlock: 192.168.40.0/24
      directConnectGatewayId: dcg-172frxs5utjb44d1w33op****
      nextHopId: dcv-1729lrbfx7fuo4d1w34pk****
Copy

Create GatewayRoute Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new GatewayRoute(name: string, args: GatewayRouteArgs, opts?: CustomResourceOptions);
@overload
def GatewayRoute(resource_name: str,
                 args: GatewayRouteArgs,
                 opts: Optional[ResourceOptions] = None)

@overload
def GatewayRoute(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 destination_cidr_block: Optional[str] = None,
                 direct_connect_gateway_id: Optional[str] = None,
                 next_hop_id: Optional[str] = None)
func NewGatewayRoute(ctx *Context, name string, args GatewayRouteArgs, opts ...ResourceOption) (*GatewayRoute, error)
public GatewayRoute(string name, GatewayRouteArgs args, CustomResourceOptions? opts = null)
public GatewayRoute(String name, GatewayRouteArgs args)
public GatewayRoute(String name, GatewayRouteArgs args, CustomResourceOptions options)
type: volcengine:direct_connect:GatewayRoute
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GatewayRouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GatewayRouteArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GatewayRouteArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GatewayRouteArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GatewayRouteArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var gatewayRouteResource = new Volcengine.Direct_connect.GatewayRoute("gatewayRouteResource", new()
{
    DestinationCidrBlock = "string",
    DirectConnectGatewayId = "string",
    NextHopId = "string",
});
Copy
example, err := direct_connect.NewGatewayRoute(ctx, "gatewayRouteResource", &direct_connect.GatewayRouteArgs{
	DestinationCidrBlock:   pulumi.String("string"),
	DirectConnectGatewayId: pulumi.String("string"),
	NextHopId:              pulumi.String("string"),
})
Copy
var gatewayRouteResource = new com.pulumi.volcengine.direct_connect.GatewayRoute("gatewayRouteResource", com.pulumi.volcengine.direct_connect.GatewayRouteArgs.builder()
    .destinationCidrBlock("string")
    .directConnectGatewayId("string")
    .nextHopId("string")
    .build());
Copy
gateway_route_resource = volcengine.direct_connect.GatewayRoute("gatewayRouteResource",
    destination_cidr_block="string",
    direct_connect_gateway_id="string",
    next_hop_id="string")
Copy
const gatewayRouteResource = new volcengine.direct_connect.GatewayRoute("gatewayRouteResource", {
    destinationCidrBlock: "string",
    directConnectGatewayId: "string",
    nextHopId: "string",
});
Copy
type: volcengine:direct_connect:GatewayRoute
properties:
    destinationCidrBlock: string
    directConnectGatewayId: string
    nextHopId: string
Copy

GatewayRoute Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GatewayRoute resource accepts the following input properties:

DestinationCidrBlock
This property is required.
Changes to this property will trigger replacement.
string
The cidr block.
DirectConnectGatewayId
This property is required.
Changes to this property will trigger replacement.
string
The id of direct connect gateway.
NextHopId
This property is required.
Changes to this property will trigger replacement.
string
The id of next hop.
DestinationCidrBlock
This property is required.
Changes to this property will trigger replacement.
string
The cidr block.
DirectConnectGatewayId
This property is required.
Changes to this property will trigger replacement.
string
The id of direct connect gateway.
NextHopId
This property is required.
Changes to this property will trigger replacement.
string
The id of next hop.
destinationCidrBlock
This property is required.
Changes to this property will trigger replacement.
String
The cidr block.
directConnectGatewayId
This property is required.
Changes to this property will trigger replacement.
String
The id of direct connect gateway.
nextHopId
This property is required.
Changes to this property will trigger replacement.
String
The id of next hop.
destinationCidrBlock
This property is required.
Changes to this property will trigger replacement.
string
The cidr block.
directConnectGatewayId
This property is required.
Changes to this property will trigger replacement.
string
The id of direct connect gateway.
nextHopId
This property is required.
Changes to this property will trigger replacement.
string
The id of next hop.
destination_cidr_block
This property is required.
Changes to this property will trigger replacement.
str
The cidr block.
direct_connect_gateway_id
This property is required.
Changes to this property will trigger replacement.
str
The id of direct connect gateway.
next_hop_id
This property is required.
Changes to this property will trigger replacement.
str
The id of next hop.
destinationCidrBlock
This property is required.
Changes to this property will trigger replacement.
String
The cidr block.
directConnectGatewayId
This property is required.
Changes to this property will trigger replacement.
String
The id of direct connect gateway.
nextHopId
This property is required.
Changes to this property will trigger replacement.
String
The id of next hop.

Outputs

All input properties are implicitly available as output properties. Additionally, the GatewayRoute resource produces the following output properties:

AccountId string
The id of account.
CreationTime string
The create time.
DirectConnectGatewayRouteId string
The id of direct connect gateway route.
Id string
The provider-assigned unique ID for this managed resource.
NextHopType string
The type of next hop.
RouteType string
The type of route.
Status string
The status info.
AccountId string
The id of account.
CreationTime string
The create time.
DirectConnectGatewayRouteId string
The id of direct connect gateway route.
Id string
The provider-assigned unique ID for this managed resource.
NextHopType string
The type of next hop.
RouteType string
The type of route.
Status string
The status info.
accountId String
The id of account.
creationTime String
The create time.
directConnectGatewayRouteId String
The id of direct connect gateway route.
id String
The provider-assigned unique ID for this managed resource.
nextHopType String
The type of next hop.
routeType String
The type of route.
status String
The status info.
accountId string
The id of account.
creationTime string
The create time.
directConnectGatewayRouteId string
The id of direct connect gateway route.
id string
The provider-assigned unique ID for this managed resource.
nextHopType string
The type of next hop.
routeType string
The type of route.
status string
The status info.
account_id str
The id of account.
creation_time str
The create time.
direct_connect_gateway_route_id str
The id of direct connect gateway route.
id str
The provider-assigned unique ID for this managed resource.
next_hop_type str
The type of next hop.
route_type str
The type of route.
status str
The status info.
accountId String
The id of account.
creationTime String
The create time.
directConnectGatewayRouteId String
The id of direct connect gateway route.
id String
The provider-assigned unique ID for this managed resource.
nextHopType String
The type of next hop.
routeType String
The type of route.
status String
The status info.

Look up Existing GatewayRoute Resource

Get an existing GatewayRoute resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: GatewayRouteState, opts?: CustomResourceOptions): GatewayRoute
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        creation_time: Optional[str] = None,
        destination_cidr_block: Optional[str] = None,
        direct_connect_gateway_id: Optional[str] = None,
        direct_connect_gateway_route_id: Optional[str] = None,
        next_hop_id: Optional[str] = None,
        next_hop_type: Optional[str] = None,
        route_type: Optional[str] = None,
        status: Optional[str] = None) -> GatewayRoute
func GetGatewayRoute(ctx *Context, name string, id IDInput, state *GatewayRouteState, opts ...ResourceOption) (*GatewayRoute, error)
public static GatewayRoute Get(string name, Input<string> id, GatewayRouteState? state, CustomResourceOptions? opts = null)
public static GatewayRoute get(String name, Output<String> id, GatewayRouteState state, CustomResourceOptions options)
resources:  _:    type: volcengine:direct_connect:GatewayRoute    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId string
The id of account.
CreationTime string
The create time.
DestinationCidrBlock Changes to this property will trigger replacement. string
The cidr block.
DirectConnectGatewayId Changes to this property will trigger replacement. string
The id of direct connect gateway.
DirectConnectGatewayRouteId string
The id of direct connect gateway route.
NextHopId Changes to this property will trigger replacement. string
The id of next hop.
NextHopType string
The type of next hop.
RouteType string
The type of route.
Status string
The status info.
AccountId string
The id of account.
CreationTime string
The create time.
DestinationCidrBlock Changes to this property will trigger replacement. string
The cidr block.
DirectConnectGatewayId Changes to this property will trigger replacement. string
The id of direct connect gateway.
DirectConnectGatewayRouteId string
The id of direct connect gateway route.
NextHopId Changes to this property will trigger replacement. string
The id of next hop.
NextHopType string
The type of next hop.
RouteType string
The type of route.
Status string
The status info.
accountId String
The id of account.
creationTime String
The create time.
destinationCidrBlock Changes to this property will trigger replacement. String
The cidr block.
directConnectGatewayId Changes to this property will trigger replacement. String
The id of direct connect gateway.
directConnectGatewayRouteId String
The id of direct connect gateway route.
nextHopId Changes to this property will trigger replacement. String
The id of next hop.
nextHopType String
The type of next hop.
routeType String
The type of route.
status String
The status info.
accountId string
The id of account.
creationTime string
The create time.
destinationCidrBlock Changes to this property will trigger replacement. string
The cidr block.
directConnectGatewayId Changes to this property will trigger replacement. string
The id of direct connect gateway.
directConnectGatewayRouteId string
The id of direct connect gateway route.
nextHopId Changes to this property will trigger replacement. string
The id of next hop.
nextHopType string
The type of next hop.
routeType string
The type of route.
status string
The status info.
account_id str
The id of account.
creation_time str
The create time.
destination_cidr_block Changes to this property will trigger replacement. str
The cidr block.
direct_connect_gateway_id Changes to this property will trigger replacement. str
The id of direct connect gateway.
direct_connect_gateway_route_id str
The id of direct connect gateway route.
next_hop_id Changes to this property will trigger replacement. str
The id of next hop.
next_hop_type str
The type of next hop.
route_type str
The type of route.
status str
The status info.
accountId String
The id of account.
creationTime String
The create time.
destinationCidrBlock Changes to this property will trigger replacement. String
The cidr block.
directConnectGatewayId Changes to this property will trigger replacement. String
The id of direct connect gateway.
directConnectGatewayRouteId String
The id of direct connect gateway route.
nextHopId Changes to this property will trigger replacement. String
The id of next hop.
nextHopType String
The type of next hop.
routeType String
The type of route.
status String
The status info.

Import

DirectConnectGatewayRoute can be imported using the id, e.g.

$ pulumi import volcengine:direct_connect/gatewayRoute:GatewayRoute default resource_id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.