UNPKG

@pulumi/aws

Version:

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

101 lines 4.2 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.VpcIpv4CidrBlockAssociation = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a resource to associate additional IPv4 CIDR blocks with a VPC. * * When a VPC is created, a primary IPv4 CIDR block for the VPC must be specified. * The `aws.ec2.VpcIpv4CidrBlockAssociation` resource allows further IPv4 CIDR blocks to be added to the VPC. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"}); * const secondaryCidr = new aws.ec2.VpcIpv4CidrBlockAssociation("secondary_cidr", { * vpcId: main.id, * cidrBlock: "172.20.0.0/16", * }); * ``` * * ## Import * * or * * or * * Using `pulumi import`, import `aws_vpc_ipv4_cidr_block_association` using the VPC CIDR association ID and optionally the IPv4 IPAM pool ID and netmask length. For example: * * ```sh * $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-021e8461d70ed08be * ``` * or * * ```sh * $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-021e8461d70ed08be,ipam-pool-0a07c432810393463 * ``` * or * * ```sh * $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-021e8461d70ed08be,ipam-pool-0a07c432810393463,28 * ``` */ class VpcIpv4CidrBlockAssociation extends pulumi.CustomResource { /** * Get an existing VpcIpv4CidrBlockAssociation 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 VpcIpv4CidrBlockAssociation(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of VpcIpv4CidrBlockAssociation. 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'] === VpcIpv4CidrBlockAssociation.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["cidrBlock"] = state?.cidrBlock; resourceInputs["ipv4IpamPoolId"] = state?.ipv4IpamPoolId; resourceInputs["ipv4NetmaskLength"] = state?.ipv4NetmaskLength; resourceInputs["region"] = state?.region; resourceInputs["vpcId"] = state?.vpcId; } else { const args = argsOrState; if (args?.vpcId === undefined && !opts.urn) { throw new Error("Missing required property 'vpcId'"); } resourceInputs["cidrBlock"] = args?.cidrBlock; resourceInputs["ipv4IpamPoolId"] = args?.ipv4IpamPoolId; resourceInputs["ipv4NetmaskLength"] = args?.ipv4NetmaskLength; resourceInputs["region"] = args?.region; resourceInputs["vpcId"] = args?.vpcId; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(VpcIpv4CidrBlockAssociation.__pulumiType, name, resourceInputs, opts); } } exports.VpcIpv4CidrBlockAssociation = VpcIpv4CidrBlockAssociation; /** @internal */ VpcIpv4CidrBlockAssociation.__pulumiType = 'aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation'; //# sourceMappingURL=vpcIpv4CidrBlockAssociation.js.map