1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ens
  5. Network
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

alicloud.ens.Network

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi

    Provides a ENS Network resource.

    For information about ENS Network and how to use it, see What is Network.

    NOTE: Available since v1.213.0.

    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.ens.Network("default", {
        networkName: name,
        description: name,
        cidrBlock: "192.168.2.0/24",
        ensRegionId: "cn-chenzhou-telecom_unicom_cmcc",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.ens.Network("default",
        network_name=name,
        description=name,
        cidr_block="192.168.2.0/24",
        ens_region_id="cn-chenzhou-telecom_unicom_cmcc")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ens"
    	"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 := ens.NewNetwork(ctx, "default", &ens.NetworkArgs{
    			NetworkName: pulumi.String(name),
    			Description: pulumi.String(name),
    			CidrBlock:   pulumi.String("192.168.2.0/24"),
    			EnsRegionId: pulumi.String("cn-chenzhou-telecom_unicom_cmcc"),
    		})
    		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.Ens.Network("default", new()
        {
            NetworkName = name,
            Description = name,
            CidrBlock = "192.168.2.0/24",
            EnsRegionId = "cn-chenzhou-telecom_unicom_cmcc",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ens.Network;
    import com.pulumi.alicloud.ens.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()        
                .networkName(name)
                .description(name)
                .cidrBlock("192.168.2.0/24")
                .ensRegionId("cn-chenzhou-telecom_unicom_cmcc")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:ens:Network
        properties:
          networkName: ${name}
          description: ${name}
          cidrBlock: 192.168.2.0/24
          ensRegionId: cn-chenzhou-telecom_unicom_cmcc
    

    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: NetworkArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Network(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                cidr_block: Optional[str] = None,
                ens_region_id: Optional[str] = None,
                description: Optional[str] = None,
                network_name: Optional[str] = None)
    func NewNetwork(ctx *Context, name string, args NetworkArgs, opts ...ResourceOption) (*Network, error)
    public Network(string name, NetworkArgs args, CustomResourceOptions? opts = null)
    public Network(String name, NetworkArgs args)
    public Network(String name, NetworkArgs args, CustomResourceOptions options)
    
    type: alicloud:ens: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.

    Example

    The following reference example uses placeholder values for all input properties.

    var alicloudNetworkResource = new AliCloud.Ens.Network("alicloudNetworkResource", new()
    {
        CidrBlock = "string",
        EnsRegionId = "string",
        Description = "string",
        NetworkName = "string",
    });
    
    example, err := ens.NewNetwork(ctx, "alicloudNetworkResource", &ens.NetworkArgs{
    	CidrBlock:   pulumi.String("string"),
    	EnsRegionId: pulumi.String("string"),
    	Description: pulumi.String("string"),
    	NetworkName: pulumi.String("string"),
    })
    
    var alicloudNetworkResource = new Network("alicloudNetworkResource", NetworkArgs.builder()        
        .cidrBlock("string")
        .ensRegionId("string")
        .description("string")
        .networkName("string")
        .build());
    
    alicloud_network_resource = alicloud.ens.Network("alicloudNetworkResource",
        cidr_block="string",
        ens_region_id="string",
        description="string",
        network_name="string")
    
    const alicloudNetworkResource = new alicloud.ens.Network("alicloudNetworkResource", {
        cidrBlock: "string",
        ensRegionId: "string",
        description: "string",
        networkName: "string",
    });
    
    type: alicloud:ens:Network
    properties:
        cidrBlock: string
        description: string
        ensRegionId: string
        networkName: 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:

    CidrBlock string
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    EnsRegionId string
    Ens node IDExample value: cn-beijing-telecom.
    Description string
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    NetworkName string
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    CidrBlock string
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    EnsRegionId string
    Ens node IDExample value: cn-beijing-telecom.
    Description string
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    NetworkName string
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    cidrBlock String
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    ensRegionId String
    Ens node IDExample value: cn-beijing-telecom.
    description String
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    networkName String
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    cidrBlock string
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    ensRegionId string
    Ens node IDExample value: cn-beijing-telecom.
    description string
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    networkName string
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    cidr_block str
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    ens_region_id str
    Ens node IDExample value: cn-beijing-telecom.
    description str
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    network_name str
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    cidrBlock String
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    ensRegionId String
    Ens node IDExample value: cn-beijing-telecom.
    description String
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    networkName String
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).

    Outputs

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

    CreateTime string
    Creation time, timestamp (MS).
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the network instance. Pending: Configuring, Available: Available.
    CreateTime string
    Creation time, timestamp (MS).
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the network instance. Pending: Configuring, Available: Available.
    createTime String
    Creation time, timestamp (MS).
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the network instance. Pending: Configuring, Available: Available.
    createTime string
    Creation time, timestamp (MS).
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the network instance. Pending: Configuring, Available: Available.
    create_time str
    Creation time, timestamp (MS).
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the network instance. Pending: Configuring, Available: Available.
    createTime String
    Creation time, timestamp (MS).
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the network instance. Pending: Configuring, Available: 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,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            ens_region_id: Optional[str] = None,
            network_name: Optional[str] = None,
            status: 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.
    The following state arguments are supported:
    CidrBlock string
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    CreateTime string
    Creation time, timestamp (MS).
    Description string
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    EnsRegionId string
    Ens node IDExample value: cn-beijing-telecom.
    NetworkName string
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    Status string
    The status of the network instance. Pending: Configuring, Available: Available.
    CidrBlock string
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    CreateTime string
    Creation time, timestamp (MS).
    Description string
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    EnsRegionId string
    Ens node IDExample value: cn-beijing-telecom.
    NetworkName string
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    Status string
    The status of the network instance. Pending: Configuring, Available: Available.
    cidrBlock String
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    createTime String
    Creation time, timestamp (MS).
    description String
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    ensRegionId String
    Ens node IDExample value: cn-beijing-telecom.
    networkName String
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    status String
    The status of the network instance. Pending: Configuring, Available: Available.
    cidrBlock string
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    createTime string
    Creation time, timestamp (MS).
    description string
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    ensRegionId string
    Ens node IDExample value: cn-beijing-telecom.
    networkName string
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    status string
    The status of the network instance. Pending: Configuring, Available: Available.
    cidr_block str
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    create_time str
    Creation time, timestamp (MS).
    description str
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    ens_region_id str
    Ens node IDExample value: cn-beijing-telecom.
    network_name str
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    status str
    The status of the network instance. Pending: Configuring, Available: Available.
    cidrBlock String
    The network segment of the network. You can use the following network segments or a subset of them as the network segment: 10.0.0.0/8 (default), 172.16.0.0/12, 192.168.0.0/16.
    createTime String
    Creation time, timestamp (MS).
    description String
    Description information.Rules:It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with http:// or https://. Example value: this is my first network.
    ensRegionId String
    Ens node IDExample value: cn-beijing-telecom.
    networkName String
    Name of the network instanceThe naming rules are as follows: 1. Length is 2~128 English or Chinese characters; 2. It must start with a large or small letter or Chinese, not with http:// and https://; 3. Can contain numbers, colons (:), underscores (_), or dashes (-).
    status String
    The status of the network instance. Pending: Configuring, Available: Available.

    Import

    ENS Network can be imported using the id, e.g.

    $ pulumi import alicloud:ens/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.
    alicloud logo
    Alibaba Cloud v3.55.0 published on Tuesday, Apr 30, 2024 by Pulumi