alicloud.vpc.Network
Explore with Pulumi AI
Provides a Vpc Vpc resource. A VPC instance creates a VPC. You can fully control your own VPC, such as selecting IP address ranges, configuring routing tables, and gateways. You can use Alibaba cloud resources such as cloud servers, apsaradb for RDS, and load balancer in your own VPC.
NOTE: Available since v1.0.0.
NOTE: This resource will auto build a router and a route table while it uses
alicloud.vpc.Network
to build a vpc resource.
Module Support
You can use the existing vpc module to create a VPC and several VSwitches one-click.
For information about Vpc Vpc and how to use it, see What is Vpc.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.vpc.Network("default", {
ipv6Isp: "BGP",
description: "test",
cidrBlock: "10.0.0.0/8",
vpcName: name,
enableIpv6: true,
});
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.vpc.Network("default",
ipv6_isp="BGP",
description="test",
cidr_block="10.0.0.0/8",
vpc_name=name,
enable_ipv6=True)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
Ipv6Isp: pulumi.String("BGP"),
Description: pulumi.String("test"),
CidrBlock: pulumi.String("10.0.0.0/8"),
VpcName: pulumi.String(name),
EnableIpv6: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.Vpc.Network("default", new()
{
Ipv6Isp = "BGP",
Description = "test",
CidrBlock = "10.0.0.0/8",
VpcName = name,
EnableIpv6 = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new Network("default", NetworkArgs.builder()
.ipv6Isp("BGP")
.description("test")
.cidrBlock("10.0.0.0/8")
.vpcName(name)
.enableIpv6(true)
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:vpc:Network
properties:
ipv6Isp: BGP
description: test
cidrBlock: 10.0.0.0/8
vpcName: ${name}
enableIpv6: true
Create Network Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Network(name: string, args?: NetworkArgs, opts?: CustomResourceOptions);
@overload
def Network(resource_name: str,
args: Optional[NetworkArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Network(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr_block: Optional[str] = None,
classic_link_enabled: Optional[bool] = None,
description: Optional[str] = None,
dry_run: Optional[bool] = None,
enable_ipv6: Optional[bool] = None,
ipv4_ipam_pool_id: Optional[str] = None,
ipv6_isp: Optional[str] = None,
name: Optional[str] = None,
resource_group_id: Optional[str] = None,
secondary_cidr_blocks: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, Any]] = None,
user_cidrs: Optional[Sequence[str]] = None,
vpc_name: Optional[str] = None)
func NewNetwork(ctx *Context, name string, args *NetworkArgs, opts ...ResourceOption) (*Network, error)
public Network(string name, NetworkArgs? args = null, CustomResourceOptions? opts = null)
public Network(String name, NetworkArgs args)
public Network(String name, NetworkArgs args, CustomResourceOptions options)
type: alicloud:vpc:Network
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 NetworkArgs
- 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 NetworkArgs
- 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 NetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkArgs
- 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 examplenetworkResourceResourceFromVpcnetwork = new AliCloud.Vpc.Network("examplenetworkResourceResourceFromVpcnetwork", new()
{
CidrBlock = "string",
ClassicLinkEnabled = false,
Description = "string",
DryRun = false,
EnableIpv6 = false,
Ipv4IpamPoolId = "string",
Ipv6Isp = "string",
ResourceGroupId = "string",
Tags =
{
{ "string", "any" },
},
UserCidrs = new[]
{
"string",
},
VpcName = "string",
});
example, err := vpc.NewNetwork(ctx, "examplenetworkResourceResourceFromVpcnetwork", &vpc.NetworkArgs{
CidrBlock: pulumi.String("string"),
ClassicLinkEnabled: pulumi.Bool(false),
Description: pulumi.String("string"),
DryRun: pulumi.Bool(false),
EnableIpv6: pulumi.Bool(false),
Ipv4IpamPoolId: pulumi.String("string"),
Ipv6Isp: pulumi.String("string"),
ResourceGroupId: pulumi.String("string"),
Tags: pulumi.Map{
"string": pulumi.Any("any"),
},
UserCidrs: pulumi.StringArray{
pulumi.String("string"),
},
VpcName: pulumi.String("string"),
})
var examplenetworkResourceResourceFromVpcnetwork = new Network("examplenetworkResourceResourceFromVpcnetwork", NetworkArgs.builder()
.cidrBlock("string")
.classicLinkEnabled(false)
.description("string")
.dryRun(false)
.enableIpv6(false)
.ipv4IpamPoolId("string")
.ipv6Isp("string")
.resourceGroupId("string")
.tags(Map.of("string", "any"))
.userCidrs("string")
.vpcName("string")
.build());
examplenetwork_resource_resource_from_vpcnetwork = alicloud.vpc.Network("examplenetworkResourceResourceFromVpcnetwork",
cidr_block="string",
classic_link_enabled=False,
description="string",
dry_run=False,
enable_ipv6=False,
ipv4_ipam_pool_id="string",
ipv6_isp="string",
resource_group_id="string",
tags={
"string": "any",
},
user_cidrs=["string"],
vpc_name="string")
const examplenetworkResourceResourceFromVpcnetwork = new alicloud.vpc.Network("examplenetworkResourceResourceFromVpcnetwork", {
cidrBlock: "string",
classicLinkEnabled: false,
description: "string",
dryRun: false,
enableIpv6: false,
ipv4IpamPoolId: "string",
ipv6Isp: "string",
resourceGroupId: "string",
tags: {
string: "any",
},
userCidrs: ["string"],
vpcName: "string",
});
type: alicloud:vpc:Network
properties:
cidrBlock: string
classicLinkEnabled: false
description: string
dryRun: false
enableIpv6: false
ipv4IpamPoolId: string
ipv6Isp: string
resourceGroupId: string
tags:
string: any
userCidrs:
- string
vpcName: string
Network Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Network resource accepts the following input properties:
- Cidr
Block string - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - Classic
Link boolEnabled - The status of ClassicLink function.
- Description string
- The VPC description. Defaults to null.
- Dry
Run bool - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- Enable
Ipv6 bool - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- Ipv4Ipam
Pool stringId - Ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- Name string
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- Resource
Group stringId - The ID of the resource group to which the VPC belongs.
- Secondary
Cidr List<string>Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - Dictionary<string, object>
- The tags of Vpc.
- User
Cidrs List<string> - A list of user CIDRs.
- Vpc
Name string The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- Cidr
Block string - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - Classic
Link boolEnabled - The status of ClassicLink function.
- Description string
- The VPC description. Defaults to null.
- Dry
Run bool - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- Enable
Ipv6 bool - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- Ipv4Ipam
Pool stringId - Ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- Name string
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- Resource
Group stringId - The ID of the resource group to which the VPC belongs.
- Secondary
Cidr []stringBlocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - map[string]interface{}
- The tags of Vpc.
- User
Cidrs []string - A list of user CIDRs.
- Vpc
Name string The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr
Block String - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic
Link BooleanEnabled - The status of ClassicLink function.
- description String
- The VPC description. Defaults to null.
- dry
Run Boolean - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable
Ipv6 Boolean - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4Ipam
Pool StringId - ipv6Isp String
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name String
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource
Group StringId - The ID of the resource group to which the VPC belongs.
- secondary
Cidr List<String>Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - Map<String,Object>
- The tags of Vpc.
- user
Cidrs List<String> - A list of user CIDRs.
- vpc
Name String The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr
Block string - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic
Link booleanEnabled - The status of ClassicLink function.
- description string
- The VPC description. Defaults to null.
- dry
Run boolean - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable
Ipv6 boolean - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4Ipam
Pool stringId - ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name string
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource
Group stringId - The ID of the resource group to which the VPC belongs.
- secondary
Cidr string[]Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - {[key: string]: any}
- The tags of Vpc.
- user
Cidrs string[] - A list of user CIDRs.
- vpc
Name string The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr_
block str - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic_
link_ boolenabled - The status of ClassicLink function.
- description str
- The VPC description. Defaults to null.
- dry_
run bool - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable_
ipv6 bool - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4_
ipam_ strpool_ id - ipv6_
isp str The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name str
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource_
group_ strid - The ID of the resource group to which the VPC belongs.
- secondary_
cidr_ Sequence[str]blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - Mapping[str, Any]
- The tags of Vpc.
- user_
cidrs Sequence[str] - A list of user CIDRs.
- vpc_
name str The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr
Block String - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic
Link BooleanEnabled - The status of ClassicLink function.
- description String
- The VPC description. Defaults to null.
- dry
Run Boolean - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable
Ipv6 Boolean - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4Ipam
Pool StringId - ipv6Isp String
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name String
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource
Group StringId - The ID of the resource group to which the VPC belongs.
- secondary
Cidr List<String>Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - Map<Any>
- The tags of Vpc.
- user
Cidrs List<String> - A list of user CIDRs.
- vpc
Name String The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
Outputs
All input properties are implicitly available as output properties. Additionally, the Network resource produces the following output properties:
- Create
Time string - The creation time of the VPC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- Ipv6Cidr
Blocks List<Pulumi.Ali Cloud. Vpc. Outputs. Network Ipv6Cidr Block> - The IPv6 CIDR block information of the VPC.
- Route
Table stringId - The route table ID of the router created by default on VPC creation.
- Router
Id string - The ID of the router created by default on VPC creation.
- Router
Table stringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- Status string
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- Create
Time string - The creation time of the VPC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- Ipv6Cidr
Blocks []NetworkIpv6Cidr Block - The IPv6 CIDR block information of the VPC.
- Route
Table stringId - The route table ID of the router created by default on VPC creation.
- Router
Id string - The ID of the router created by default on VPC creation.
- Router
Table stringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- Status string
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- create
Time String - The creation time of the VPC.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block String - The IPv6 CIDR block of the VPC.
- ipv6Cidr
Blocks List<NetworkIpv6Cidr Block> - The IPv6 CIDR block information of the VPC.
- route
Table StringId - The route table ID of the router created by default on VPC creation.
- router
Id String - The ID of the router created by default on VPC creation.
- router
Table StringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- status String
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- create
Time string - The creation time of the VPC.
- id string
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- ipv6Cidr
Blocks NetworkIpv6Cidr Block[] - The IPv6 CIDR block information of the VPC.
- route
Table stringId - The route table ID of the router created by default on VPC creation.
- router
Id string - The ID of the router created by default on VPC creation.
- router
Table stringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- status string
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- create_
time str - The creation time of the VPC.
- id str
- The provider-assigned unique ID for this managed resource.
- ipv6_
cidr_ strblock - The IPv6 CIDR block of the VPC.
- ipv6_
cidr_ Sequence[Networkblocks Ipv6Cidr Block] - The IPv6 CIDR block information of the VPC.
- route_
table_ strid - The route table ID of the router created by default on VPC creation.
- router_
id str - The ID of the router created by default on VPC creation.
- router_
table_ strid - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- status str
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- create
Time String - The creation time of the VPC.
- id String
- The provider-assigned unique ID for this managed resource.
- ipv6Cidr
Block String - The IPv6 CIDR block of the VPC.
- ipv6Cidr
Blocks List<Property Map> - The IPv6 CIDR block information of the VPC.
- route
Table StringId - The route table ID of the router created by default on VPC creation.
- router
Id String - The ID of the router created by default on VPC creation.
- router
Table StringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- status String
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
Look up Existing Network Resource
Get an existing Network 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?: NetworkState, opts?: CustomResourceOptions): Network
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cidr_block: Optional[str] = None,
classic_link_enabled: Optional[bool] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
dry_run: Optional[bool] = None,
enable_ipv6: Optional[bool] = None,
ipv4_ipam_pool_id: Optional[str] = None,
ipv6_cidr_block: Optional[str] = None,
ipv6_cidr_blocks: Optional[Sequence[NetworkIpv6CidrBlockArgs]] = None,
ipv6_isp: Optional[str] = None,
name: Optional[str] = None,
resource_group_id: Optional[str] = None,
route_table_id: Optional[str] = None,
router_id: Optional[str] = None,
router_table_id: Optional[str] = None,
secondary_cidr_blocks: Optional[Sequence[str]] = None,
status: Optional[str] = None,
tags: Optional[Mapping[str, Any]] = None,
user_cidrs: Optional[Sequence[str]] = None,
vpc_name: Optional[str] = None) -> Network
func GetNetwork(ctx *Context, name string, id IDInput, state *NetworkState, opts ...ResourceOption) (*Network, error)
public static Network Get(string name, Input<string> id, NetworkState? state, CustomResourceOptions? opts = null)
public static Network get(String name, Output<String> id, NetworkState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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
Block string - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - Classic
Link boolEnabled - The status of ClassicLink function.
- Create
Time string - The creation time of the VPC.
- Description string
- The VPC description. Defaults to null.
- Dry
Run bool - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- Enable
Ipv6 bool - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- Ipv4Ipam
Pool stringId - Ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- Ipv6Cidr
Blocks List<Pulumi.Ali Cloud. Vpc. Inputs. Network Ipv6Cidr Block> - The IPv6 CIDR block information of the VPC.
- Ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- Name string
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- Resource
Group stringId - The ID of the resource group to which the VPC belongs.
- Route
Table stringId - The route table ID of the router created by default on VPC creation.
- Router
Id string - The ID of the router created by default on VPC creation.
- Router
Table stringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- Secondary
Cidr List<string>Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - Status string
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- Dictionary<string, object>
- The tags of Vpc.
- User
Cidrs List<string> - A list of user CIDRs.
- Vpc
Name string The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- Cidr
Block string - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - Classic
Link boolEnabled - The status of ClassicLink function.
- Create
Time string - The creation time of the VPC.
- Description string
- The VPC description. Defaults to null.
- Dry
Run bool - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- Enable
Ipv6 bool - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- Ipv4Ipam
Pool stringId - Ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- Ipv6Cidr
Blocks []NetworkIpv6Cidr Block Args - The IPv6 CIDR block information of the VPC.
- Ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- Name string
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- Resource
Group stringId - The ID of the resource group to which the VPC belongs.
- Route
Table stringId - The route table ID of the router created by default on VPC creation.
- Router
Id string - The ID of the router created by default on VPC creation.
- Router
Table stringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- Secondary
Cidr []stringBlocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - Status string
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- map[string]interface{}
- The tags of Vpc.
- User
Cidrs []string - A list of user CIDRs.
- Vpc
Name string The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr
Block String - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic
Link BooleanEnabled - The status of ClassicLink function.
- create
Time String - The creation time of the VPC.
- description String
- The VPC description. Defaults to null.
- dry
Run Boolean - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable
Ipv6 Boolean - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4Ipam
Pool StringId - ipv6Cidr
Block String - The IPv6 CIDR block of the VPC.
- ipv6Cidr
Blocks List<NetworkIpv6Cidr Block> - The IPv6 CIDR block information of the VPC.
- ipv6Isp String
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name String
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource
Group StringId - The ID of the resource group to which the VPC belongs.
- route
Table StringId - The route table ID of the router created by default on VPC creation.
- router
Id String - The ID of the router created by default on VPC creation.
- router
Table StringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- secondary
Cidr List<String>Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - status String
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- Map<String,Object>
- The tags of Vpc.
- user
Cidrs List<String> - A list of user CIDRs.
- vpc
Name String The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr
Block string - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic
Link booleanEnabled - The status of ClassicLink function.
- create
Time string - The creation time of the VPC.
- description string
- The VPC description. Defaults to null.
- dry
Run boolean - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable
Ipv6 boolean - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4Ipam
Pool stringId - ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- ipv6Cidr
Blocks NetworkIpv6Cidr Block[] - The IPv6 CIDR block information of the VPC.
- ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name string
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource
Group stringId - The ID of the resource group to which the VPC belongs.
- route
Table stringId - The route table ID of the router created by default on VPC creation.
- router
Id string - The ID of the router created by default on VPC creation.
- router
Table stringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- secondary
Cidr string[]Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - status string
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- {[key: string]: any}
- The tags of Vpc.
- user
Cidrs string[] - A list of user CIDRs.
- vpc
Name string The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr_
block str - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic_
link_ boolenabled - The status of ClassicLink function.
- create_
time str - The creation time of the VPC.
- description str
- The VPC description. Defaults to null.
- dry_
run bool - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable_
ipv6 bool - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4_
ipam_ strpool_ id - ipv6_
cidr_ strblock - The IPv6 CIDR block of the VPC.
- ipv6_
cidr_ Sequence[Networkblocks Ipv6Cidr Block Args] - The IPv6 CIDR block information of the VPC.
- ipv6_
isp str The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name str
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource_
group_ strid - The ID of the resource group to which the VPC belongs.
- route_
table_ strid - The route table ID of the router created by default on VPC creation.
- router_
id str - The ID of the router created by default on VPC creation.
- router_
table_ strid - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- secondary_
cidr_ Sequence[str]blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - status str
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- Mapping[str, Any]
- The tags of Vpc.
- user_
cidrs Sequence[str] - A list of user CIDRs.
- vpc_
name str The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
- cidr
Block String - The CIDR block for the VPC. The
cidr_block
is Optional and default value is172.16.0.0/12
after v1.119.0+. - classic
Link BooleanEnabled - The status of ClassicLink function.
- create
Time String - The creation time of the VPC.
- description String
- The VPC description. Defaults to null.
- dry
Run Boolean - Whether to PreCheck only this request. Value:
- true: The check request is sent without creating a VPC. Check items include whether required parameters, request format, and business restrictions are filled in. If the check does not pass, the corresponding error is returned. If the check passes, the error code 'DryRunOperation' is returned '.
- false (default): Sends a normal request, returns an HTTP 2xx status code and directly creates a VPC.
- enable
Ipv6 Boolean - Whether to enable the IPv6 network segment. Value:
- false (default): not enabled.
- true: on.
- ipv4Ipam
Pool StringId - ipv6Cidr
Block String - The IPv6 CIDR block of the VPC.
- ipv6Cidr
Blocks List<Property Map> - The IPv6 CIDR block information of the VPC.
- ipv6Isp String
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- name String
- . Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.
- resource
Group StringId - The ID of the resource group to which the VPC belongs.
- route
Table StringId - The route table ID of the router created by default on VPC creation.
- router
Id String - The ID of the router created by default on VPC creation.
- router
Table StringId - Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
- secondary
Cidr List<String>Blocks - Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'.
secondary_cidr_blocks
attributes andalicloud.vpc.Ipv4CidrBlock
resource cannot be used at the same time. - status String
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.
- Map<Any>
- The tags of Vpc.
- user
Cidrs List<String> - A list of user CIDRs.
- vpc
Name String The name of the VPC. Defaults to null.
The following arguments will be discarded. Please use new fields as soon as possible:
Supporting Types
NetworkIpv6CidrBlock, NetworkIpv6CidrBlockArgs
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- Ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- Ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- Ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- ipv6Cidr
Block String - The IPv6 CIDR block of the VPC.
- ipv6Isp String
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- ipv6Cidr
Block string - The IPv6 CIDR block of the VPC.
- ipv6Isp string
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- ipv6_
cidr_ strblock - The IPv6 CIDR block of the VPC.
- ipv6_
isp str The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
- ipv6Cidr
Block String - The IPv6 CIDR block of the VPC.
- ipv6Isp String
The IPv6 address segment type of the VPC. Value:
- BGP (default): Alibaba Cloud BGP IPv6.
- ChinaMobile: China Mobile (single line).
- ChinaUnicom: China Unicom (single line).
- ChinaTelecom: China Telecom (single line).
NOTE: If a single-line bandwidth whitelist is enabled, this field can be set to ChinaTelecom (China Telecom), ChinaUnicom (China Unicom), or ChinaMobile (China Mobile).
Import
Vpc Vpc can be imported using the id, e.g.
$ pulumi import alicloud:vpc/network:Network example <id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.