1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. getIpamIpamPoolCidrs
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.vpc.getIpamIpamPoolCidrs

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

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

    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 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 defaultIpamIpamPoolCidr = new alicloud.vpc.IpamIpamPoolCidr("default", {
        cidr: "10.0.0.0/8",
        ipamPoolId: defaultIpamPool.id,
    });
    const _default = alicloud.vpc.getIpamIpamPoolCidrsOutput({
        cidr: "10.0.0.0/8",
        ipamPoolId: defaultIpamIpamPoolCidr.ipamPoolId,
    });
    export const alicloudVpcIpamIpamPoolCidrExampleId = _default.apply(_default => _default.cidrs?.[0]?.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_ipam_ipam_pool_cidr = alicloud.vpc.IpamIpamPoolCidr("default",
        cidr="10.0.0.0/8",
        ipam_pool_id=default_ipam_pool.id)
    default = alicloud.vpc.get_ipam_ipam_pool_cidrs_output(cidr="10.0.0.0/8",
        ipam_pool_id=default_ipam_ipam_pool_cidr.ipam_pool_id)
    pulumi.export("alicloudVpcIpamIpamPoolCidrExampleId", default.cidrs[0].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
    }
    defaultIpamIpamPoolCidr, err := vpc.NewIpamIpamPoolCidr(ctx, "default", &vpc.IpamIpamPoolCidrArgs{
    Cidr: pulumi.String("10.0.0.0/8"),
    IpamPoolId: defaultIpamPool.ID(),
    })
    if err != nil {
    return err
    }
    _default := vpc.GetIpamIpamPoolCidrsOutput(ctx, vpc.GetIpamIpamPoolCidrsOutputArgs{
    Cidr: pulumi.String("10.0.0.0/8"),
    IpamPoolId: defaultIpamIpamPoolCidr.IpamPoolId,
    }, nil);
    ctx.Export("alicloudVpcIpamIpamPoolCidrExampleId", _default.ApplyT(func(_default vpc.GetIpamIpamPoolCidrsResult) (*string, error) {
    return &default.Cidrs[0].Id, nil
    }).(pulumi.StringPtrOutput))
    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 defaultIpamIpamPoolCidr = new AliCloud.Vpc.IpamIpamPoolCidr("default", new()
        {
            Cidr = "10.0.0.0/8",
            IpamPoolId = defaultIpamPool.Id,
        });
    
        var @default = AliCloud.Vpc.GetIpamIpamPoolCidrs.Invoke(new()
        {
            Cidr = "10.0.0.0/8",
            IpamPoolId = defaultIpamIpamPoolCidr.IpamPoolId,
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudVpcIpamIpamPoolCidrExampleId"] = @default.Apply(@default => @default.Apply(getIpamIpamPoolCidrsResult => getIpamIpamPoolCidrsResult.Cidrs[0]?.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 com.pulumi.alicloud.vpc.VpcFunctions;
    import com.pulumi.alicloud.vpc.inputs.GetIpamIpamPoolCidrsArgs;
    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 defaultIpamIpamPoolCidr = new IpamIpamPoolCidr("defaultIpamIpamPoolCidr", IpamIpamPoolCidrArgs.builder()
                .cidr("10.0.0.0/8")
                .ipamPoolId(defaultIpamPool.id())
                .build());
    
            final var default = VpcFunctions.getIpamIpamPoolCidrs(GetIpamIpamPoolCidrsArgs.builder()
                .cidr("10.0.0.0/8")
                .ipamPoolId(defaultIpamIpamPoolCidr.ipamPoolId())
                .build());
    
            ctx.export("alicloudVpcIpamIpamPoolCidrExampleId", default_.applyValue(default_ -> default_.cidrs()[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: ${defaultIpam.regionId}
          ipVersion: IPv4
      defaultIpamIpamPoolCidr:
        type: alicloud:vpc:IpamIpamPoolCidr
        name: default
        properties:
          cidr: 10.0.0.0/8
          ipamPoolId: ${defaultIpamPool.id}
    variables:
      default:
        fn::invoke:
          function: alicloud:vpc:getIpamIpamPoolCidrs
          arguments:
            cidr: 10.0.0.0/8
            ipamPoolId: ${defaultIpamIpamPoolCidr.ipamPoolId}
    outputs:
      alicloudVpcIpamIpamPoolCidrExampleId: ${default.cidrs[0].id}
    

    Using getIpamIpamPoolCidrs

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getIpamIpamPoolCidrs(args: GetIpamIpamPoolCidrsArgs, opts?: InvokeOptions): Promise<GetIpamIpamPoolCidrsResult>
    function getIpamIpamPoolCidrsOutput(args: GetIpamIpamPoolCidrsOutputArgs, opts?: InvokeOptions): Output<GetIpamIpamPoolCidrsResult>
    def get_ipam_ipam_pool_cidrs(cidr: Optional[str] = None,
                                 ipam_pool_id: Optional[str] = None,
                                 output_file: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetIpamIpamPoolCidrsResult
    def get_ipam_ipam_pool_cidrs_output(cidr: Optional[pulumi.Input[str]] = None,
                                 ipam_pool_id: Optional[pulumi.Input[str]] = None,
                                 output_file: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetIpamIpamPoolCidrsResult]
    func GetIpamIpamPoolCidrs(ctx *Context, args *GetIpamIpamPoolCidrsArgs, opts ...InvokeOption) (*GetIpamIpamPoolCidrsResult, error)
    func GetIpamIpamPoolCidrsOutput(ctx *Context, args *GetIpamIpamPoolCidrsOutputArgs, opts ...InvokeOption) GetIpamIpamPoolCidrsResultOutput

    > Note: This function is named GetIpamIpamPoolCidrs in the Go SDK.

    public static class GetIpamIpamPoolCidrs 
    {
        public static Task<GetIpamIpamPoolCidrsResult> InvokeAsync(GetIpamIpamPoolCidrsArgs args, InvokeOptions? opts = null)
        public static Output<GetIpamIpamPoolCidrsResult> Invoke(GetIpamIpamPoolCidrsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIpamIpamPoolCidrsResult> getIpamIpamPoolCidrs(GetIpamIpamPoolCidrsArgs args, InvokeOptions options)
    public static Output<GetIpamIpamPoolCidrsResult> getIpamIpamPoolCidrs(GetIpamIpamPoolCidrsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:vpc/getIpamIpamPoolCidrs:getIpamIpamPoolCidrs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    IpamPoolId string
    The ID of the IPAM pool instance.
    Cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    IpamPoolId string
    The ID of the IPAM pool instance.
    Cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ipamPoolId String
    The ID of the IPAM pool instance.
    cidr String
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ipamPoolId string
    The ID of the IPAM pool instance.
    cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ipam_pool_id str
    The ID of the IPAM pool instance.
    cidr str
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ipamPoolId String
    The ID of the IPAM pool instance.
    cidr String
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getIpamIpamPoolCidrs Result

    The following output properties are available:

    Cidrs List<Pulumi.AliCloud.Vpc.Outputs.GetIpamIpamPoolCidrsCidr>
    A list of Ipam Pool Cidr Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    IpamPoolId string
    The ID of the IPAM pool instance.
    Cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    OutputFile string
    Cidrs []GetIpamIpamPoolCidrsCidr
    A list of Ipam Pool Cidr Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    IpamPoolId string
    The ID of the IPAM pool instance.
    Cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    OutputFile string
    cidrs List<GetIpamIpamPoolCidrsCidr>
    A list of Ipam Pool Cidr Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ipamPoolId String
    The ID of the IPAM pool instance.
    cidr String
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    outputFile String
    cidrs GetIpamIpamPoolCidrsCidr[]
    A list of Ipam Pool Cidr Entries. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ipamPoolId string
    The ID of the IPAM pool instance.
    cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    outputFile string
    cidrs Sequence[GetIpamIpamPoolCidrsCidr]
    A list of Ipam Pool Cidr Entries. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ipam_pool_id str
    The ID of the IPAM pool instance.
    cidr str
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    output_file str
    cidrs List<Property Map>
    A list of Ipam Pool Cidr Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ipamPoolId String
    The ID of the IPAM pool instance.
    cidr String
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    outputFile String

    Supporting Types

    GetIpamIpamPoolCidrsCidr

    Cidr string
    The CIDR address segment to be preset.> currently, only IPv4 address segments are supported.
    Id string
    The ID of the resource supplied above.
    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.> currently, only IPv4 address segments are supported.
    Id string
    The ID of the resource supplied above.
    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.> currently, only IPv4 address segments are supported.
    id String
    The ID of the resource supplied above.
    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.> currently, only IPv4 address segments are supported.
    id string
    The ID of the resource supplied above.
    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.> currently, only IPv4 address segments are supported.
    id str
    The ID of the resource supplied above.
    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.> currently, only IPv4 address segments are supported.
    id String
    The ID of the resource supplied above.
    ipamPoolId String
    The ID of the IPAM pool instance.
    status String
    The status of the resource

    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.75.0 published on Friday, Mar 7, 2025 by Pulumi