1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. PublicIpAddressPoolCidrBlock
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.vpc.PublicIpAddressPoolCidrBlock

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a VPC Public Ip Address Pool Cidr Block resource.

    NOTE: Only users who have the required permissions can use the IP address pool feature of Elastic IP Address (EIP). To apply for the required permissions, submit a ticket.

    For information about VPC Public Ip Address Pool Cidr Block and how to use it, see What is Public Ip Address Pool Cidr Block.

    NOTE: Available since v1.189.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") || "tf-example";
    const default = alicloud.resourcemanager.getResourceGroups({
        status: "OK",
    });
    const defaultPublicIpAddressPool = new alicloud.vpc.PublicIpAddressPool("default", {
        description: name,
        publicIpAddressPoolName: name,
        isp: "BGP",
        resourceGroupId: _default.then(_default => _default.ids?.[0]),
    });
    const defaultPublicIpAddressPoolCidrBlock = new alicloud.vpc.PublicIpAddressPoolCidrBlock("default", {
        publicIpAddressPoolId: defaultPublicIpAddressPool.id,
        cidrBlock: "47.118.126.0/25",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.resourcemanager.get_resource_groups(status="OK")
    default_public_ip_address_pool = alicloud.vpc.PublicIpAddressPool("default",
        description=name,
        public_ip_address_pool_name=name,
        isp="BGP",
        resource_group_id=default.ids[0])
    default_public_ip_address_pool_cidr_block = alicloud.vpc.PublicIpAddressPoolCidrBlock("default",
        public_ip_address_pool_id=default_public_ip_address_pool.id,
        cidr_block="47.118.126.0/25")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"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 := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{
    			Status: pulumi.StringRef("OK"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultPublicIpAddressPool, err := vpc.NewPublicIpAddressPool(ctx, "default", &vpc.PublicIpAddressPoolArgs{
    			Description:             pulumi.String(name),
    			PublicIpAddressPoolName: pulumi.String(name),
    			Isp:                     pulumi.String("BGP"),
    			ResourceGroupId:         pulumi.String(_default.Ids[0]),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewPublicIpAddressPoolCidrBlock(ctx, "default", &vpc.PublicIpAddressPoolCidrBlockArgs{
    			PublicIpAddressPoolId: defaultPublicIpAddressPool.ID(),
    			CidrBlock:             pulumi.String("47.118.126.0/25"),
    		})
    		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") ?? "tf-example";
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke(new()
        {
            Status = "OK",
        });
    
        var defaultPublicIpAddressPool = new AliCloud.Vpc.PublicIpAddressPool("default", new()
        {
            Description = name,
            PublicIpAddressPoolName = name,
            Isp = "BGP",
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0])),
        });
    
        var defaultPublicIpAddressPoolCidrBlock = new AliCloud.Vpc.PublicIpAddressPoolCidrBlock("default", new()
        {
            PublicIpAddressPoolId = defaultPublicIpAddressPool.Id,
            CidrBlock = "47.118.126.0/25",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.vpc.PublicIpAddressPool;
    import com.pulumi.alicloud.vpc.PublicIpAddressPoolArgs;
    import com.pulumi.alicloud.vpc.PublicIpAddressPoolCidrBlock;
    import com.pulumi.alicloud.vpc.PublicIpAddressPoolCidrBlockArgs;
    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("tf-example");
            final var default = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
                .status("OK")
                .build());
    
            var defaultPublicIpAddressPool = new PublicIpAddressPool("defaultPublicIpAddressPool", PublicIpAddressPoolArgs.builder()
                .description(name)
                .publicIpAddressPoolName(name)
                .isp("BGP")
                .resourceGroupId(default_.ids()[0])
                .build());
    
            var defaultPublicIpAddressPoolCidrBlock = new PublicIpAddressPoolCidrBlock("defaultPublicIpAddressPoolCidrBlock", PublicIpAddressPoolCidrBlockArgs.builder()
                .publicIpAddressPoolId(defaultPublicIpAddressPool.id())
                .cidrBlock("47.118.126.0/25")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      defaultPublicIpAddressPool:
        type: alicloud:vpc:PublicIpAddressPool
        name: default
        properties:
          description: ${name}
          publicIpAddressPoolName: ${name}
          isp: BGP
          resourceGroupId: ${default.ids[0]}
      defaultPublicIpAddressPoolCidrBlock:
        type: alicloud:vpc:PublicIpAddressPoolCidrBlock
        name: default
        properties:
          publicIpAddressPoolId: ${defaultPublicIpAddressPool.id}
          cidrBlock: 47.118.126.0/25
    variables:
      default:
        fn::invoke:
          Function: alicloud:resourcemanager:getResourceGroups
          Arguments:
            status: OK
    

    Create PublicIpAddressPoolCidrBlock Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PublicIpAddressPoolCidrBlock(name: string, args: PublicIpAddressPoolCidrBlockArgs, opts?: CustomResourceOptions);
    @overload
    def PublicIpAddressPoolCidrBlock(resource_name: str,
                                     args: PublicIpAddressPoolCidrBlockArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def PublicIpAddressPoolCidrBlock(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     public_ip_address_pool_id: Optional[str] = None,
                                     cidr_block: Optional[str] = None,
                                     cidr_mask: Optional[int] = None)
    func NewPublicIpAddressPoolCidrBlock(ctx *Context, name string, args PublicIpAddressPoolCidrBlockArgs, opts ...ResourceOption) (*PublicIpAddressPoolCidrBlock, error)
    public PublicIpAddressPoolCidrBlock(string name, PublicIpAddressPoolCidrBlockArgs args, CustomResourceOptions? opts = null)
    public PublicIpAddressPoolCidrBlock(String name, PublicIpAddressPoolCidrBlockArgs args)
    public PublicIpAddressPoolCidrBlock(String name, PublicIpAddressPoolCidrBlockArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:PublicIpAddressPoolCidrBlock
    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 PublicIpAddressPoolCidrBlockArgs
    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 PublicIpAddressPoolCidrBlockArgs
    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 PublicIpAddressPoolCidrBlockArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PublicIpAddressPoolCidrBlockArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PublicIpAddressPoolCidrBlockArgs
    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 publicIpAddressPoolCidrBlockResource = new AliCloud.Vpc.PublicIpAddressPoolCidrBlock("publicIpAddressPoolCidrBlockResource", new()
    {
        PublicIpAddressPoolId = "string",
        CidrBlock = "string",
        CidrMask = 0,
    });
    
    example, err := vpc.NewPublicIpAddressPoolCidrBlock(ctx, "publicIpAddressPoolCidrBlockResource", &vpc.PublicIpAddressPoolCidrBlockArgs{
    	PublicIpAddressPoolId: pulumi.String("string"),
    	CidrBlock:             pulumi.String("string"),
    	CidrMask:              pulumi.Int(0),
    })
    
    var publicIpAddressPoolCidrBlockResource = new PublicIpAddressPoolCidrBlock("publicIpAddressPoolCidrBlockResource", PublicIpAddressPoolCidrBlockArgs.builder()
        .publicIpAddressPoolId("string")
        .cidrBlock("string")
        .cidrMask(0)
        .build());
    
    public_ip_address_pool_cidr_block_resource = alicloud.vpc.PublicIpAddressPoolCidrBlock("publicIpAddressPoolCidrBlockResource",
        public_ip_address_pool_id="string",
        cidr_block="string",
        cidr_mask=0)
    
    const publicIpAddressPoolCidrBlockResource = new alicloud.vpc.PublicIpAddressPoolCidrBlock("publicIpAddressPoolCidrBlockResource", {
        publicIpAddressPoolId: "string",
        cidrBlock: "string",
        cidrMask: 0,
    });
    
    type: alicloud:vpc:PublicIpAddressPoolCidrBlock
    properties:
        cidrBlock: string
        cidrMask: 0
        publicIpAddressPoolId: string
    

    PublicIpAddressPoolCidrBlock 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 PublicIpAddressPoolCidrBlock resource accepts the following input properties:

    PublicIpAddressPoolId string
    The ID of the VPC Public IP address pool.
    CidrBlock string
    The CIDR block.
    CidrMask int

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    PublicIpAddressPoolId string
    The ID of the VPC Public IP address pool.
    CidrBlock string
    The CIDR block.
    CidrMask int

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    publicIpAddressPoolId String
    The ID of the VPC Public IP address pool.
    cidrBlock String
    The CIDR block.
    cidrMask Integer

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    publicIpAddressPoolId string
    The ID of the VPC Public IP address pool.
    cidrBlock string
    The CIDR block.
    cidrMask number

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    public_ip_address_pool_id str
    The ID of the VPC Public IP address pool.
    cidr_block str
    The CIDR block.
    cidr_mask int

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    publicIpAddressPoolId String
    The ID of the VPC Public IP address pool.
    cidrBlock String
    The CIDR block.
    cidrMask Number

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    Outputs

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

    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the VPC Public Ip Address Pool Cidr Block.
    CreateTime string
    The creation time of the resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the VPC Public Ip Address Pool Cidr Block.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the VPC Public Ip Address Pool Cidr Block.
    createTime string
    The creation time of the resource.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the VPC Public Ip Address Pool Cidr Block.
    create_time str
    The creation time of the resource.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the VPC Public Ip Address Pool Cidr Block.
    createTime String
    The creation time of the resource.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the VPC Public Ip Address Pool Cidr Block.

    Look up Existing PublicIpAddressPoolCidrBlock Resource

    Get an existing PublicIpAddressPoolCidrBlock 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?: PublicIpAddressPoolCidrBlockState, opts?: CustomResourceOptions): PublicIpAddressPoolCidrBlock
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr_block: Optional[str] = None,
            cidr_mask: Optional[int] = None,
            create_time: Optional[str] = None,
            public_ip_address_pool_id: Optional[str] = None,
            status: Optional[str] = None) -> PublicIpAddressPoolCidrBlock
    func GetPublicIpAddressPoolCidrBlock(ctx *Context, name string, id IDInput, state *PublicIpAddressPoolCidrBlockState, opts ...ResourceOption) (*PublicIpAddressPoolCidrBlock, error)
    public static PublicIpAddressPoolCidrBlock Get(string name, Input<string> id, PublicIpAddressPoolCidrBlockState? state, CustomResourceOptions? opts = null)
    public static PublicIpAddressPoolCidrBlock get(String name, Output<String> id, PublicIpAddressPoolCidrBlockState 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 CIDR block.
    CidrMask int

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    CreateTime string
    The creation time of the resource.
    PublicIpAddressPoolId string
    The ID of the VPC Public IP address pool.
    Status string
    The status of the VPC Public Ip Address Pool Cidr Block.
    CidrBlock string
    The CIDR block.
    CidrMask int

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    CreateTime string
    The creation time of the resource.
    PublicIpAddressPoolId string
    The ID of the VPC Public IP address pool.
    Status string
    The status of the VPC Public Ip Address Pool Cidr Block.
    cidrBlock String
    The CIDR block.
    cidrMask Integer

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    createTime String
    The creation time of the resource.
    publicIpAddressPoolId String
    The ID of the VPC Public IP address pool.
    status String
    The status of the VPC Public Ip Address Pool Cidr Block.
    cidrBlock string
    The CIDR block.
    cidrMask number

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    createTime string
    The creation time of the resource.
    publicIpAddressPoolId string
    The ID of the VPC Public IP address pool.
    status string
    The status of the VPC Public Ip Address Pool Cidr Block.
    cidr_block str
    The CIDR block.
    cidr_mask int

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    create_time str
    The creation time of the resource.
    public_ip_address_pool_id str
    The ID of the VPC Public IP address pool.
    status str
    The status of the VPC Public Ip Address Pool Cidr Block.
    cidrBlock String
    The CIDR block.
    cidrMask Number

    IP address and network segment mask. After you enter the mask, the system automatically allocates the IP address network segment. Value range: 24 to 28.

    NOTE: CidrBlock and CidrMask cannot be configured at the same time. Select one of them to configure.

    createTime String
    The creation time of the resource.
    publicIpAddressPoolId String
    The ID of the VPC Public IP address pool.
    status String
    The status of the VPC Public Ip Address Pool Cidr Block.

    Import

    VPC Public Ip Address Pool Cidr Block can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/publicIpAddressPoolCidrBlock:PublicIpAddressPoolCidrBlock example <public_ip_address_pool_id>:<cidr_block>
    

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi