getIpamIpamPoolAllocations

This data source provides Vpc Ipam Ipam Pool Allocation available to the user.What is Ipam Pool Allocation

NOTE: Available since v1.241.0.

Example 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 = alicloud.resourcemanager.getResourceGroups({});
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 defaultIpamIpamPoolAllocation = new alicloud.vpc.IpamIpamPoolAllocation("default", {
ipamPoolAllocationDescription: "init alloc desc",
ipamPoolAllocationName: name,
cidr: "10.0.0.0/20",
ipamPoolId: defaultIpamPoolCidr.ipamPoolId,
});
const defaultGetIpamIpamPoolAllocations = alicloud.vpc.getIpamIpamPoolAllocationsOutput({
ids: [defaultIpamIpamPoolAllocation.id],
});
export const alicloudVpcIpamIpamPoolAllocationExampleId = defaultGetIpamIpamPoolAllocations.apply(defaultGetIpamIpamPoolAllocations => defaultGetIpamIpamPoolAllocations.allocations?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.resourcemanager.get_resource_groups()
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_ipam_ipam_pool_allocation = 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)
default_get_ipam_ipam_pool_allocations = alicloud.vpc.get_ipam_ipam_pool_allocations_output(ids=[default_ipam_ipam_pool_allocation.id])
pulumi.export("alicloudVpcIpamIpamPoolAllocationExampleId", default_get_ipam_ipam_pool_allocations.allocations[0].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 @default = AliCloud.ResourceManager.GetResourceGroups.Invoke();
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 defaultIpamIpamPoolAllocation = new AliCloud.Vpc.IpamIpamPoolAllocation("default", new()
{
IpamPoolAllocationDescription = "init alloc desc",
IpamPoolAllocationName = name,
Cidr = "10.0.0.0/20",
IpamPoolId = defaultIpamPoolCidr.IpamPoolId,
});
var defaultGetIpamIpamPoolAllocations = AliCloud.Vpc.GetIpamIpamPoolAllocations.Invoke(new()
{
Ids = new[]
{
defaultIpamIpamPoolAllocation.Id,
},
});
return new Dictionary<string, object?>
{
["alicloudVpcIpamIpamPoolAllocationExampleId"] = defaultGetIpamIpamPoolAllocations&#46;Apply(getIpamIpamPoolAllocationsResult => getIpamIpamPoolAllocationsResult&#46;Allocations[0]?.Id),
};
});
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 := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{}, nil)
if err != nil {
return err
}
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
}
defaultIpamIpamPoolAllocation, 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
}
defaultGetIpamIpamPoolAllocations := vpc.GetIpamIpamPoolAllocationsOutput(ctx, vpc.GetIpamIpamPoolAllocationsOutputArgs{
Ids: pulumi.StringArray{
defaultIpamIpamPoolAllocation.ID(),
},
}, nil)
ctx.Export("alicloudVpcIpamIpamPoolAllocationExampleId", defaultGetIpamIpamPoolAllocations.ApplyT(func(defaultGetIpamIpamPoolAllocations vpc.GetIpamIpamPoolAllocationsResult) (*string, error) {
return &defaultGetIpamIpamPoolAllocations.Allocations[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
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.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 com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetIpamIpamPoolAllocationsArgs;
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");
final var default = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
.build());
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 defaultIpamIpamPoolAllocation = new IpamIpamPoolAllocation("defaultIpamIpamPoolAllocation", IpamIpamPoolAllocationArgs.builder()
.ipamPoolAllocationDescription("init alloc desc")
.ipamPoolAllocationName(name)
.cidr("10.0.0.0/20")
.ipamPoolId(defaultIpamPoolCidr.ipamPoolId())
.build());
final var defaultGetIpamIpamPoolAllocations = VpcFunctions.getIpamIpamPoolAllocations(GetIpamIpamPoolAllocationsArgs.builder()
.ids(defaultIpamIpamPoolAllocation.id())
.build());
ctx.export("alicloudVpcIpamIpamPoolAllocationExampleId", defaultGetIpamIpamPoolAllocations.applyValue(_defaultGetIpamIpamPoolAllocations -> _defaultGetIpamIpamPoolAllocations.allocations()[0].id()));
}
}
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}
defaultIpamIpamPoolAllocation:
type: alicloud:vpc:IpamIpamPoolAllocation
name: default
properties:
ipamPoolAllocationDescription: init alloc desc
ipamPoolAllocationName: ${name}
cidr: 10.0.0.0/20
ipamPoolId: ${defaultIpamPoolCidr.ipamPoolId}
variables:
default:
fn::invoke:
function: alicloud:resourcemanager:getResourceGroups
arguments: {}
defaultGetIpamIpamPoolAllocations:
fn::invoke:
function: alicloud:vpc:getIpamIpamPoolAllocations
arguments:
ids:
- ${defaultIpamIpamPoolAllocation.id}
outputs:
alicloudVpcIpamIpamPoolAllocationExampleId: ${defaultGetIpamIpamPoolAllocations.allocations[0].id}

Return

A collection of values returned by getIpamIpamPoolAllocations.

Parameters

argument

A collection of arguments for invoking getIpamIpamPoolAllocations.


suspend fun getIpamIpamPoolAllocations(cidr: String? = null, ids: List<String>? = null, ipamPoolAllocationId: String? = null, ipamPoolAllocationName: String? = null, ipamPoolId: String, nameRegex: String? = null, outputFile: String? = null): GetIpamIpamPoolAllocationsResult

Return

A collection of values returned by getIpamIpamPoolAllocations.

Parameters

cidr

The allocated address segment.

ids

A list of Ipam Pool Allocation IDs.

ipamPoolAllocationId

The instance ID of the ipam pool allocation.

ipamPoolAllocationName

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

ipamPoolId

The ID of the IPAM Pool.

nameRegex

A regex string to filter results by Group Metric Rule name.

outputFile

File name where to save data source results (after running pulumi preview).

See also


Return

A collection of values returned by getIpamIpamPoolAllocations.

Parameters

argument

Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetIpamIpamPoolAllocationsPlainArgs.

See also