volcengine.vpc.CidrBlockAssociate
Explore with Pulumi AI
Provides a resource to manage vpc cidr block associate
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
vpcName: "acc-test-vpc",
cidrBlock: "192.168.0.0/20",
projectName: "default",
});
const fooCidrBlockAssociate = new volcengine.vpc.CidrBlockAssociate("fooCidrBlockAssociate", {
vpcId: fooVpc.id,
secondaryCidrBlock: "192.168.16.0/20",
});
import pulumi
import pulumi_volcengine as volcengine
foo_vpc = volcengine.vpc.Vpc("fooVpc",
vpc_name="acc-test-vpc",
cidr_block="192.168.0.0/20",
project_name="default")
foo_cidr_block_associate = volcengine.vpc.CidrBlockAssociate("fooCidrBlockAssociate",
vpc_id=foo_vpc.id,
secondary_cidr_block="192.168.16.0/20")
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 {
fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
VpcName: pulumi.String("acc-test-vpc"),
CidrBlock: pulumi.String("192.168.0.0/20"),
ProjectName: pulumi.String("default"),
})
if err != nil {
return err
}
_, err = vpc.NewCidrBlockAssociate(ctx, "fooCidrBlockAssociate", &vpc.CidrBlockAssociateArgs{
VpcId: fooVpc.ID(),
SecondaryCidrBlock: pulumi.String("192.168.16.0/20"),
})
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 fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
{
VpcName = "acc-test-vpc",
CidrBlock = "192.168.0.0/20",
ProjectName = "default",
});
var fooCidrBlockAssociate = new Volcengine.Vpc.CidrBlockAssociate("fooCidrBlockAssociate", new()
{
VpcId = fooVpc.Id,
SecondaryCidrBlock = "192.168.16.0/20",
});
});
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.CidrBlockAssociate;
import com.pulumi.volcengine.vpc.CidrBlockAssociateArgs;
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 fooVpc = new Vpc("fooVpc", VpcArgs.builder()
.vpcName("acc-test-vpc")
.cidrBlock("192.168.0.0/20")
.projectName("default")
.build());
var fooCidrBlockAssociate = new CidrBlockAssociate("fooCidrBlockAssociate", CidrBlockAssociateArgs.builder()
.vpcId(fooVpc.id())
.secondaryCidrBlock("192.168.16.0/20")
.build());
}
}
resources:
fooVpc:
type: volcengine:vpc:Vpc
properties:
vpcName: acc-test-vpc
cidrBlock: 192.168.0.0/20
projectName: default
fooCidrBlockAssociate:
type: volcengine:vpc:CidrBlockAssociate
properties:
vpcId: ${fooVpc.id}
secondaryCidrBlock: 192.168.16.0/20
Create CidrBlockAssociate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CidrBlockAssociate(name: string, args: CidrBlockAssociateArgs, opts?: CustomResourceOptions);
@overload
def CidrBlockAssociate(resource_name: str,
args: CidrBlockAssociateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CidrBlockAssociate(resource_name: str,
opts: Optional[ResourceOptions] = None,
secondary_cidr_block: Optional[str] = None,
vpc_id: Optional[str] = None)
func NewCidrBlockAssociate(ctx *Context, name string, args CidrBlockAssociateArgs, opts ...ResourceOption) (*CidrBlockAssociate, error)
public CidrBlockAssociate(string name, CidrBlockAssociateArgs args, CustomResourceOptions? opts = null)
public CidrBlockAssociate(String name, CidrBlockAssociateArgs args)
public CidrBlockAssociate(String name, CidrBlockAssociateArgs args, CustomResourceOptions options)
type: volcengine:vpc:CidrBlockAssociate
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 CidrBlockAssociateArgs
- 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 CidrBlockAssociateArgs
- 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 CidrBlockAssociateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CidrBlockAssociateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CidrBlockAssociateArgs
- 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 cidrBlockAssociateResource = new Volcengine.Vpc.CidrBlockAssociate("cidrBlockAssociateResource", new()
{
SecondaryCidrBlock = "string",
VpcId = "string",
});
example, err := vpc.NewCidrBlockAssociate(ctx, "cidrBlockAssociateResource", &vpc.CidrBlockAssociateArgs{
SecondaryCidrBlock: pulumi.String("string"),
VpcId: pulumi.String("string"),
})
var cidrBlockAssociateResource = new CidrBlockAssociate("cidrBlockAssociateResource", CidrBlockAssociateArgs.builder()
.secondaryCidrBlock("string")
.vpcId("string")
.build());
cidr_block_associate_resource = volcengine.vpc.CidrBlockAssociate("cidrBlockAssociateResource",
secondary_cidr_block="string",
vpc_id="string")
const cidrBlockAssociateResource = new volcengine.vpc.CidrBlockAssociate("cidrBlockAssociateResource", {
secondaryCidrBlock: "string",
vpcId: "string",
});
type: volcengine:vpc:CidrBlockAssociate
properties:
secondaryCidrBlock: string
vpcId: string
CidrBlockAssociate 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 CidrBlockAssociate resource accepts the following input properties:
- Secondary
Cidr stringBlock - The secondary cidr block of the VPC.
- Vpc
Id string - The id of the VPC.
- Secondary
Cidr stringBlock - The secondary cidr block of the VPC.
- Vpc
Id string - The id of the VPC.
- secondary
Cidr StringBlock - The secondary cidr block of the VPC.
- vpc
Id String - The id of the VPC.
- secondary
Cidr stringBlock - The secondary cidr block of the VPC.
- vpc
Id string - The id of the VPC.
- secondary_
cidr_ strblock - The secondary cidr block of the VPC.
- vpc_
id str - The id of the VPC.
- secondary
Cidr StringBlock - The secondary cidr block of the VPC.
- vpc
Id String - The id of the VPC.
Outputs
All input properties are implicitly available as output properties. Additionally, the CidrBlockAssociate 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 CidrBlockAssociate Resource
Get an existing CidrBlockAssociate 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?: CidrBlockAssociateState, opts?: CustomResourceOptions): CidrBlockAssociate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
secondary_cidr_block: Optional[str] = None,
vpc_id: Optional[str] = None) -> CidrBlockAssociate
func GetCidrBlockAssociate(ctx *Context, name string, id IDInput, state *CidrBlockAssociateState, opts ...ResourceOption) (*CidrBlockAssociate, error)
public static CidrBlockAssociate Get(string name, Input<string> id, CidrBlockAssociateState? state, CustomResourceOptions? opts = null)
public static CidrBlockAssociate get(String name, Output<String> id, CidrBlockAssociateState state, CustomResourceOptions options)
resources: _: type: volcengine:vpc:CidrBlockAssociate 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.
- Secondary
Cidr stringBlock - The secondary cidr block of the VPC.
- Vpc
Id string - The id of the VPC.
- Secondary
Cidr stringBlock - The secondary cidr block of the VPC.
- Vpc
Id string - The id of the VPC.
- secondary
Cidr StringBlock - The secondary cidr block of the VPC.
- vpc
Id String - The id of the VPC.
- secondary
Cidr stringBlock - The secondary cidr block of the VPC.
- vpc
Id string - The id of the VPC.
- secondary_
cidr_ strblock - The secondary cidr block of the VPC.
- vpc_
id str - The id of the VPC.
- secondary
Cidr StringBlock - The secondary cidr block of the VPC.
- vpc
Id 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.