tencentcloud.Vpc
Explore with Pulumi AI
Provide a resource to create a VPC.
Example Usage
Create a basic VPC
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const vpc = new tencentcloud.Vpc("vpc", {
cidrBlock: "10.0.0.0/16",
dnsServers: [
"119.29.29.29",
"8.8.8.8",
],
isMulticast: false,
tags: {
test: "test",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
vpc = tencentcloud.Vpc("vpc",
cidr_block="10.0.0.0/16",
dns_servers=[
"119.29.29.29",
"8.8.8.8",
],
is_multicast=False,
tags={
"test": "test",
})
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.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
CidrBlock: pulumi.String("10.0.0.0/16"),
DnsServers: pulumi.StringArray{
pulumi.String("119.29.29.29"),
pulumi.String("8.8.8.8"),
},
IsMulticast: pulumi.Bool(false),
Tags: pulumi.StringMap{
"test": pulumi.String("test"),
},
})
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 vpc = new Tencentcloud.Vpc("vpc", new()
{
CidrBlock = "10.0.0.0/16",
DnsServers = new[]
{
"119.29.29.29",
"8.8.8.8",
},
IsMulticast = false,
Tags =
{
{ "test", "test" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.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 vpc = new Vpc("vpc", VpcArgs.builder()
.cidrBlock("10.0.0.0/16")
.dnsServers(
"119.29.29.29",
"8.8.8.8")
.isMulticast(false)
.tags(Map.of("test", "test"))
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
cidrBlock: 10.0.0.0/16
dnsServers:
- 119.29.29.29
- 8.8.8.8
isMulticast: false
tags:
test: test
Using Assistant CIDR
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const vpc = new tencentcloud.Vpc("vpc", {
assistantCidrs: ["172.16.0.0/24"],
cidrBlock: "10.0.0.0/16",
isMulticast: false,
tags: {
test: "test",
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
vpc = tencentcloud.Vpc("vpc",
assistant_cidrs=["172.16.0.0/24"],
cidr_block="10.0.0.0/16",
is_multicast=False,
tags={
"test": "test",
})
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.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
AssistantCidrs: pulumi.StringArray{
pulumi.String("172.16.0.0/24"),
},
CidrBlock: pulumi.String("10.0.0.0/16"),
IsMulticast: pulumi.Bool(false),
Tags: pulumi.StringMap{
"test": pulumi.String("test"),
},
})
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 vpc = new Tencentcloud.Vpc("vpc", new()
{
AssistantCidrs = new[]
{
"172.16.0.0/24",
},
CidrBlock = "10.0.0.0/16",
IsMulticast = false,
Tags =
{
{ "test", "test" },
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.Vpc;
import com.pulumi.tencentcloud.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 vpc = new Vpc("vpc", VpcArgs.builder()
.assistantCidrs("172.16.0.0/24")
.cidrBlock("10.0.0.0/16")
.isMulticast(false)
.tags(Map.of("test", "test"))
.build());
}
}
resources:
vpc:
type: tencentcloud:Vpc
properties:
assistantCidrs:
- 172.16.0.0/24
cidrBlock: 10.0.0.0/16
isMulticast: false
tags:
test: test
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_block: Optional[str] = None,
assistant_cidrs: Optional[Sequence[str]] = None,
dns_servers: Optional[Sequence[str]] = None,
is_multicast: Optional[bool] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, 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: tencentcloud: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.
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
Block string - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- Assistant
Cidrs List<string> - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - Dns
Servers List<string> - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- Is
Multicast bool - Indicates whether VPC multicast is enabled. The default value is 'true'.
- Name string
- The name of the VPC.
- Dictionary<string, string>
- Tags of the VPC.
- Vpc
Id string - ID of the resource.
- Cidr
Block string - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- Assistant
Cidrs []string - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - Dns
Servers []string - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- Is
Multicast bool - Indicates whether VPC multicast is enabled. The default value is 'true'.
- Name string
- The name of the VPC.
- map[string]string
- Tags of the VPC.
- Vpc
Id string - ID of the resource.
- cidr
Block String - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- assistant
Cidrs List<String> - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - dns
Servers List<String> - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- is
Multicast Boolean - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name String
- The name of the VPC.
- Map<String,String>
- Tags of the VPC.
- vpc
Id String - ID of the resource.
- cidr
Block string - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- assistant
Cidrs string[] - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - dns
Servers string[] - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- is
Multicast boolean - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name string
- The name of the VPC.
- {[key: string]: string}
- Tags of the VPC.
- vpc
Id string - ID of the resource.
- cidr_
block str - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- assistant_
cidrs Sequence[str] - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - dns_
servers Sequence[str] - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- is_
multicast bool - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name str
- The name of the VPC.
- Mapping[str, str]
- Tags of the VPC.
- vpc_
id str - ID of the resource.
- cidr
Block String - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- assistant
Cidrs List<String> - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - dns
Servers List<String> - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- is
Multicast Boolean - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name String
- The name of the VPC.
- Map<String>
- Tags of the VPC.
- vpc
Id String - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the Vpc resource produces the following output properties:
- Create
Time string - Creation time of VPC.
- Default
Route stringTable Id - Default route table id, which created automatically after VPC create.
- Docker
Assistant List<string>Cidrs - List of Docker Assistant CIDR.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Default bool - Indicates whether it is the default VPC for this region.
- Create
Time string - Creation time of VPC.
- Default
Route stringTable Id - Default route table id, which created automatically after VPC create.
- Docker
Assistant []stringCidrs - List of Docker Assistant CIDR.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Default bool - Indicates whether it is the default VPC for this region.
- create
Time String - Creation time of VPC.
- default
Route StringTable Id - Default route table id, which created automatically after VPC create.
- docker
Assistant List<String>Cidrs - List of Docker Assistant CIDR.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default Boolean - Indicates whether it is the default VPC for this region.
- create
Time string - Creation time of VPC.
- default
Route stringTable Id - Default route table id, which created automatically after VPC create.
- docker
Assistant string[]Cidrs - List of Docker Assistant CIDR.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Default boolean - Indicates whether it is the default VPC for this region.
- create_
time str - Creation time of VPC.
- default_
route_ strtable_ id - Default route table id, which created automatically after VPC create.
- docker_
assistant_ Sequence[str]cidrs - List of Docker Assistant CIDR.
- id str
- The provider-assigned unique ID for this managed resource.
- is_
default bool - Indicates whether it is the default VPC for this region.
- create
Time String - Creation time of VPC.
- default
Route StringTable Id - Default route table id, which created automatically after VPC create.
- docker
Assistant List<String>Cidrs - List of Docker Assistant CIDR.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default Boolean - Indicates whether it is the default VPC for this region.
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,
assistant_cidrs: Optional[Sequence[str]] = None,
cidr_block: Optional[str] = None,
create_time: Optional[str] = None,
default_route_table_id: Optional[str] = None,
dns_servers: Optional[Sequence[str]] = None,
docker_assistant_cidrs: Optional[Sequence[str]] = None,
is_default: Optional[bool] = None,
is_multicast: Optional[bool] = None,
name: Optional[str] = None,
tags: Optional[Mapping[str, 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: tencentcloud: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.
- Assistant
Cidrs List<string> - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - Cidr
Block string - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- Create
Time string - Creation time of VPC.
- Default
Route stringTable Id - Default route table id, which created automatically after VPC create.
- Dns
Servers List<string> - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- Docker
Assistant List<string>Cidrs - List of Docker Assistant CIDR.
- Is
Default bool - Indicates whether it is the default VPC for this region.
- Is
Multicast bool - Indicates whether VPC multicast is enabled. The default value is 'true'.
- Name string
- The name of the VPC.
- Dictionary<string, string>
- Tags of the VPC.
- Vpc
Id string - ID of the resource.
- Assistant
Cidrs []string - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - Cidr
Block string - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- Create
Time string - Creation time of VPC.
- Default
Route stringTable Id - Default route table id, which created automatically after VPC create.
- Dns
Servers []string - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- Docker
Assistant []stringCidrs - List of Docker Assistant CIDR.
- Is
Default bool - Indicates whether it is the default VPC for this region.
- Is
Multicast bool - Indicates whether VPC multicast is enabled. The default value is 'true'.
- Name string
- The name of the VPC.
- map[string]string
- Tags of the VPC.
- Vpc
Id string - ID of the resource.
- assistant
Cidrs List<String> - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - cidr
Block String - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- create
Time String - Creation time of VPC.
- default
Route StringTable Id - Default route table id, which created automatically after VPC create.
- dns
Servers List<String> - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- docker
Assistant List<String>Cidrs - List of Docker Assistant CIDR.
- is
Default Boolean - Indicates whether it is the default VPC for this region.
- is
Multicast Boolean - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name String
- The name of the VPC.
- Map<String,String>
- Tags of the VPC.
- vpc
Id String - ID of the resource.
- assistant
Cidrs string[] - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - cidr
Block string - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- create
Time string - Creation time of VPC.
- default
Route stringTable Id - Default route table id, which created automatically after VPC create.
- dns
Servers string[] - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- docker
Assistant string[]Cidrs - List of Docker Assistant CIDR.
- is
Default boolean - Indicates whether it is the default VPC for this region.
- is
Multicast boolean - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name string
- The name of the VPC.
- {[key: string]: string}
- Tags of the VPC.
- vpc
Id string - ID of the resource.
- assistant_
cidrs Sequence[str] - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - cidr_
block str - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- create_
time str - Creation time of VPC.
- default_
route_ strtable_ id - Default route table id, which created automatically after VPC create.
- dns_
servers Sequence[str] - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- docker_
assistant_ Sequence[str]cidrs - List of Docker Assistant CIDR.
- is_
default bool - Indicates whether it is the default VPC for this region.
- is_
multicast bool - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name str
- The name of the VPC.
- Mapping[str, str]
- Tags of the VPC.
- vpc_
id str - ID of the resource.
- assistant
Cidrs List<String> - List of Assistant CIDR, NOTE: Only
NORMAL
typed CIDRs included, check the Docker CIDR by readonlyassistant_docker_cidrs
. - cidr
Block String - A network address block which should be a subnet of the three internal network segments (10.0.0.0/16, 172.16.0.0/12 and 192.168.0.0/16).
- create
Time String - Creation time of VPC.
- default
Route StringTable Id - Default route table id, which created automatically after VPC create.
- dns
Servers List<String> - The DNS server list of the VPC. And you can specify 0 to 5 servers to this list.
- docker
Assistant List<String>Cidrs - List of Docker Assistant CIDR.
- is
Default Boolean - Indicates whether it is the default VPC for this region.
- is
Multicast Boolean - Indicates whether VPC multicast is enabled. The default value is 'true'.
- name String
- The name of the VPC.
- Map<String>
- Tags of the VPC.
- vpc
Id String - ID of the resource.
Import
Vpc instance can be imported, e.g.
$ pulumi import tencentcloud:index/vpc:Vpc test vpc-id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.