@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
138 lines • 5.81 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.VpcIpamPoolCidrAllocation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Allocates (reserves) a CIDR from an IPAM address pool, preventing usage by IPAM. Only works for private IPv4.
*
* ## Example Usage
*
* Basic usage:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const exampleVpcIpam = new aws.ec2.VpcIpam("example", {operatingRegions: [{
* regionName: current.then(current => current.region),
* }]});
* const exampleVpcIpamPool = new aws.ec2.VpcIpamPool("example", {
* addressFamily: "ipv4",
* ipamScopeId: exampleVpcIpam.privateDefaultScopeId,
* locale: current.then(current => current.region),
* });
* const exampleVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("example", {
* ipamPoolId: exampleVpcIpamPool.id,
* cidr: "172.20.0.0/16",
* });
* const example = new aws.ec2.VpcIpamPoolCidrAllocation("example", {
* ipamPoolId: exampleVpcIpamPool.id,
* cidr: "172.20.0.0/24",
* }, {
* dependsOn: [exampleVpcIpamPoolCidr],
* });
* ```
*
* With the `disallowedCidrs` attribute:
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const exampleVpcIpam = new aws.ec2.VpcIpam("example", {operatingRegions: [{
* regionName: current.then(current => current.region),
* }]});
* const exampleVpcIpamPool = new aws.ec2.VpcIpamPool("example", {
* addressFamily: "ipv4",
* ipamScopeId: exampleVpcIpam.privateDefaultScopeId,
* locale: current.then(current => current.region),
* });
* const exampleVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("example", {
* ipamPoolId: exampleVpcIpamPool.id,
* cidr: "172.20.0.0/16",
* });
* const example = new aws.ec2.VpcIpamPoolCidrAllocation("example", {
* ipamPoolId: exampleVpcIpamPool.id,
* netmaskLength: 28,
* disallowedCidrs: ["172.20.0.0/28"],
* }, {
* dependsOn: [exampleVpcIpamPoolCidr],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import IPAM allocations using the allocation `id` and `pool id`, separated by `_`. For example:
*
* ```sh
* $ pulumi import aws:ec2/vpcIpamPoolCidrAllocation:VpcIpamPoolCidrAllocation example ipam-pool-alloc-0dc6d196509c049ba8b549ff99f639736_ipam-pool-07cfb559e0921fcbe
* ```
*/
class VpcIpamPoolCidrAllocation extends pulumi.CustomResource {
/**
* Get an existing VpcIpamPoolCidrAllocation 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 VpcIpamPoolCidrAllocation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of VpcIpamPoolCidrAllocation. 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'] === VpcIpamPoolCidrAllocation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cidr"] = state?.cidr;
resourceInputs["description"] = state?.description;
resourceInputs["disallowedCidrs"] = state?.disallowedCidrs;
resourceInputs["ipamPoolAllocationId"] = state?.ipamPoolAllocationId;
resourceInputs["ipamPoolId"] = state?.ipamPoolId;
resourceInputs["netmaskLength"] = state?.netmaskLength;
resourceInputs["region"] = state?.region;
resourceInputs["resourceId"] = state?.resourceId;
resourceInputs["resourceOwner"] = state?.resourceOwner;
resourceInputs["resourceType"] = state?.resourceType;
}
else {
const args = argsOrState;
if (args?.ipamPoolId === undefined && !opts.urn) {
throw new Error("Missing required property 'ipamPoolId'");
}
resourceInputs["cidr"] = args?.cidr;
resourceInputs["description"] = args?.description;
resourceInputs["disallowedCidrs"] = args?.disallowedCidrs;
resourceInputs["ipamPoolId"] = args?.ipamPoolId;
resourceInputs["netmaskLength"] = args?.netmaskLength;
resourceInputs["region"] = args?.region;
resourceInputs["ipamPoolAllocationId"] = undefined /*out*/;
resourceInputs["resourceId"] = undefined /*out*/;
resourceInputs["resourceOwner"] = undefined /*out*/;
resourceInputs["resourceType"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(VpcIpamPoolCidrAllocation.__pulumiType, name, resourceInputs, opts);
}
}
exports.VpcIpamPoolCidrAllocation = VpcIpamPoolCidrAllocation;
/** @internal */
VpcIpamPoolCidrAllocation.__pulumiType = 'aws:ec2/vpcIpamPoolCidrAllocation:VpcIpamPoolCidrAllocation';
//# sourceMappingURL=vpcIpamPoolCidrAllocation.js.map