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

alicloud.vpc.IpamIpamPoolCidr

Explore with Pulumi AI

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

    Provides a Vpc Ipam Ipam Pool Cidr resource.

    Ipam address pool preset CIDR.

    For information about Vpc Ipam Ipam Pool Cidr and how to use it, see What is Ipam Pool Cidr.

    NOTE: Available since v1.234.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 defaultIpam = new alicloud.vpc.IpamIpam("defaultIpam", {operatingRegionLists: ["cn-hangzhou"]});
    const defaultIpamPool = new alicloud.vpc.IpamIpamPool("defaultIpamPool", {
        ipamScopeId: defaultIpam.privateDefaultScopeId,
        poolRegionId: defaultIpam.regionId,
        ipVersion: "IPv4",
    });
    const _default = new alicloud.vpc.IpamIpamPoolCidr("default", {
        cidr: "10.0.0.0/8",
        ipamPoolId: defaultIpamPool.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default_ipam = alicloud.vpc.IpamIpam("defaultIpam", operating_region_lists=["cn-hangzhou"])
    default_ipam_pool = alicloud.vpc.IpamIpamPool("defaultIpamPool",
        ipam_scope_id=default_ipam.private_default_scope_id,
        pool_region_id=default_ipam.region_id,
        ip_version="IPv4")
    default = alicloud.vpc.IpamIpamPoolCidr("default",
        cidr="10.0.0.0/8",
        ipam_pool_id=default_ipam_pool.id)
    
    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
    		}
    		defaultIpam, err := vpc.NewIpamIpam(ctx, "defaultIpam", &vpc.IpamIpamArgs{
    			OperatingRegionLists: pulumi.StringArray{
    				pulumi.String("cn-hangzhou"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultIpamPool, err := vpc.NewIpamIpamPool(ctx, "defaultIpamPool", &vpc.IpamIpamPoolArgs{
    			IpamScopeId:  defaultIpam.PrivateDefaultScopeId,
    			PoolRegionId: defaultIpam.RegionId,
    			IpVersion:    pulumi.String("IPv4"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewIpamIpamPoolCidr(ctx, "default", &vpc.IpamIpamPoolCidrArgs{
    			Cidr:       pulumi.String("10.0.0.0/8"),
    			IpamPoolId: defaultIpamPool.ID(),
    		})
    		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 defaultIpam = new AliCloud.Vpc.IpamIpam("defaultIpam", new()
        {
            OperatingRegionLists = new[]
            {
                "cn-hangzhou",
            },
        });
    
        var defaultIpamPool = new AliCloud.Vpc.IpamIpamPool("defaultIpamPool", new()
        {
            IpamScopeId = defaultIpam.PrivateDefaultScopeId,
            PoolRegionId = defaultIpam.RegionId,
            IpVersion = "IPv4",
        });
    
        var @default = new AliCloud.Vpc.IpamIpamPoolCidr("default", new()
        {
            Cidr = "10.0.0.0/8",
            IpamPoolId = defaultIpamPool.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.vpc.IpamIpam;
    import com.pulumi.alicloud.vpc.IpamIpamArgs;
    import com.pulumi.alicloud.vpc.IpamIpamPool;
    import com.pulumi.alicloud.vpc.IpamIpamPoolArgs;
    import com.pulumi.alicloud.vpc.IpamIpamPoolCidr;
    import com.pulumi.alicloud.vpc.IpamIpamPoolCidrArgs;
    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 defaultIpam = new IpamIpam("defaultIpam", IpamIpamArgs.builder()
                .operatingRegionLists("cn-hangzhou")
                .build());
    
            var defaultIpamPool = new IpamIpamPool("defaultIpamPool", IpamIpamPoolArgs.builder()
                .ipamScopeId(defaultIpam.privateDefaultScopeId())
                .poolRegionId(defaultIpam.regionId())
                .ipVersion("IPv4")
                .build());
    
            var default_ = new IpamIpamPoolCidr("default", IpamIpamPoolCidrArgs.builder()
                .cidr("10.0.0.0/8")
                .ipamPoolId(defaultIpamPool.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultIpam:
        type: alicloud:vpc:IpamIpam
        properties:
          operatingRegionLists:
            - cn-hangzhou
      defaultIpamPool:
        type: alicloud:vpc:IpamIpamPool
        properties:
          ipamScopeId: ${defaultIpam.privateDefaultScopeId}
          poolRegionId: ${defaultIpam.regionId}
          ipVersion: IPv4
      default:
        type: alicloud:vpc:IpamIpamPoolCidr
        properties:
          cidr: 10.0.0.0/8
          ipamPoolId: ${defaultIpamPool.id}
    

    Create IpamIpamPoolCidr Resource

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

    Constructor syntax

    new IpamIpamPoolCidr(name: string, args: IpamIpamPoolCidrArgs, opts?: CustomResourceOptions);
    @overload
    def IpamIpamPoolCidr(resource_name: str,
                         args: IpamIpamPoolCidrArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def IpamIpamPoolCidr(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         cidr: Optional[str] = None,
                         ipam_pool_id: Optional[str] = None)
    func NewIpamIpamPoolCidr(ctx *Context, name string, args IpamIpamPoolCidrArgs, opts ...ResourceOption) (*IpamIpamPoolCidr, error)
    public IpamIpamPoolCidr(string name, IpamIpamPoolCidrArgs args, CustomResourceOptions? opts = null)
    public IpamIpamPoolCidr(String name, IpamIpamPoolCidrArgs args)
    public IpamIpamPoolCidr(String name, IpamIpamPoolCidrArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:IpamIpamPoolCidr
    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 IpamIpamPoolCidrArgs
    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 IpamIpamPoolCidrArgs
    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 IpamIpamPoolCidrArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IpamIpamPoolCidrArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IpamIpamPoolCidrArgs
    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 ipamIpamPoolCidrResource = new AliCloud.Vpc.IpamIpamPoolCidr("ipamIpamPoolCidrResource", new()
    {
        Cidr = "string",
        IpamPoolId = "string",
    });
    
    example, err := vpc.NewIpamIpamPoolCidr(ctx, "ipamIpamPoolCidrResource", &vpc.IpamIpamPoolCidrArgs{
    	Cidr:       pulumi.String("string"),
    	IpamPoolId: pulumi.String("string"),
    })
    
    var ipamIpamPoolCidrResource = new IpamIpamPoolCidr("ipamIpamPoolCidrResource", IpamIpamPoolCidrArgs.builder()
        .cidr("string")
        .ipamPoolId("string")
        .build());
    
    ipam_ipam_pool_cidr_resource = alicloud.vpc.IpamIpamPoolCidr("ipamIpamPoolCidrResource",
        cidr="string",
        ipam_pool_id="string")
    
    const ipamIpamPoolCidrResource = new alicloud.vpc.IpamIpamPoolCidr("ipamIpamPoolCidrResource", {
        cidr: "string",
        ipamPoolId: "string",
    });
    
    type: alicloud:vpc:IpamIpamPoolCidr
    properties:
        cidr: string
        ipamPoolId: string
    

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

    Cidr string

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    IpamPoolId string
    The ID of the IPAM pool instance.
    Cidr string

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    IpamPoolId string
    The ID of the IPAM pool instance.
    cidr String

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipamPoolId String
    The ID of the IPAM pool instance.
    cidr string

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipamPoolId string
    The ID of the IPAM pool instance.
    cidr str

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipam_pool_id str
    The ID of the IPAM pool instance.
    cidr String

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipamPoolId String
    The ID of the IPAM pool instance.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource

    Look up Existing IpamIpamPoolCidr Resource

    Get an existing IpamIpamPoolCidr 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?: IpamIpamPoolCidrState, opts?: CustomResourceOptions): IpamIpamPoolCidr
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr: Optional[str] = None,
            ipam_pool_id: Optional[str] = None,
            status: Optional[str] = None) -> IpamIpamPoolCidr
    func GetIpamIpamPoolCidr(ctx *Context, name string, id IDInput, state *IpamIpamPoolCidrState, opts ...ResourceOption) (*IpamIpamPoolCidr, error)
    public static IpamIpamPoolCidr Get(string name, Input<string> id, IpamIpamPoolCidrState? state, CustomResourceOptions? opts = null)
    public static IpamIpamPoolCidr get(String name, Output<String> id, IpamIpamPoolCidrState 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:
    Cidr string

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    IpamPoolId string
    The ID of the IPAM pool instance.
    Status string
    The status of the resource
    Cidr string

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    IpamPoolId string
    The ID of the IPAM pool instance.
    Status string
    The status of the resource
    cidr String

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipamPoolId String
    The ID of the IPAM pool instance.
    status String
    The status of the resource
    cidr string

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipamPoolId string
    The ID of the IPAM pool instance.
    status string
    The status of the resource
    cidr str

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipam_pool_id str
    The ID of the IPAM pool instance.
    status str
    The status of the resource
    cidr String

    The CIDR address segment to be preset.

    NOTE: currently, only IPv4 address segments are supported.

    ipamPoolId String
    The ID of the IPAM pool instance.
    status String
    The status of the resource

    Import

    Vpc Ipam Ipam Pool Cidr can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/ipamIpamPoolCidr:IpamIpamPoolCidr example <ipam_pool_id>:<cidr>
    

    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