@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
155 lines • 6.79 kB
JavaScript
;
// *** 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.VpcIpamPool = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an IP address pool resource for IPAM.
*
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const example = new aws.ec2.VpcIpam("example", {operatingRegions: [{
* regionName: current.then(current => current.region),
* }]});
* const exampleVpcIpamPool = new aws.ec2.VpcIpamPool("example", {
* addressFamily: "ipv4",
* ipamScopeId: example.privateDefaultScopeId,
* locale: current.then(current => current.region),
* });
* ```
*
* Nested Pools:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const example = new aws.ec2.VpcIpam("example", {operatingRegions: [{
* regionName: current.then(current => current.region),
* }]});
* const parent = new aws.ec2.VpcIpamPool("parent", {
* addressFamily: "ipv4",
* ipamScopeId: example.privateDefaultScopeId,
* });
* const parentTest = new aws.ec2.VpcIpamPoolCidr("parent_test", {
* ipamPoolId: parent.id,
* cidr: "172.20.0.0/16",
* });
* const child = new aws.ec2.VpcIpamPool("child", {
* addressFamily: "ipv4",
* ipamScopeId: example.privateDefaultScopeId,
* locale: current.then(current => current.region),
* sourceIpamPoolId: parent.id,
* });
* const childTest = new aws.ec2.VpcIpamPoolCidr("child_test", {
* ipamPoolId: child.id,
* cidr: "172.20.0.0/24",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import IPAMs using the IPAM pool `id`. For example:
*
* ```sh
* $ pulumi import aws:ec2/vpcIpamPool:VpcIpamPool example ipam-pool-0958f95207d978e1e
* ```
*/
class VpcIpamPool extends pulumi.CustomResource {
/**
* Get an existing VpcIpamPool resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new VpcIpamPool(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VpcIpamPool. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === VpcIpamPool.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["addressFamily"] = state?.addressFamily;
resourceInputs["allocationDefaultNetmaskLength"] = state?.allocationDefaultNetmaskLength;
resourceInputs["allocationMaxNetmaskLength"] = state?.allocationMaxNetmaskLength;
resourceInputs["allocationMinNetmaskLength"] = state?.allocationMinNetmaskLength;
resourceInputs["allocationResourceTags"] = state?.allocationResourceTags;
resourceInputs["arn"] = state?.arn;
resourceInputs["autoImport"] = state?.autoImport;
resourceInputs["awsService"] = state?.awsService;
resourceInputs["cascade"] = state?.cascade;
resourceInputs["description"] = state?.description;
resourceInputs["ipamScopeId"] = state?.ipamScopeId;
resourceInputs["ipamScopeType"] = state?.ipamScopeType;
resourceInputs["locale"] = state?.locale;
resourceInputs["poolDepth"] = state?.poolDepth;
resourceInputs["publicIpSource"] = state?.publicIpSource;
resourceInputs["publiclyAdvertisable"] = state?.publiclyAdvertisable;
resourceInputs["region"] = state?.region;
resourceInputs["sourceIpamPoolId"] = state?.sourceIpamPoolId;
resourceInputs["state"] = state?.state;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.addressFamily === undefined && !opts.urn) {
throw new Error("Missing required property 'addressFamily'");
}
if (args?.ipamScopeId === undefined && !opts.urn) {
throw new Error("Missing required property 'ipamScopeId'");
}
resourceInputs["addressFamily"] = args?.addressFamily;
resourceInputs["allocationDefaultNetmaskLength"] = args?.allocationDefaultNetmaskLength;
resourceInputs["allocationMaxNetmaskLength"] = args?.allocationMaxNetmaskLength;
resourceInputs["allocationMinNetmaskLength"] = args?.allocationMinNetmaskLength;
resourceInputs["allocationResourceTags"] = args?.allocationResourceTags;
resourceInputs["autoImport"] = args?.autoImport;
resourceInputs["awsService"] = args?.awsService;
resourceInputs["cascade"] = args?.cascade;
resourceInputs["description"] = args?.description;
resourceInputs["ipamScopeId"] = args?.ipamScopeId;
resourceInputs["locale"] = args?.locale;
resourceInputs["publicIpSource"] = args?.publicIpSource;
resourceInputs["publiclyAdvertisable"] = args?.publiclyAdvertisable;
resourceInputs["region"] = args?.region;
resourceInputs["sourceIpamPoolId"] = args?.sourceIpamPoolId;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["ipamScopeType"] = undefined /*out*/;
resourceInputs["poolDepth"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpcIpamPool.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpcIpamPool = VpcIpamPool;
/** @internal */
VpcIpamPool.__pulumiType = 'aws:ec2/vpcIpamPool:VpcIpamPool';
//# sourceMappingURL=vpcIpamPool.js.map