1. Packages
  2. Volcengine
  3. API Docs
  4. vpc
  5. UserCidrBlockAssociate
Volcengine v0.0.43 published on Friday, Jan 16, 2026 by Volcengine
volcengine logo
Volcengine v0.0.43 published on Friday, Jan 16, 2026 by Volcengine

    Provides a resource to manage vpc user cidr block associate

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const foo = new volcengine.vpc.Vpc("foo", {
        vpcName: "acc-test-vpc",
        cidrBlock: "10.200.0.0/16",
        projectName: "default",
    });
    const foo1 = new volcengine.vpc.UserCidrBlockAssociate("foo1", {
        vpcId: foo.id,
        userCidrBlock: "10.201.0.0/16",
    });
    const foo2 = new volcengine.vpc.UserCidrBlockAssociate("foo2", {
        vpcId: foo.id,
        userCidrBlock: "10.202.0.0/16",
    });
    const foo3 = new volcengine.vpc.UserCidrBlockAssociate("foo3", {
        vpcId: foo.id,
        userCidrBlock: "10.203.0.0/16",
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo = volcengine.vpc.Vpc("foo",
        vpc_name="acc-test-vpc",
        cidr_block="10.200.0.0/16",
        project_name="default")
    foo1 = volcengine.vpc.UserCidrBlockAssociate("foo1",
        vpc_id=foo.id,
        user_cidr_block="10.201.0.0/16")
    foo2 = volcengine.vpc.UserCidrBlockAssociate("foo2",
        vpc_id=foo.id,
        user_cidr_block="10.202.0.0/16")
    foo3 = volcengine.vpc.UserCidrBlockAssociate("foo3",
        vpc_id=foo.id,
        user_cidr_block="10.203.0.0/16")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := vpc.NewVpc(ctx, "foo", &vpc.VpcArgs{
    			VpcName:     pulumi.String("acc-test-vpc"),
    			CidrBlock:   pulumi.String("10.200.0.0/16"),
    			ProjectName: pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewUserCidrBlockAssociate(ctx, "foo1", &vpc.UserCidrBlockAssociateArgs{
    			VpcId:         foo.ID(),
    			UserCidrBlock: pulumi.String("10.201.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewUserCidrBlockAssociate(ctx, "foo2", &vpc.UserCidrBlockAssociateArgs{
    			VpcId:         foo.ID(),
    			UserCidrBlock: pulumi.String("10.202.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewUserCidrBlockAssociate(ctx, "foo3", &vpc.UserCidrBlockAssociateArgs{
    			VpcId:         foo.ID(),
    			UserCidrBlock: pulumi.String("10.203.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Volcengine.Vpc.Vpc("foo", new()
        {
            VpcName = "acc-test-vpc",
            CidrBlock = "10.200.0.0/16",
            ProjectName = "default",
        });
    
        var foo1 = new Volcengine.Vpc.UserCidrBlockAssociate("foo1", new()
        {
            VpcId = foo.Id,
            UserCidrBlock = "10.201.0.0/16",
        });
    
        var foo2 = new Volcengine.Vpc.UserCidrBlockAssociate("foo2", new()
        {
            VpcId = foo.Id,
            UserCidrBlock = "10.202.0.0/16",
        });
    
        var foo3 = new Volcengine.Vpc.UserCidrBlockAssociate("foo3", new()
        {
            VpcId = foo.Id,
            UserCidrBlock = "10.203.0.0/16",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.vpc.Vpc;
    import com.pulumi.volcengine.vpc.VpcArgs;
    import com.pulumi.volcengine.vpc.UserCidrBlockAssociate;
    import com.pulumi.volcengine.vpc.UserCidrBlockAssociateArgs;
    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 Vpc("foo", VpcArgs.builder()        
                .vpcName("acc-test-vpc")
                .cidrBlock("10.200.0.0/16")
                .projectName("default")
                .build());
    
            var foo1 = new UserCidrBlockAssociate("foo1", UserCidrBlockAssociateArgs.builder()        
                .vpcId(foo.id())
                .userCidrBlock("10.201.0.0/16")
                .build());
    
            var foo2 = new UserCidrBlockAssociate("foo2", UserCidrBlockAssociateArgs.builder()        
                .vpcId(foo.id())
                .userCidrBlock("10.202.0.0/16")
                .build());
    
            var foo3 = new UserCidrBlockAssociate("foo3", UserCidrBlockAssociateArgs.builder()        
                .vpcId(foo.id())
                .userCidrBlock("10.203.0.0/16")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: volcengine:vpc:Vpc
        properties:
          vpcName: acc-test-vpc
          cidrBlock: 10.200.0.0/16
          projectName: default
      foo1:
        type: volcengine:vpc:UserCidrBlockAssociate
        properties:
          vpcId: ${foo.id}
          userCidrBlock: 10.201.0.0/16
      foo2:
        type: volcengine:vpc:UserCidrBlockAssociate
        properties:
          vpcId: ${foo.id}
          userCidrBlock: 10.202.0.0/16
      foo3:
        type: volcengine:vpc:UserCidrBlockAssociate
        properties:
          vpcId: ${foo.id}
          userCidrBlock: 10.203.0.0/16
    

    Create UserCidrBlockAssociate Resource

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

    Constructor syntax

    new UserCidrBlockAssociate(name: string, args: UserCidrBlockAssociateArgs, opts?: CustomResourceOptions);
    @overload
    def UserCidrBlockAssociate(resource_name: str,
                               args: UserCidrBlockAssociateArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserCidrBlockAssociate(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               user_cidr_block: Optional[str] = None,
                               vpc_id: Optional[str] = None)
    func NewUserCidrBlockAssociate(ctx *Context, name string, args UserCidrBlockAssociateArgs, opts ...ResourceOption) (*UserCidrBlockAssociate, error)
    public UserCidrBlockAssociate(string name, UserCidrBlockAssociateArgs args, CustomResourceOptions? opts = null)
    public UserCidrBlockAssociate(String name, UserCidrBlockAssociateArgs args)
    public UserCidrBlockAssociate(String name, UserCidrBlockAssociateArgs args, CustomResourceOptions options)
    
    type: volcengine:vpc:UserCidrBlockAssociate
    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 UserCidrBlockAssociateArgs
    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 UserCidrBlockAssociateArgs
    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 UserCidrBlockAssociateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserCidrBlockAssociateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserCidrBlockAssociateArgs
    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 userCidrBlockAssociateResource = new Volcengine.Vpc.UserCidrBlockAssociate("userCidrBlockAssociateResource", new()
    {
        UserCidrBlock = "string",
        VpcId = "string",
    });
    
    example, err := vpc.NewUserCidrBlockAssociate(ctx, "userCidrBlockAssociateResource", &vpc.UserCidrBlockAssociateArgs{
    	UserCidrBlock: pulumi.String("string"),
    	VpcId:         pulumi.String("string"),
    })
    
    var userCidrBlockAssociateResource = new UserCidrBlockAssociate("userCidrBlockAssociateResource", UserCidrBlockAssociateArgs.builder()
        .userCidrBlock("string")
        .vpcId("string")
        .build());
    
    user_cidr_block_associate_resource = volcengine.vpc.UserCidrBlockAssociate("userCidrBlockAssociateResource",
        user_cidr_block="string",
        vpc_id="string")
    
    const userCidrBlockAssociateResource = new volcengine.vpc.UserCidrBlockAssociate("userCidrBlockAssociateResource", {
        userCidrBlock: "string",
        vpcId: "string",
    });
    
    type: volcengine:vpc:UserCidrBlockAssociate
    properties:
        userCidrBlock: string
        vpcId: string
    

    UserCidrBlockAssociate 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 UserCidrBlockAssociate resource accepts the following input properties:

    UserCidrBlock string
    The user cidr block of the VPC.
    VpcId string
    The id of the VPC.
    UserCidrBlock string
    The user cidr block of the VPC.
    VpcId string
    The id of the VPC.
    userCidrBlock String
    The user cidr block of the VPC.
    vpcId String
    The id of the VPC.
    userCidrBlock string
    The user cidr block of the VPC.
    vpcId string
    The id of the VPC.
    user_cidr_block str
    The user cidr block of the VPC.
    vpc_id str
    The id of the VPC.
    userCidrBlock String
    The user cidr block of the VPC.
    vpcId String
    The id of the VPC.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing UserCidrBlockAssociate Resource

    Get an existing UserCidrBlockAssociate 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?: UserCidrBlockAssociateState, opts?: CustomResourceOptions): UserCidrBlockAssociate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            user_cidr_block: Optional[str] = None,
            vpc_id: Optional[str] = None) -> UserCidrBlockAssociate
    func GetUserCidrBlockAssociate(ctx *Context, name string, id IDInput, state *UserCidrBlockAssociateState, opts ...ResourceOption) (*UserCidrBlockAssociate, error)
    public static UserCidrBlockAssociate Get(string name, Input<string> id, UserCidrBlockAssociateState? state, CustomResourceOptions? opts = null)
    public static UserCidrBlockAssociate get(String name, Output<String> id, UserCidrBlockAssociateState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:vpc:UserCidrBlockAssociate    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.
    The following state arguments are supported:
    UserCidrBlock string
    The user cidr block of the VPC.
    VpcId string
    The id of the VPC.
    UserCidrBlock string
    The user cidr block of the VPC.
    VpcId string
    The id of the VPC.
    userCidrBlock String
    The user cidr block of the VPC.
    vpcId String
    The id of the VPC.
    userCidrBlock string
    The user cidr block of the VPC.
    vpcId string
    The id of the VPC.
    user_cidr_block str
    The user cidr block of the VPC.
    vpc_id str
    The id of the VPC.
    userCidrBlock String
    The user cidr block of the VPC.
    vpcId String
    The id of the VPC.

    Import

    The VpcCidrBlockAssociate is not support import.

    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.
    volcengine logo
    Volcengine v0.0.43 published on Friday, Jan 16, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate