UNPKG

@pulumi/aws

Version:

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

173 lines (172 loc) 8.4 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provisions a CIDR from an IPAM address pool. * * > **NOTE:** Provisioning Public IPv4 or Public IPv6 require [steps outside the scope of this resource](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip). The resource accepts `message` and `signature` as part of the `cidrAuthorizationContext` attribute but those must be generated ahead of time. Public IPv6 CIDRs that are provisioned into a Pool with `publiclyAdvertisable = true` and all public IPv4 CIDRs also require creating a Route Origin Authorization (ROA) object in your Regional Internet Registry (RIR). * * > **NOTE:** In order to deprovision CIDRs all Allocations must be released. Allocations created by a VPC take up to 30 minutes to be released. However, for IPAM to properly manage the removal of allocation records created by VPCs and other resources, you must [grant it permissions](https://docs.aws.amazon.com/vpc/latest/ipam/choose-single-user-or-orgs-ipam.html) in * either a single account or organizationally. If you are unable to deprovision a cidr after waiting over 30 minutes, you may be missing the Service Linked Role. * * ## 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), * }); * const exampleVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("example", { * ipamPoolId: exampleVpcIpamPool.id, * cidr: "172.20.0.0/16", * }); * ``` * * Provision Public IPv6 Pool CIDRs: * * ```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 ipv6TestPublic = new aws.ec2.VpcIpamPool("ipv6_test_public", { * addressFamily: "ipv6", * ipamScopeId: example.publicDefaultScopeId, * locale: "us-east-1", * description: "public ipv6", * publiclyAdvertisable: false, * publicIpSource: "amazon", * awsService: "ec2", * }); * const ipv6TestPublicVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("ipv6_test_public", { * ipamPoolId: ipv6TestPublic.id, * netmaskLength: 52, * }); * ``` * * ## Import * * Using `pulumi import`, import IPAMs using the `<cidr>_<ipam-pool-id>`. For example: * * __NOTE:__ Do not use the IPAM Pool Cidr ID as this was introduced after the resource already existed. * * ```sh * $ pulumi import aws:ec2/vpcIpamPoolCidr:VpcIpamPoolCidr example 172.20.0.0/24_ipam-pool-0e634f5a1517cccdc * ``` */ export declare class VpcIpamPoolCidr extends pulumi.CustomResource { /** * Get an existing VpcIpamPoolCidr 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: string, id: pulumi.Input<pulumi.ID>, state?: VpcIpamPoolCidrState, opts?: pulumi.CustomResourceOptions): VpcIpamPoolCidr; /** * Returns true if the given object is an instance of VpcIpamPoolCidr. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is VpcIpamPoolCidr; /** * The CIDR you want to assign to the pool. Conflicts with `netmaskLength`. */ readonly cidr: pulumi.Output<string>; /** * A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP. This is not stored in the state file. See cidrAuthorizationContext for more information. */ readonly cidrAuthorizationContext: pulumi.Output<outputs.ec2.VpcIpamPoolCidrCidrAuthorizationContext | undefined>; /** * The unique ID generated by AWS for the pool cidr. Typically this is the resource `id` but this attribute was added to the API calls after the fact and is therefore not used as the resource id. */ readonly ipamPoolCidrId: pulumi.Output<string>; /** * The ID of the pool to which you want to assign a CIDR. */ readonly ipamPoolId: pulumi.Output<string>; /** * If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with `cidr`. */ readonly netmaskLength: pulumi.Output<number | undefined>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * Create a VpcIpamPoolCidr resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: VpcIpamPoolCidrArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering VpcIpamPoolCidr resources. */ export interface VpcIpamPoolCidrState { /** * The CIDR you want to assign to the pool. Conflicts with `netmaskLength`. */ cidr?: pulumi.Input<string>; /** * A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP. This is not stored in the state file. See cidrAuthorizationContext for more information. */ cidrAuthorizationContext?: pulumi.Input<inputs.ec2.VpcIpamPoolCidrCidrAuthorizationContext>; /** * The unique ID generated by AWS for the pool cidr. Typically this is the resource `id` but this attribute was added to the API calls after the fact and is therefore not used as the resource id. */ ipamPoolCidrId?: pulumi.Input<string>; /** * The ID of the pool to which you want to assign a CIDR. */ ipamPoolId?: pulumi.Input<string>; /** * If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with `cidr`. */ netmaskLength?: pulumi.Input<number>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a VpcIpamPoolCidr resource. */ export interface VpcIpamPoolCidrArgs { /** * The CIDR you want to assign to the pool. Conflicts with `netmaskLength`. */ cidr?: pulumi.Input<string>; /** * A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP. This is not stored in the state file. See cidrAuthorizationContext for more information. */ cidrAuthorizationContext?: pulumi.Input<inputs.ec2.VpcIpamPoolCidrCidrAuthorizationContext>; /** * The ID of the pool to which you want to assign a CIDR. */ ipamPoolId: pulumi.Input<string>; /** * If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with `cidr`. */ netmaskLength?: pulumi.Input<number>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }