published on Thursday, Mar 26, 2026 by opentelekomcloud
published on Thursday, Mar 26, 2026 by opentelekomcloud
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opentelekomcloud from "@pulumi/opentelekomcloud";
const vpc = new opentelekomcloud.VpcV1("vpc", {
name: "my-vpc",
cidr: "192.168.0.0/16",
});
const subnet = new opentelekomcloud.VpcSubnetV1("subnet", {
name: "my-subnet",
cidr: "192.168.0.0/24",
gatewayIp: "192.168.0.1",
vpcId: vpc.vpcV1Id,
});
const table = new opentelekomcloud.VpcRouteTableV1("table", {
name: "my-table",
vpcId: vpc.vpcV1Id,
});
const assoc = new opentelekomcloud.VpcRouteTableSubnetAssociateV1("assoc", {
routeTableId: table.vpcRouteTableV1Id,
subnetId: subnet.vpcSubnetV1Id,
});
import pulumi
import pulumi_opentelekomcloud as opentelekomcloud
vpc = opentelekomcloud.VpcV1("vpc",
name="my-vpc",
cidr="192.168.0.0/16")
subnet = opentelekomcloud.VpcSubnetV1("subnet",
name="my-subnet",
cidr="192.168.0.0/24",
gateway_ip="192.168.0.1",
vpc_id=vpc.vpc_v1_id)
table = opentelekomcloud.VpcRouteTableV1("table",
name="my-table",
vpc_id=vpc.vpc_v1_id)
assoc = opentelekomcloud.VpcRouteTableSubnetAssociateV1("assoc",
route_table_id=table.vpc_route_table_v1_id,
subnet_id=subnet.vpc_subnet_v1_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opentelekomcloud/opentelekomcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
vpc, err := opentelekomcloud.NewVpcV1(ctx, "vpc", &opentelekomcloud.VpcV1Args{
Name: pulumi.String("my-vpc"),
Cidr: pulumi.String("192.168.0.0/16"),
})
if err != nil {
return err
}
subnet, err := opentelekomcloud.NewVpcSubnetV1(ctx, "subnet", &opentelekomcloud.VpcSubnetV1Args{
Name: pulumi.String("my-subnet"),
Cidr: pulumi.String("192.168.0.0/24"),
GatewayIp: pulumi.String("192.168.0.1"),
VpcId: vpc.VpcV1Id,
})
if err != nil {
return err
}
table, err := opentelekomcloud.NewVpcRouteTableV1(ctx, "table", &opentelekomcloud.VpcRouteTableV1Args{
Name: pulumi.String("my-table"),
VpcId: vpc.VpcV1Id,
})
if err != nil {
return err
}
_, err = opentelekomcloud.NewVpcRouteTableSubnetAssociateV1(ctx, "assoc", &opentelekomcloud.VpcRouteTableSubnetAssociateV1Args{
RouteTableId: table.VpcRouteTableV1Id,
SubnetId: subnet.VpcSubnetV1Id,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opentelekomcloud = Pulumi.Opentelekomcloud;
return await Deployment.RunAsync(() =>
{
var vpc = new Opentelekomcloud.VpcV1("vpc", new()
{
Name = "my-vpc",
Cidr = "192.168.0.0/16",
});
var subnet = new Opentelekomcloud.VpcSubnetV1("subnet", new()
{
Name = "my-subnet",
Cidr = "192.168.0.0/24",
GatewayIp = "192.168.0.1",
VpcId = vpc.VpcV1Id,
});
var table = new Opentelekomcloud.VpcRouteTableV1("table", new()
{
Name = "my-table",
VpcId = vpc.VpcV1Id,
});
var assoc = new Opentelekomcloud.VpcRouteTableSubnetAssociateV1("assoc", new()
{
RouteTableId = table.VpcRouteTableV1Id,
SubnetId = subnet.VpcSubnetV1Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opentelekomcloud.VpcV1;
import com.pulumi.opentelekomcloud.VpcV1Args;
import com.pulumi.opentelekomcloud.VpcSubnetV1;
import com.pulumi.opentelekomcloud.VpcSubnetV1Args;
import com.pulumi.opentelekomcloud.VpcRouteTableV1;
import com.pulumi.opentelekomcloud.VpcRouteTableV1Args;
import com.pulumi.opentelekomcloud.VpcRouteTableSubnetAssociateV1;
import com.pulumi.opentelekomcloud.VpcRouteTableSubnetAssociateV1Args;
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 vpc = new VpcV1("vpc", VpcV1Args.builder()
.name("my-vpc")
.cidr("192.168.0.0/16")
.build());
var subnet = new VpcSubnetV1("subnet", VpcSubnetV1Args.builder()
.name("my-subnet")
.cidr("192.168.0.0/24")
.gatewayIp("192.168.0.1")
.vpcId(vpc.vpcV1Id())
.build());
var table = new VpcRouteTableV1("table", VpcRouteTableV1Args.builder()
.name("my-table")
.vpcId(vpc.vpcV1Id())
.build());
var assoc = new VpcRouteTableSubnetAssociateV1("assoc", VpcRouteTableSubnetAssociateV1Args.builder()
.routeTableId(table.vpcRouteTableV1Id())
.subnetId(subnet.vpcSubnetV1Id())
.build());
}
}
resources:
vpc:
type: opentelekomcloud:VpcV1
properties:
name: my-vpc
cidr: 192.168.0.0/16
subnet:
type: opentelekomcloud:VpcSubnetV1
properties:
name: my-subnet
cidr: 192.168.0.0/24
gatewayIp: 192.168.0.1
vpcId: ${vpc.vpcV1Id}
table:
type: opentelekomcloud:VpcRouteTableV1
properties:
name: my-table
vpcId: ${vpc.vpcV1Id}
assoc:
type: opentelekomcloud:VpcRouteTableSubnetAssociateV1
properties:
routeTableId: ${table.vpcRouteTableV1Id}
subnetId: ${subnet.vpcSubnetV1Id}
Create VpcRouteTableSubnetAssociateV1 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcRouteTableSubnetAssociateV1(name: string, args: VpcRouteTableSubnetAssociateV1Args, opts?: CustomResourceOptions);@overload
def VpcRouteTableSubnetAssociateV1(resource_name: str,
args: VpcRouteTableSubnetAssociateV1Args,
opts: Optional[ResourceOptions] = None)
@overload
def VpcRouteTableSubnetAssociateV1(resource_name: str,
opts: Optional[ResourceOptions] = None,
route_table_id: Optional[str] = None,
subnet_id: Optional[str] = None,
region: Optional[str] = None,
vpc_route_table_subnet_associate_v1_id: Optional[str] = None)func NewVpcRouteTableSubnetAssociateV1(ctx *Context, name string, args VpcRouteTableSubnetAssociateV1Args, opts ...ResourceOption) (*VpcRouteTableSubnetAssociateV1, error)public VpcRouteTableSubnetAssociateV1(string name, VpcRouteTableSubnetAssociateV1Args args, CustomResourceOptions? opts = null)
public VpcRouteTableSubnetAssociateV1(String name, VpcRouteTableSubnetAssociateV1Args args)
public VpcRouteTableSubnetAssociateV1(String name, VpcRouteTableSubnetAssociateV1Args args, CustomResourceOptions options)
type: opentelekomcloud:VpcRouteTableSubnetAssociateV1
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VpcRouteTableSubnetAssociateV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VpcRouteTableSubnetAssociateV1Args
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcRouteTableSubnetAssociateV1Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcRouteTableSubnetAssociateV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcRouteTableSubnetAssociateV1Args
- 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 vpcRouteTableSubnetAssociateV1Resource = new Opentelekomcloud.Index.VpcRouteTableSubnetAssociateV1("vpcRouteTableSubnetAssociateV1Resource", new()
{
RouteTableId = "string",
SubnetId = "string",
Region = "string",
VpcRouteTableSubnetAssociateV1Id = "string",
});
example, err := opentelekomcloud.NewVpcRouteTableSubnetAssociateV1(ctx, "vpcRouteTableSubnetAssociateV1Resource", &opentelekomcloud.VpcRouteTableSubnetAssociateV1Args{
RouteTableId: pulumi.String("string"),
SubnetId: pulumi.String("string"),
Region: pulumi.String("string"),
VpcRouteTableSubnetAssociateV1Id: pulumi.String("string"),
})
var vpcRouteTableSubnetAssociateV1Resource = new VpcRouteTableSubnetAssociateV1("vpcRouteTableSubnetAssociateV1Resource", VpcRouteTableSubnetAssociateV1Args.builder()
.routeTableId("string")
.subnetId("string")
.region("string")
.vpcRouteTableSubnetAssociateV1Id("string")
.build());
vpc_route_table_subnet_associate_v1_resource = opentelekomcloud.VpcRouteTableSubnetAssociateV1("vpcRouteTableSubnetAssociateV1Resource",
route_table_id="string",
subnet_id="string",
region="string",
vpc_route_table_subnet_associate_v1_id="string")
const vpcRouteTableSubnetAssociateV1Resource = new opentelekomcloud.VpcRouteTableSubnetAssociateV1("vpcRouteTableSubnetAssociateV1Resource", {
routeTableId: "string",
subnetId: "string",
region: "string",
vpcRouteTableSubnetAssociateV1Id: "string",
});
type: opentelekomcloud:VpcRouteTableSubnetAssociateV1
properties:
region: string
routeTableId: string
subnetId: string
vpcRouteTableSubnetAssociateV1Id: string
VpcRouteTableSubnetAssociateV1 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 VpcRouteTableSubnetAssociateV1 resource accepts the following input properties:
- Route
Table stringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- Subnet
Id string - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- Region string
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- Vpc
Route stringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- Route
Table stringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- Subnet
Id string - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- Region string
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- Vpc
Route stringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- route
Table StringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet
Id String - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- region String
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- vpc
Route StringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- route
Table stringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet
Id string - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- region string
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- vpc
Route stringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- route_
table_ strid - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet_
id str - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- region str
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- vpc_
route_ strtable_ subnet_ associate_ v1_ id - The resource ID in format
{route_table_id}/{subnet_id}.
- route
Table StringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet
Id String - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- region String
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- vpc
Route StringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcRouteTableSubnetAssociateV1 resource produces the following output properties:
Look up Existing VpcRouteTableSubnetAssociateV1 Resource
Get an existing VpcRouteTableSubnetAssociateV1 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?: VpcRouteTableSubnetAssociateV1State, opts?: CustomResourceOptions): VpcRouteTableSubnetAssociateV1@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
region: Optional[str] = None,
route_table_id: Optional[str] = None,
subnet_id: Optional[str] = None,
vpc_id: Optional[str] = None,
vpc_route_table_subnet_associate_v1_id: Optional[str] = None) -> VpcRouteTableSubnetAssociateV1func GetVpcRouteTableSubnetAssociateV1(ctx *Context, name string, id IDInput, state *VpcRouteTableSubnetAssociateV1State, opts ...ResourceOption) (*VpcRouteTableSubnetAssociateV1, error)public static VpcRouteTableSubnetAssociateV1 Get(string name, Input<string> id, VpcRouteTableSubnetAssociateV1State? state, CustomResourceOptions? opts = null)public static VpcRouteTableSubnetAssociateV1 get(String name, Output<String> id, VpcRouteTableSubnetAssociateV1State state, CustomResourceOptions options)resources: _: type: opentelekomcloud:VpcRouteTableSubnetAssociateV1 get: id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Region string
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- Route
Table stringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- Subnet
Id string - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- Vpc
Id string - The VPC ID that the route table belongs to.
- Vpc
Route stringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- Region string
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- Route
Table stringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- Subnet
Id string - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- Vpc
Id string - The VPC ID that the route table belongs to.
- Vpc
Route stringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- region String
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- route
Table StringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet
Id String - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- vpc
Id String - The VPC ID that the route table belongs to.
- vpc
Route StringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- region string
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- route
Table stringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet
Id string - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- vpc
Id string - The VPC ID that the route table belongs to.
- vpc
Route stringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
- region str
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- route_
table_ strid - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet_
id str - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- vpc_
id str - The VPC ID that the route table belongs to.
- vpc_
route_ strtable_ subnet_ associate_ v1_ id - The resource ID in format
{route_table_id}/{subnet_id}.
- region String
- The region in which to create the association. If omitted, the provider-level region will be used. Changing this creates a new resource.
- route
Table StringId - Specifies the route table ID to associate the subnet with. Changing this creates a new resource.
- subnet
Id String - Specifies the subnet ID to associate with the route table. Changing this creates a new resource.
- vpc
Id String - The VPC ID that the route table belongs to.
- vpc
Route StringTable Subnet Associate V1Id - The resource ID in format
{route_table_id}/{subnet_id}.
Import
Route table subnet associations can be imported using the route table ID and subnet ID, separated by a slash, e.g.
$ pulumi import opentelekomcloud:index/vpcRouteTableSubnetAssociateV1:VpcRouteTableSubnetAssociateV1 assoc 14c6491a-f90a-41aa-a206-f58bbacdb47d/a1b2c3d4-e5f6-7890-abcd-ef1234567890
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- opentelekomcloud opentelekomcloud/terraform-provider-opentelekomcloud
- License
- Notes
- This Pulumi package is based on the
opentelekomcloudTerraform Provider.
published on Thursday, Mar 26, 2026 by opentelekomcloud
