1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getDcGatewayCcnRoutes
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.getDcGatewayCcnRoutes

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Use this data source to query detailed information of direct connect gateway route entries.

    Example Usage

    Complete example

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const main = new tencentcloud.Ccn("main", {
        description: "ci-temp-test-ccn-des",
        qos: "AG",
    });
    const ccnMain = new tencentcloud.DcGateway("ccnMain", {
        networkInstanceId: main.ccnId,
        networkType: "CCN",
        gatewayType: "NORMAL",
    });
    const route1 = new tencentcloud.DcGatewayCcnRoute("route1", {
        dcgId: ccnMain.dcGatewayId,
        cidrBlock: "10.1.1.0/32",
    });
    const route2 = new tencentcloud.DcGatewayCcnRoute("route2", {
        dcgId: ccnMain.dcGatewayId,
        cidrBlock: "192.1.1.0/32",
    });
    const test = tencentcloud.getDcGatewayCcnRoutesOutput({
        dcgId: ccnMain.dcGatewayId,
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    main = tencentcloud.Ccn("main",
        description="ci-temp-test-ccn-des",
        qos="AG")
    ccn_main = tencentcloud.DcGateway("ccnMain",
        network_instance_id=main.ccn_id,
        network_type="CCN",
        gateway_type="NORMAL")
    route1 = tencentcloud.DcGatewayCcnRoute("route1",
        dcg_id=ccn_main.dc_gateway_id,
        cidr_block="10.1.1.0/32")
    route2 = tencentcloud.DcGatewayCcnRoute("route2",
        dcg_id=ccn_main.dc_gateway_id,
        cidr_block="192.1.1.0/32")
    test = tencentcloud.get_dc_gateway_ccn_routes_output(dcg_id=ccn_main.dc_gateway_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		main, err := tencentcloud.NewCcn(ctx, "main", &tencentcloud.CcnArgs{
    			Description: pulumi.String("ci-temp-test-ccn-des"),
    			Qos:         pulumi.String("AG"),
    		})
    		if err != nil {
    			return err
    		}
    		ccnMain, err := tencentcloud.NewDcGateway(ctx, "ccnMain", &tencentcloud.DcGatewayArgs{
    			NetworkInstanceId: main.CcnId,
    			NetworkType:       pulumi.String("CCN"),
    			GatewayType:       pulumi.String("NORMAL"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewDcGatewayCcnRoute(ctx, "route1", &tencentcloud.DcGatewayCcnRouteArgs{
    			DcgId:     ccnMain.DcGatewayId,
    			CidrBlock: pulumi.String("10.1.1.0/32"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = tencentcloud.NewDcGatewayCcnRoute(ctx, "route2", &tencentcloud.DcGatewayCcnRouteArgs{
    			DcgId:     ccnMain.DcGatewayId,
    			CidrBlock: pulumi.String("192.1.1.0/32"),
    		})
    		if err != nil {
    			return err
    		}
    		_ = tencentcloud.GetDcGatewayCcnRoutesOutput(ctx, tencentcloud.GetDcGatewayCcnRoutesOutputArgs{
    			DcgId: ccnMain.DcGatewayId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Tencentcloud.Ccn("main", new()
        {
            Description = "ci-temp-test-ccn-des",
            Qos = "AG",
        });
    
        var ccnMain = new Tencentcloud.DcGateway("ccnMain", new()
        {
            NetworkInstanceId = main.CcnId,
            NetworkType = "CCN",
            GatewayType = "NORMAL",
        });
    
        var route1 = new Tencentcloud.DcGatewayCcnRoute("route1", new()
        {
            DcgId = ccnMain.DcGatewayId,
            CidrBlock = "10.1.1.0/32",
        });
    
        var route2 = new Tencentcloud.DcGatewayCcnRoute("route2", new()
        {
            DcgId = ccnMain.DcGatewayId,
            CidrBlock = "192.1.1.0/32",
        });
    
        var test = Tencentcloud.GetDcGatewayCcnRoutes.Invoke(new()
        {
            DcgId = ccnMain.DcGatewayId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.Ccn;
    import com.pulumi.tencentcloud.CcnArgs;
    import com.pulumi.tencentcloud.DcGateway;
    import com.pulumi.tencentcloud.DcGatewayArgs;
    import com.pulumi.tencentcloud.DcGatewayCcnRoute;
    import com.pulumi.tencentcloud.DcGatewayCcnRouteArgs;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetDcGatewayCcnRoutesArgs;
    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 main = new Ccn("main", CcnArgs.builder()
                .description("ci-temp-test-ccn-des")
                .qos("AG")
                .build());
    
            var ccnMain = new DcGateway("ccnMain", DcGatewayArgs.builder()
                .networkInstanceId(main.ccnId())
                .networkType("CCN")
                .gatewayType("NORMAL")
                .build());
    
            var route1 = new DcGatewayCcnRoute("route1", DcGatewayCcnRouteArgs.builder()
                .dcgId(ccnMain.dcGatewayId())
                .cidrBlock("10.1.1.0/32")
                .build());
    
            var route2 = new DcGatewayCcnRoute("route2", DcGatewayCcnRouteArgs.builder()
                .dcgId(ccnMain.dcGatewayId())
                .cidrBlock("192.1.1.0/32")
                .build());
    
            final var test = TencentcloudFunctions.getDcGatewayCcnRoutes(GetDcGatewayCcnRoutesArgs.builder()
                .dcgId(ccnMain.dcGatewayId())
                .build());
    
        }
    }
    
    resources:
      main:
        type: tencentcloud:Ccn
        properties:
          description: ci-temp-test-ccn-des
          qos: AG
      ccnMain:
        type: tencentcloud:DcGateway
        properties:
          networkInstanceId: ${main.ccnId}
          networkType: CCN
          gatewayType: NORMAL
      route1:
        type: tencentcloud:DcGatewayCcnRoute
        properties:
          dcgId: ${ccnMain.dcGatewayId}
          cidrBlock: 10.1.1.0/32
      route2:
        type: tencentcloud:DcGatewayCcnRoute
        properties:
          dcgId: ${ccnMain.dcGatewayId}
          cidrBlock: 192.1.1.0/32
    variables:
      test:
        fn::invoke:
          function: tencentcloud:getDcGatewayCcnRoutes
          arguments:
            dcgId: ${ccnMain.dcGatewayId}
    

    Query routes by filters

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const test = tencentcloud.getDcGatewayCcnRoutes({
        dcgId: tencentcloud_dc_gateway.ccn_main.id,
        ccnRouteType: "STATIC",
        addressType: "IPv4",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    test = tencentcloud.get_dc_gateway_ccn_routes(dcg_id=tencentcloud_dc_gateway["ccn_main"]["id"],
        ccn_route_type="STATIC",
        address_type="IPv4")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.GetDcGatewayCcnRoutes(ctx, &tencentcloud.GetDcGatewayCcnRoutesArgs{
    			DcgId:        tencentcloud_dc_gateway.Ccn_main.Id,
    			CcnRouteType: pulumi.StringRef("STATIC"),
    			AddressType:  pulumi.StringRef("IPv4"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Tencentcloud.GetDcGatewayCcnRoutes.Invoke(new()
        {
            DcgId = tencentcloud_dc_gateway.Ccn_main.Id,
            CcnRouteType = "STATIC",
            AddressType = "IPv4",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetDcGatewayCcnRoutesArgs;
    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) {
            final var test = TencentcloudFunctions.getDcGatewayCcnRoutes(GetDcGatewayCcnRoutesArgs.builder()
                .dcgId(tencentcloud_dc_gateway.ccn_main().id())
                .ccnRouteType("STATIC")
                .addressType("IPv4")
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: tencentcloud:getDcGatewayCcnRoutes
          arguments:
            dcgId: ${tencentcloud_dc_gateway.ccn_main.id}
            ccnRouteType: STATIC
            addressType: IPv4
    

    Using getDcGatewayCcnRoutes

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDcGatewayCcnRoutes(args: GetDcGatewayCcnRoutesArgs, opts?: InvokeOptions): Promise<GetDcGatewayCcnRoutesResult>
    function getDcGatewayCcnRoutesOutput(args: GetDcGatewayCcnRoutesOutputArgs, opts?: InvokeOptions): Output<GetDcGatewayCcnRoutesResult>
    def get_dc_gateway_ccn_routes(address_type: Optional[str] = None,
                                  ccn_route_type: Optional[str] = None,
                                  dcg_id: Optional[str] = None,
                                  id: Optional[str] = None,
                                  result_output_file: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetDcGatewayCcnRoutesResult
    def get_dc_gateway_ccn_routes_output(address_type: Optional[pulumi.Input[str]] = None,
                                  ccn_route_type: Optional[pulumi.Input[str]] = None,
                                  dcg_id: Optional[pulumi.Input[str]] = None,
                                  id: Optional[pulumi.Input[str]] = None,
                                  result_output_file: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetDcGatewayCcnRoutesResult]
    func GetDcGatewayCcnRoutes(ctx *Context, args *GetDcGatewayCcnRoutesArgs, opts ...InvokeOption) (*GetDcGatewayCcnRoutesResult, error)
    func GetDcGatewayCcnRoutesOutput(ctx *Context, args *GetDcGatewayCcnRoutesOutputArgs, opts ...InvokeOption) GetDcGatewayCcnRoutesResultOutput

    > Note: This function is named GetDcGatewayCcnRoutes in the Go SDK.

    public static class GetDcGatewayCcnRoutes 
    {
        public static Task<GetDcGatewayCcnRoutesResult> InvokeAsync(GetDcGatewayCcnRoutesArgs args, InvokeOptions? opts = null)
        public static Output<GetDcGatewayCcnRoutesResult> Invoke(GetDcGatewayCcnRoutesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDcGatewayCcnRoutesResult> getDcGatewayCcnRoutes(GetDcGatewayCcnRoutesArgs args, InvokeOptions options)
    public static Output<GetDcGatewayCcnRoutesResult> getDcGatewayCcnRoutes(GetDcGatewayCcnRoutesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tencentcloud:index/getDcGatewayCcnRoutes:getDcGatewayCcnRoutes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DcgId string
    ID of the DCG to be queried.
    AddressType string
    Address type, supports: IPv4, IPv6. Default is IPv4.
    CcnRouteType string
    Cloud networking routing learning type, optional values: BGP - Automatic Learning; STATIC - User configured. Default is STATIC.
    Id string
    ResultOutputFile string
    Used to save results.
    DcgId string
    ID of the DCG to be queried.
    AddressType string
    Address type, supports: IPv4, IPv6. Default is IPv4.
    CcnRouteType string
    Cloud networking routing learning type, optional values: BGP - Automatic Learning; STATIC - User configured. Default is STATIC.
    Id string
    ResultOutputFile string
    Used to save results.
    dcgId String
    ID of the DCG to be queried.
    addressType String
    Address type, supports: IPv4, IPv6. Default is IPv4.
    ccnRouteType String
    Cloud networking routing learning type, optional values: BGP - Automatic Learning; STATIC - User configured. Default is STATIC.
    id String
    resultOutputFile String
    Used to save results.
    dcgId string
    ID of the DCG to be queried.
    addressType string
    Address type, supports: IPv4, IPv6. Default is IPv4.
    ccnRouteType string
    Cloud networking routing learning type, optional values: BGP - Automatic Learning; STATIC - User configured. Default is STATIC.
    id string
    resultOutputFile string
    Used to save results.
    dcg_id str
    ID of the DCG to be queried.
    address_type str
    Address type, supports: IPv4, IPv6. Default is IPv4.
    ccn_route_type str
    Cloud networking routing learning type, optional values: BGP - Automatic Learning; STATIC - User configured. Default is STATIC.
    id str
    result_output_file str
    Used to save results.
    dcgId String
    ID of the DCG to be queried.
    addressType String
    Address type, supports: IPv4, IPv6. Default is IPv4.
    ccnRouteType String
    Cloud networking routing learning type, optional values: BGP - Automatic Learning; STATIC - User configured. Default is STATIC.
    id String
    resultOutputFile String
    Used to save results.

    getDcGatewayCcnRoutes Result

    The following output properties are available:

    DcgId string
    ID of the DCG.
    Id string
    InstanceLists List<GetDcGatewayCcnRoutesInstanceList>
    Information list of the DCG route entries.
    AddressType string
    CcnRouteType string
    ResultOutputFile string
    DcgId string
    ID of the DCG.
    Id string
    InstanceLists []GetDcGatewayCcnRoutesInstanceList
    Information list of the DCG route entries.
    AddressType string
    CcnRouteType string
    ResultOutputFile string
    dcgId String
    ID of the DCG.
    id String
    instanceLists List<GetDcGatewayCcnRoutesInstanceList>
    Information list of the DCG route entries.
    addressType String
    ccnRouteType String
    resultOutputFile String
    dcgId string
    ID of the DCG.
    id string
    instanceLists GetDcGatewayCcnRoutesInstanceList[]
    Information list of the DCG route entries.
    addressType string
    ccnRouteType string
    resultOutputFile string
    dcg_id str
    ID of the DCG.
    id str
    instance_lists Sequence[GetDcGatewayCcnRoutesInstanceList]
    Information list of the DCG route entries.
    address_type str
    ccn_route_type str
    result_output_file str
    dcgId String
    ID of the DCG.
    id String
    instanceLists List<Property Map>
    Information list of the DCG route entries.
    addressType String
    ccnRouteType String
    resultOutputFile String

    Supporting Types

    GetDcGatewayCcnRoutesInstanceList

    AsPaths List<string>
    As path list of the BGP.
    CidrBlock string
    A network address segment of IDC.
    DcgId string
    ID of the DCG to be queried.
    RouteId string
    ID of the DCG route.
    AsPaths []string
    As path list of the BGP.
    CidrBlock string
    A network address segment of IDC.
    DcgId string
    ID of the DCG to be queried.
    RouteId string
    ID of the DCG route.
    asPaths List<String>
    As path list of the BGP.
    cidrBlock String
    A network address segment of IDC.
    dcgId String
    ID of the DCG to be queried.
    routeId String
    ID of the DCG route.
    asPaths string[]
    As path list of the BGP.
    cidrBlock string
    A network address segment of IDC.
    dcgId string
    ID of the DCG to be queried.
    routeId string
    ID of the DCG route.
    as_paths Sequence[str]
    As path list of the BGP.
    cidr_block str
    A network address segment of IDC.
    dcg_id str
    ID of the DCG to be queried.
    route_id str
    ID of the DCG route.
    asPaths List<String>
    As path list of the BGP.
    cidrBlock String
    A network address segment of IDC.
    dcgId String
    ID of the DCG to be queried.
    routeId String
    ID of the DCG route.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack