UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

136 lines 4.27 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getVpcIpamPoolCidrsOutput = exports.getVpcIpamPoolCidrs = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * `aws.ec2.getVpcIpamPoolCidrs` provides details about an IPAM pool. * * This resource can prove useful when an ipam pool was shared to your account and you want to know all (or a filtered list) of the CIDRs that are provisioned into the pool. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const p = aws.ec2.getVpcIpamPool({ * filters: [ * { * name: "description", * values: ["*mypool*"], * }, * { * name: "address-family", * values: ["ipv4"], * }, * ], * }); * const c = p.then(p => aws.ec2.getVpcIpamPoolCidrs({ * ipamPoolId: p.id, * })); * ``` * * Filtering: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const c = aws.ec2.getVpcIpamPoolCidrs({ * ipamPoolId: "ipam-pool-123", * filters: [{ * name: "cidr", * values: ["10.*"], * }], * }); * const mycidrs = c.then(c => .filter(cidr => cidr.state == "provisioned").map(cidr => (cidr.cidr))); * const pls = new aws.ec2.ManagedPrefixList("pls", { * entries: mycidrs.map((v, k) => ({key: k, value: v})).apply(entries => entries.map(entry => ({ * cidr: entry.value, * description: entry.value, * }))), * name: `IPAM Pool (${test.id}) Cidrs`, * addressFamily: "IPv4", * maxEntries: mycidrs.length, * }); * ``` */ function getVpcIpamPoolCidrs(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:ec2/getVpcIpamPoolCidrs:getVpcIpamPoolCidrs", { "filters": args.filters, "ipamPoolId": args.ipamPoolId, "region": args.region, }, opts); } exports.getVpcIpamPoolCidrs = getVpcIpamPoolCidrs; /** * `aws.ec2.getVpcIpamPoolCidrs` provides details about an IPAM pool. * * This resource can prove useful when an ipam pool was shared to your account and you want to know all (or a filtered list) of the CIDRs that are provisioned into the pool. * * ## Example Usage * * Basic usage: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const p = aws.ec2.getVpcIpamPool({ * filters: [ * { * name: "description", * values: ["*mypool*"], * }, * { * name: "address-family", * values: ["ipv4"], * }, * ], * }); * const c = p.then(p => aws.ec2.getVpcIpamPoolCidrs({ * ipamPoolId: p.id, * })); * ``` * * Filtering: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const c = aws.ec2.getVpcIpamPoolCidrs({ * ipamPoolId: "ipam-pool-123", * filters: [{ * name: "cidr", * values: ["10.*"], * }], * }); * const mycidrs = c.then(c => .filter(cidr => cidr.state == "provisioned").map(cidr => (cidr.cidr))); * const pls = new aws.ec2.ManagedPrefixList("pls", { * entries: mycidrs.map((v, k) => ({key: k, value: v})).apply(entries => entries.map(entry => ({ * cidr: entry.value, * description: entry.value, * }))), * name: `IPAM Pool (${test.id}) Cidrs`, * addressFamily: "IPv4", * maxEntries: mycidrs.length, * }); * ``` */ function getVpcIpamPoolCidrsOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:ec2/getVpcIpamPoolCidrs:getVpcIpamPoolCidrs", { "filters": args.filters, "ipamPoolId": args.ipamPoolId, "region": args.region, }, opts); } exports.getVpcIpamPoolCidrsOutput = getVpcIpamPoolCidrsOutput; //# sourceMappingURL=getVpcIpamPoolCidrs.js.map