ucloud.Vpc
Explore with Pulumi AI
Provides a VPC resource.
Note The network segment can only be created or deleted, can not perform both of them at the same time.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = new ucloud.Vpc("example", {
cidrBlocks: ["192.168.0.0/16"],
tag: "tf-example",
});
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.Vpc("example",
cidr_blocks=["192.168.0.0/16"],
tag="tf-example")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ucloud.NewVpc(ctx, "example", &ucloud.VpcArgs{
CidrBlocks: pulumi.StringArray{
pulumi.String("192.168.0.0/16"),
},
Tag: pulumi.String("tf-example"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var example = new Ucloud.Vpc("example", new()
{
CidrBlocks = new[]
{
"192.168.0.0/16",
},
Tag = "tf-example",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ucloud.Vpc;
import com.pulumi.ucloud.VpcArgs;
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 example = new Vpc("example", VpcArgs.builder()
.cidrBlocks("192.168.0.0/16")
.tag("tf-example")
.build());
}
}
resources:
example:
type: ucloud:Vpc
properties:
# vpc network
cidrBlocks:
- 192.168.0.0/16
tag: tf-example
Create Vpc Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Vpc(name: string, args: VpcArgs, opts?: CustomResourceOptions);
@overload
def Vpc(resource_name: str,
args: VpcArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Vpc(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr_blocks: Optional[Sequence[str]] = None,
name: Optional[str] = None,
remark: Optional[str] = None,
tag: Optional[str] = None,
vpc_id: Optional[str] = None)
func NewVpc(ctx *Context, name string, args VpcArgs, opts ...ResourceOption) (*Vpc, error)
public Vpc(string name, VpcArgs args, CustomResourceOptions? opts = null)
type: ucloud:Vpc
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 VpcArgs
- 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 VpcArgs
- 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 VpcArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcArgs
- 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 vpcResource = new Ucloud.Vpc("vpcResource", new()
{
CidrBlocks = new[]
{
"string",
},
Name = "string",
Remark = "string",
Tag = "string",
VpcId = "string",
});
example, err := ucloud.NewVpc(ctx, "vpcResource", &ucloud.VpcArgs{
CidrBlocks: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Remark: pulumi.String("string"),
Tag: pulumi.String("string"),
VpcId: pulumi.String("string"),
})
var vpcResource = new Vpc("vpcResource", VpcArgs.builder()
.cidrBlocks("string")
.name("string")
.remark("string")
.tag("string")
.vpcId("string")
.build());
vpc_resource = ucloud.Vpc("vpcResource",
cidr_blocks=["string"],
name="string",
remark="string",
tag="string",
vpc_id="string")
const vpcResource = new ucloud.Vpc("vpcResource", {
cidrBlocks: ["string"],
name: "string",
remark: "string",
tag: "string",
vpcId: "string",
});
type: ucloud:Vpc
properties:
cidrBlocks:
- string
name: string
remark: string
tag: string
vpcId: string
Vpc 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 Vpc resource accepts the following input properties:
- Cidr
Blocks List<string> - The CIDR blocks of VPC.
- Name string
- Remark string
- The remarks of the VPC. (Default:
""
). - Tag string
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - Vpc
Id string - The ID of the resource VPC.
- Cidr
Blocks []string - The CIDR blocks of VPC.
- Name string
- Remark string
- The remarks of the VPC. (Default:
""
). - Tag string
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - Vpc
Id string - The ID of the resource VPC.
- cidr
Blocks List<String> - The CIDR blocks of VPC.
- name String
- remark String
- The remarks of the VPC. (Default:
""
). - tag String
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - vpc
Id String - The ID of the resource VPC.
- cidr
Blocks string[] - The CIDR blocks of VPC.
- name string
- remark string
- The remarks of the VPC. (Default:
""
). - tag string
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - vpc
Id string - The ID of the resource VPC.
- cidr_
blocks Sequence[str] - The CIDR blocks of VPC.
- name str
- remark str
- The remarks of the VPC. (Default:
""
). - tag str
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - vpc_
id str - The ID of the resource VPC.
- cidr
Blocks List<String> - The CIDR blocks of VPC.
- name String
- remark String
- The remarks of the VPC. (Default:
""
). - tag String
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - vpc
Id String - The ID of the resource VPC.
Outputs
All input properties are implicitly available as output properties. Additionally, the Vpc resource produces the following output properties:
- Create
Time string - The time of creation for VPC, formatted in RFC3339 time string.
- Id string
- The provider-assigned unique ID for this managed resource.
- Network
Infos List<VpcNetwork Info> - It is a nested type which documented below.
- Update
Time string - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- Create
Time string - The time of creation for VPC, formatted in RFC3339 time string.
- Id string
- The provider-assigned unique ID for this managed resource.
- Network
Infos []VpcNetwork Info - It is a nested type which documented below.
- Update
Time string - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- create
Time String - The time of creation for VPC, formatted in RFC3339 time string.
- id String
- The provider-assigned unique ID for this managed resource.
- network
Infos List<VpcNetwork Info> - It is a nested type which documented below.
- update
Time String - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- create
Time string - The time of creation for VPC, formatted in RFC3339 time string.
- id string
- The provider-assigned unique ID for this managed resource.
- network
Infos VpcNetwork Info[] - It is a nested type which documented below.
- update
Time string - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- create_
time str - The time of creation for VPC, formatted in RFC3339 time string.
- id str
- The provider-assigned unique ID for this managed resource.
- network_
infos Sequence[VpcNetwork Info] - It is a nested type which documented below.
- update_
time str - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- create
Time String - The time of creation for VPC, formatted in RFC3339 time string.
- id String
- The provider-assigned unique ID for this managed resource.
- network
Infos List<Property Map> - It is a nested type which documented below.
- update
Time String - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
Look up Existing Vpc Resource
Get an existing Vpc 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?: VpcState, opts?: CustomResourceOptions): Vpc
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cidr_blocks: Optional[Sequence[str]] = None,
create_time: Optional[str] = None,
name: Optional[str] = None,
network_infos: Optional[Sequence[VpcNetworkInfoArgs]] = None,
remark: Optional[str] = None,
tag: Optional[str] = None,
update_time: Optional[str] = None,
vpc_id: Optional[str] = None) -> Vpc
func GetVpc(ctx *Context, name string, id IDInput, state *VpcState, opts ...ResourceOption) (*Vpc, error)
public static Vpc Get(string name, Input<string> id, VpcState? state, CustomResourceOptions? opts = null)
public static Vpc get(String name, Output<String> id, VpcState state, CustomResourceOptions options)
resources: _: type: ucloud:Vpc 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.
- Cidr
Blocks List<string> - The CIDR blocks of VPC.
- Create
Time string - The time of creation for VPC, formatted in RFC3339 time string.
- Name string
- Network
Infos List<VpcNetwork Info> - It is a nested type which documented below.
- Remark string
- The remarks of the VPC. (Default:
""
). - Tag string
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - Update
Time string - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- Vpc
Id string - The ID of the resource VPC.
- Cidr
Blocks []string - The CIDR blocks of VPC.
- Create
Time string - The time of creation for VPC, formatted in RFC3339 time string.
- Name string
- Network
Infos []VpcNetwork Info Args - It is a nested type which documented below.
- Remark string
- The remarks of the VPC. (Default:
""
). - Tag string
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - Update
Time string - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- Vpc
Id string - The ID of the resource VPC.
- cidr
Blocks List<String> - The CIDR blocks of VPC.
- create
Time String - The time of creation for VPC, formatted in RFC3339 time string.
- name String
- network
Infos List<VpcNetwork Info> - It is a nested type which documented below.
- remark String
- The remarks of the VPC. (Default:
""
). - tag String
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - update
Time String - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- vpc
Id String - The ID of the resource VPC.
- cidr
Blocks string[] - The CIDR blocks of VPC.
- create
Time string - The time of creation for VPC, formatted in RFC3339 time string.
- name string
- network
Infos VpcNetwork Info[] - It is a nested type which documented below.
- remark string
- The remarks of the VPC. (Default:
""
). - tag string
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - update
Time string - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- vpc
Id string - The ID of the resource VPC.
- cidr_
blocks Sequence[str] - The CIDR blocks of VPC.
- create_
time str - The time of creation for VPC, formatted in RFC3339 time string.
- name str
- network_
infos Sequence[VpcNetwork Info Args] - It is a nested type which documented below.
- remark str
- The remarks of the VPC. (Default:
""
). - tag str
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - update_
time str - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- vpc_
id str - The ID of the resource VPC.
- cidr
Blocks List<String> - The CIDR blocks of VPC.
- create
Time String - The time of creation for VPC, formatted in RFC3339 time string.
- name String
- network
Infos List<Property Map> - It is a nested type which documented below.
- remark String
- The remarks of the VPC. (Default:
""
). - tag String
- A tag assigned to VPC, which contains at most 63 characters and only support Chinese, English, numbers, '-', '_', and '.'. If it is not filled in or a empty string is filled in, then default tag will be assigned. (Default:
Default
). - update
Time String - The time whenever there is a change made to VPC, formatted in RFC3339 time string.
- vpc
Id String - The ID of the resource VPC.
Supporting Types
VpcNetworkInfo, VpcNetworkInfoArgs
- Cidr
Block string - The CIDR block of the VPC.
- Cidr
Block string - The CIDR block of the VPC.
- cidr
Block String - The CIDR block of the VPC.
- cidr
Block string - The CIDR block of the VPC.
- cidr_
block str - The CIDR block of the VPC.
- cidr
Block String - The CIDR block of the VPC.
Import
VPC can be imported using the id
, e.g.
$ pulumi import ucloud:index/vpc:Vpc example uvnet-abc123456
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloud
Terraform Provider.