Try AWS Native preview for resources not in the classic version.
aws.ec2.VpcIpamPoolCidr
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provisions a CIDR from an IPAM address pool.
NOTE: Provisioning Public IPv4 or Public IPv6 require steps outside the scope of this resource. The resource accepts
message
andsignature
as part of thecidr_authorization_context
attribute but those must be generated ahead of time. Public IPv6 CIDRs that are provisioned into a Pool withpublicly_advertisable = 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 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
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.GetRegion.Invoke();
var exampleVpcIpam = new Aws.Ec2.VpcIpam("exampleVpcIpam", new()
{
OperatingRegions = new[]
{
new Aws.Ec2.Inputs.VpcIpamOperatingRegionArgs
{
RegionName = current.Apply(getRegionResult => getRegionResult.Name),
},
},
});
var exampleVpcIpamPool = new Aws.Ec2.VpcIpamPool("exampleVpcIpamPool", new()
{
AddressFamily = "ipv4",
IpamScopeId = exampleVpcIpam.PrivateDefaultScopeId,
Locale = current.Apply(getRegionResult => getRegionResult.Name),
});
var exampleVpcIpamPoolCidr = new Aws.Ec2.VpcIpamPoolCidr("exampleVpcIpamPoolCidr", new()
{
IpamPoolId = exampleVpcIpamPool.Id,
Cidr = "172.20.0.0/16",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := aws.GetRegion(ctx, nil, nil)
if err != nil {
return err
}
exampleVpcIpam, err := ec2.NewVpcIpam(ctx, "exampleVpcIpam", &ec2.VpcIpamArgs{
OperatingRegions: ec2.VpcIpamOperatingRegionArray{
&ec2.VpcIpamOperatingRegionArgs{
RegionName: *pulumi.String(current.Name),
},
},
})
if err != nil {
return err
}
exampleVpcIpamPool, err := ec2.NewVpcIpamPool(ctx, "exampleVpcIpamPool", &ec2.VpcIpamPoolArgs{
AddressFamily: pulumi.String("ipv4"),
IpamScopeId: exampleVpcIpam.PrivateDefaultScopeId,
Locale: *pulumi.String(current.Name),
})
if err != nil {
return err
}
_, err = ec2.NewVpcIpamPoolCidr(ctx, "exampleVpcIpamPoolCidr", &ec2.VpcIpamPoolCidrArgs{
IpamPoolId: exampleVpcIpamPool.ID(),
Cidr: pulumi.String("172.20.0.0/16"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.ec2.VpcIpam;
import com.pulumi.aws.ec2.VpcIpamArgs;
import com.pulumi.aws.ec2.inputs.VpcIpamOperatingRegionArgs;
import com.pulumi.aws.ec2.VpcIpamPool;
import com.pulumi.aws.ec2.VpcIpamPoolArgs;
import com.pulumi.aws.ec2.VpcIpamPoolCidr;
import com.pulumi.aws.ec2.VpcIpamPoolCidrArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var current = AwsFunctions.getRegion();
var exampleVpcIpam = new VpcIpam("exampleVpcIpam", VpcIpamArgs.builder()
.operatingRegions(VpcIpamOperatingRegionArgs.builder()
.regionName(current.applyValue(getRegionResult -> getRegionResult.name()))
.build())
.build());
var exampleVpcIpamPool = new VpcIpamPool("exampleVpcIpamPool", VpcIpamPoolArgs.builder()
.addressFamily("ipv4")
.ipamScopeId(exampleVpcIpam.privateDefaultScopeId())
.locale(current.applyValue(getRegionResult -> getRegionResult.name()))
.build());
var exampleVpcIpamPoolCidr = new VpcIpamPoolCidr("exampleVpcIpamPoolCidr", VpcIpamPoolCidrArgs.builder()
.ipamPoolId(exampleVpcIpamPool.id())
.cidr("172.20.0.0/16")
.build());
}
}
import pulumi
import pulumi_aws as aws
current = aws.get_region()
example_vpc_ipam = aws.ec2.VpcIpam("exampleVpcIpam", operating_regions=[aws.ec2.VpcIpamOperatingRegionArgs(
region_name=current.name,
)])
example_vpc_ipam_pool = aws.ec2.VpcIpamPool("exampleVpcIpamPool",
address_family="ipv4",
ipam_scope_id=example_vpc_ipam.private_default_scope_id,
locale=current.name)
example_vpc_ipam_pool_cidr = aws.ec2.VpcIpamPoolCidr("exampleVpcIpamPoolCidr",
ipam_pool_id=example_vpc_ipam_pool.id,
cidr="172.20.0.0/16")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.getRegion({});
const exampleVpcIpam = new aws.ec2.VpcIpam("exampleVpcIpam", {operatingRegions: [{
regionName: current.then(current => current.name),
}]});
const exampleVpcIpamPool = new aws.ec2.VpcIpamPool("exampleVpcIpamPool", {
addressFamily: "ipv4",
ipamScopeId: exampleVpcIpam.privateDefaultScopeId,
locale: current.then(current => current.name),
});
const exampleVpcIpamPoolCidr = new aws.ec2.VpcIpamPoolCidr("exampleVpcIpamPoolCidr", {
ipamPoolId: exampleVpcIpamPool.id,
cidr: "172.20.0.0/16",
});
resources:
exampleVpcIpam:
type: aws:ec2:VpcIpam
properties:
operatingRegions:
- regionName: ${current.name}
exampleVpcIpamPool:
type: aws:ec2:VpcIpamPool
properties:
addressFamily: ipv4
ipamScopeId: ${exampleVpcIpam.privateDefaultScopeId}
locale: ${current.name}
exampleVpcIpamPoolCidr:
type: aws:ec2:VpcIpamPoolCidr
properties:
ipamPoolId: ${exampleVpcIpamPool.id}
cidr: 172.20.0.0/16
variables:
current:
fn::invoke:
Function: aws:getRegion
Arguments: {}
Provision Public IPv6 Pool CIDRs
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetRegionArgs;
import com.pulumi.aws.ec2.VpcIpam;
import com.pulumi.aws.ec2.VpcIpamArgs;
import com.pulumi.aws.ec2.inputs.VpcIpamOperatingRegionArgs;
import com.pulumi.aws.ec2.VpcIpamPool;
import com.pulumi.aws.ec2.VpcIpamPoolArgs;
import com.pulumi.aws.ec2.VpcIpamPoolCidr;
import com.pulumi.aws.ec2.VpcIpamPoolCidrArgs;
import com.pulumi.aws.ec2.inputs.VpcIpamPoolCidrCidrAuthorizationContextArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var current = AwsFunctions.getRegion();
var example = new VpcIpam("example", VpcIpamArgs.builder()
.operatingRegions(VpcIpamOperatingRegionArgs.builder()
.regionName(current.applyValue(getRegionResult -> getRegionResult.name()))
.build())
.build());
var ipv6TestPublicVpcIpamPool = new VpcIpamPool("ipv6TestPublicVpcIpamPool", VpcIpamPoolArgs.builder()
.addressFamily("ipv6")
.ipamScopeId(example.publicDefaultScopeId())
.locale("us-east-1")
.description("public ipv6")
.advertisable(false)
.awsService("ec2")
.build());
var ipv6TestPublicVpcIpamPoolCidr = new VpcIpamPoolCidr("ipv6TestPublicVpcIpamPoolCidr", VpcIpamPoolCidrArgs.builder()
.ipamPoolId(ipv6TestPublicVpcIpamPool.id())
.cidr(var_.ipv6_cidr())
.cidrAuthorizationContext(VpcIpamPoolCidrCidrAuthorizationContextArgs.builder()
.message(var_.message())
.signature(var_.signature())
.build())
.build());
}
}
Coming soon!
Coming soon!
resources:
example:
type: aws:ec2:VpcIpam
properties:
operatingRegions:
- regionName: ${current.name}
ipv6TestPublicVpcIpamPool:
type: aws:ec2:VpcIpamPool
properties:
addressFamily: ipv6
ipamScopeId: ${example.publicDefaultScopeId}
locale: us-east-1
description: public ipv6
advertisable: false
awsService: ec2
ipv6TestPublicVpcIpamPoolCidr:
type: aws:ec2:VpcIpamPoolCidr
properties:
ipamPoolId: ${ipv6TestPublicVpcIpamPool.id}
cidr: ${var.ipv6_cidr}
cidrAuthorizationContext:
message: ${var.message}
signature: ${var.signature}
variables:
current:
fn::invoke:
Function: aws:getRegion
Arguments: {}
Create VpcIpamPoolCidr Resource
new VpcIpamPoolCidr(name: string, args: VpcIpamPoolCidrArgs, opts?: CustomResourceOptions);
@overload
def VpcIpamPoolCidr(resource_name: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
cidr_authorization_context: Optional[VpcIpamPoolCidrCidrAuthorizationContextArgs] = None,
ipam_pool_id: Optional[str] = None,
netmask_length: Optional[int] = None)
@overload
def VpcIpamPoolCidr(resource_name: str,
args: VpcIpamPoolCidrArgs,
opts: Optional[ResourceOptions] = None)
func NewVpcIpamPoolCidr(ctx *Context, name string, args VpcIpamPoolCidrArgs, opts ...ResourceOption) (*VpcIpamPoolCidr, error)
public VpcIpamPoolCidr(string name, VpcIpamPoolCidrArgs args, CustomResourceOptions? opts = null)
public VpcIpamPoolCidr(String name, VpcIpamPoolCidrArgs args)
public VpcIpamPoolCidr(String name, VpcIpamPoolCidrArgs args, CustomResourceOptions options)
type: aws:ec2:VpcIpamPoolCidr
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcIpamPoolCidrArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VpcIpamPoolCidrArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VpcIpamPoolCidrArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcIpamPoolCidrArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcIpamPoolCidrArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcIpamPoolCidr Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The VpcIpamPoolCidr resource accepts the following input properties:
- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Cidr string
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context 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 cidr_authorization_context for more information.
- Netmask
Length int If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Cidr string
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context Args 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 cidr_authorization_context for more information.
- Netmask
Length int If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- cidr String
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context 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 cidr_authorization_context for more information.
- netmask
Length Integer If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- cidr string
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context 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 cidr_authorization_context for more information.
- netmask
Length number If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- ipam_
pool_ strid The ID of the pool to which you want to assign a CIDR.
- cidr str
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context Args 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 cidr_authorization_context for more information.
- netmask_
length int If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- cidr String
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Property Map
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 cidr_authorization_context for more information.
- netmask
Length Number If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcIpamPoolCidr resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Ipam
Pool stringCidr Id 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.
- Id string
The provider-assigned unique ID for this managed resource.
- Ipam
Pool stringCidr Id 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.
- id String
The provider-assigned unique ID for this managed resource.
- ipam
Pool StringCidr Id 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.
- id string
The provider-assigned unique ID for this managed resource.
- ipam
Pool stringCidr Id 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.
- id str
The provider-assigned unique ID for this managed resource.
- ipam_
pool_ strcidr_ id 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.
- id String
The provider-assigned unique ID for this managed resource.
- ipam
Pool StringCidr Id 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.
Look up Existing VpcIpamPoolCidr Resource
Get an existing VpcIpamPoolCidr resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VpcIpamPoolCidrState, opts?: CustomResourceOptions): VpcIpamPoolCidr
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
cidr_authorization_context: Optional[VpcIpamPoolCidrCidrAuthorizationContextArgs] = None,
ipam_pool_cidr_id: Optional[str] = None,
ipam_pool_id: Optional[str] = None,
netmask_length: Optional[int] = None) -> VpcIpamPoolCidr
func GetVpcIpamPoolCidr(ctx *Context, name string, id IDInput, state *VpcIpamPoolCidrState, opts ...ResourceOption) (*VpcIpamPoolCidr, error)
public static VpcIpamPoolCidr Get(string name, Input<string> id, VpcIpamPoolCidrState? state, CustomResourceOptions? opts = null)
public static VpcIpamPoolCidr get(String name, Output<String> id, VpcIpamPoolCidrState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Cidr string
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context 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 cidr_authorization_context for more information.
- Ipam
Pool stringCidr Id 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.- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Netmask
Length int If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- Cidr string
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context Args 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 cidr_authorization_context for more information.
- Ipam
Pool stringCidr Id 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.- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Netmask
Length int If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- cidr String
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context 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 cidr_authorization_context for more information.
- ipam
Pool StringCidr Id 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.- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- netmask
Length Integer If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- cidr string
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context 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 cidr_authorization_context for more information.
- ipam
Pool stringCidr Id 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.- ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- netmask
Length number If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- cidr str
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Vpc
Ipam Pool Cidr Cidr Authorization Context Args 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 cidr_authorization_context for more information.
- ipam_
pool_ strcidr_ id 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.- ipam_
pool_ strid The ID of the pool to which you want to assign a CIDR.
- netmask_
length int If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
- cidr String
The CIDR you want to assign to the pool. Conflicts with
netmask_length
.- Property Map
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 cidr_authorization_context for more information.
- ipam
Pool StringCidr Id 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.- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- netmask
Length Number If provided, the cidr provisioned into the specified pool will be the next available cidr given this declared netmask length. Conflicts with
cidr
.
Supporting Types
VpcIpamPoolCidrCidrAuthorizationContext, VpcIpamPoolCidrCidrAuthorizationContextArgs
Import
terraform import {
to = aws_vpc_ipam_pool_cidr.example
id = “172.20.0.0/24_ipam-pool-0e634f5a1517cccdc” } Using pulumi import
, import IPAMs using the <cidr>_<ipam-pool-id>
. For exampleconsole % TODO import aws_vpc_ipam_pool_cidr.example 172.20.0.0/24_ipam-pool-0e634f5a1517cccdc
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.