IpamIpamPoolAllocation

class IpamIpamPoolAllocation : KotlinCustomResource

Provides a Vpc Ipam Ipam Pool Allocation resource. Allocates or reserves a CIDR from an IPAM address pool. For information about Vpc Ipam Ipam Pool Allocation and how to use it, see What is Ipam Pool Allocation.

NOTE: Available since v1.238.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: "cn-hangzhou",
});
const defaultIpamPoolCidr = new alicloud.vpc.IpamIpamPoolCidr("defaultIpamPoolCidr", {
cidr: "10.0.0.0/8",
ipamPoolId: defaultIpamPool.id,
});
const _default = new alicloud.vpc.IpamIpamPoolAllocation("default", {
ipamPoolAllocationDescription: "init alloc desc",
ipamPoolAllocationName: name,
cidr: "10.0.0.0/20",
ipamPoolId: defaultIpamPoolCidr.ipamPoolId,
});
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="cn-hangzhou")
default_ipam_pool_cidr = alicloud.vpc.IpamIpamPoolCidr("defaultIpamPoolCidr",
cidr="10.0.0.0/8",
ipam_pool_id=default_ipam_pool.id)
default = alicloud.vpc.IpamIpamPoolAllocation("default",
ipam_pool_allocation_description="init alloc desc",
ipam_pool_allocation_name=name,
cidr="10.0.0.0/20",
ipam_pool_id=default_ipam_pool_cidr.ipam_pool_id)
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 = "cn-hangzhou",
});
var defaultIpamPoolCidr = new AliCloud.Vpc.IpamIpamPoolCidr("defaultIpamPoolCidr", new()
{
Cidr = "10.0.0.0/8",
IpamPoolId = defaultIpamPool.Id,
});
var @default = new AliCloud.Vpc.IpamIpamPoolAllocation("default", new()
{
IpamPoolAllocationDescription = "init alloc desc",
IpamPoolAllocationName = name,
Cidr = "10.0.0.0/20",
IpamPoolId = defaultIpamPoolCidr.IpamPoolId,
});
});
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: pulumi.String("cn-hangzhou"),
})
if err != nil {
return err
}
defaultIpamPoolCidr, err := vpc.NewIpamIpamPoolCidr(ctx, "defaultIpamPoolCidr", &vpc.IpamIpamPoolCidrArgs{
Cidr: pulumi.String("10.0.0.0/8"),
IpamPoolId: defaultIpamPool.ID(),
})
if err != nil {
return err
}
_, err = vpc.NewIpamIpamPoolAllocation(ctx, "default", &vpc.IpamIpamPoolAllocationArgs{
IpamPoolAllocationDescription: pulumi.String("init alloc desc"),
IpamPoolAllocationName: pulumi.String(name),
Cidr: pulumi.String("10.0.0.0/20"),
IpamPoolId: defaultIpamPoolCidr.IpamPoolId,
})
if err != nil {
return err
}
return nil
})
}
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 com.pulumi.alicloud.vpc.IpamIpamPoolAllocation;
import com.pulumi.alicloud.vpc.IpamIpamPoolAllocationArgs;
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("cn-hangzhou")
.build());
var defaultIpamPoolCidr = new IpamIpamPoolCidr("defaultIpamPoolCidr", IpamIpamPoolCidrArgs.builder()
.cidr("10.0.0.0/8")
.ipamPoolId(defaultIpamPool.id())
.build());
var default_ = new IpamIpamPoolAllocation("default", IpamIpamPoolAllocationArgs.builder()
.ipamPoolAllocationDescription("init alloc desc")
.ipamPoolAllocationName(name)
.cidr("10.0.0.0/20")
.ipamPoolId(defaultIpamPoolCidr.ipamPoolId())
.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: cn-hangzhou
defaultIpamPoolCidr:
type: alicloud:vpc:IpamIpamPoolCidr
properties:
cidr: 10.0.0.0/8
ipamPoolId: ${defaultIpamPool.id}
default:
type: alicloud:vpc:IpamIpamPoolAllocation
properties:
ipamPoolAllocationDescription: init alloc desc
ipamPoolAllocationName: ${name}
cidr: 10.0.0.0/20
ipamPoolId: ${defaultIpamPoolCidr.ipamPoolId}

Import

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

$ pulumi import alicloud:vpc/ipamIpamPoolAllocation:IpamIpamPoolAllocation example <id>

Properties

Link copied to clipboard
val cidr: Output<String>

The allocated address segment.

Link copied to clipboard
val cidrMask: Output<Int>?

Create a custom reserved network segment from The IPAM address pool by entering a mask.

Link copied to clipboard
val createTime: Output<String>

Instance creation time.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The description of the ipam pool alloctaion. It must be 1 to 256 characters in length and must start with an English letter or Chinese character, but cannot start with 'http:// 'or 'https. If it is not filled in, it is empty. The default value is empty.

Link copied to clipboard

The name of the ipam pool allocation. It must be 1 to 128 characters in length and cannot start with 'http:// 'or 'https.

Link copied to clipboard
val ipamPoolId: Output<String>

The ID of the IPAM Pool.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val regionId: Output<String>

When the IPAM Pool to which CIDR is allocated has the region attribute, this attribute is the IPAM Pool region. When the IPAM Pool to which CIDR is allocated does not have the region attribute, this attribute is the IPAM region.

Link copied to clipboard
val status: Output<String>

The status of the instance. Value:

Link copied to clipboard
val urn: Output<String>