Try AWS Native preview for resources not in the classic version.
aws.ec2.VpcIpamPreviewNextCidr
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Previews a CIDR from an IPAM address pool. Only works for private IPv4.
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",
});
var exampleVpcIpamPreviewNextCidr = new Aws.Ec2.VpcIpamPreviewNextCidr("exampleVpcIpamPreviewNextCidr", new()
{
IpamPoolId = exampleVpcIpamPool.Id,
NetmaskLength = 28,
DisallowedCidrs = new[]
{
"172.2.0.0/32",
},
}, new CustomResourceOptions
{
DependsOn = new[]
{
exampleVpcIpamPoolCidr,
},
});
});
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
}
exampleVpcIpamPoolCidr, err := ec2.NewVpcIpamPoolCidr(ctx, "exampleVpcIpamPoolCidr", &ec2.VpcIpamPoolCidrArgs{
IpamPoolId: exampleVpcIpamPool.ID(),
Cidr: pulumi.String("172.20.0.0/16"),
})
if err != nil {
return err
}
_, err = ec2.NewVpcIpamPreviewNextCidr(ctx, "exampleVpcIpamPreviewNextCidr", &ec2.VpcIpamPreviewNextCidrArgs{
IpamPoolId: exampleVpcIpamPool.ID(),
NetmaskLength: pulumi.Int(28),
DisallowedCidrs: pulumi.StringArray{
pulumi.String("172.2.0.0/32"),
},
}, pulumi.DependsOn([]pulumi.Resource{
exampleVpcIpamPoolCidr,
}))
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 com.pulumi.aws.ec2.VpcIpamPreviewNextCidr;
import com.pulumi.aws.ec2.VpcIpamPreviewNextCidrArgs;
import com.pulumi.resources.CustomResourceOptions;
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());
var exampleVpcIpamPreviewNextCidr = new VpcIpamPreviewNextCidr("exampleVpcIpamPreviewNextCidr", VpcIpamPreviewNextCidrArgs.builder()
.ipamPoolId(exampleVpcIpamPool.id())
.netmaskLength(28)
.disallowedCidrs("172.2.0.0/32")
.build(), CustomResourceOptions.builder()
.dependsOn(exampleVpcIpamPoolCidr)
.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")
example_vpc_ipam_preview_next_cidr = aws.ec2.VpcIpamPreviewNextCidr("exampleVpcIpamPreviewNextCidr",
ipam_pool_id=example_vpc_ipam_pool.id,
netmask_length=28,
disallowed_cidrs=["172.2.0.0/32"],
opts=pulumi.ResourceOptions(depends_on=[example_vpc_ipam_pool_cidr]))
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",
});
const exampleVpcIpamPreviewNextCidr = new aws.ec2.VpcIpamPreviewNextCidr("exampleVpcIpamPreviewNextCidr", {
ipamPoolId: exampleVpcIpamPool.id,
netmaskLength: 28,
disallowedCidrs: ["172.2.0.0/32"],
}, {
dependsOn: [exampleVpcIpamPoolCidr],
});
resources:
exampleVpcIpamPreviewNextCidr:
type: aws:ec2:VpcIpamPreviewNextCidr
properties:
ipamPoolId: ${exampleVpcIpamPool.id}
netmaskLength: 28
disallowedCidrs:
- 172.2.0.0/32
options:
dependson:
- ${exampleVpcIpamPoolCidr}
exampleVpcIpamPoolCidr:
type: aws:ec2:VpcIpamPoolCidr
properties:
ipamPoolId: ${exampleVpcIpamPool.id}
cidr: 172.20.0.0/16
exampleVpcIpamPool:
type: aws:ec2:VpcIpamPool
properties:
addressFamily: ipv4
ipamScopeId: ${exampleVpcIpam.privateDefaultScopeId}
locale: ${current.name}
exampleVpcIpam:
type: aws:ec2:VpcIpam
properties:
operatingRegions:
- regionName: ${current.name}
variables:
current:
fn::invoke:
Function: aws:getRegion
Arguments: {}
Create VpcIpamPreviewNextCidr Resource
new VpcIpamPreviewNextCidr(name: string, args: VpcIpamPreviewNextCidrArgs, opts?: CustomResourceOptions);
@overload
def VpcIpamPreviewNextCidr(resource_name: str,
opts: Optional[ResourceOptions] = None,
disallowed_cidrs: Optional[Sequence[str]] = None,
ipam_pool_id: Optional[str] = None,
netmask_length: Optional[int] = None)
@overload
def VpcIpamPreviewNextCidr(resource_name: str,
args: VpcIpamPreviewNextCidrArgs,
opts: Optional[ResourceOptions] = None)
func NewVpcIpamPreviewNextCidr(ctx *Context, name string, args VpcIpamPreviewNextCidrArgs, opts ...ResourceOption) (*VpcIpamPreviewNextCidr, error)
public VpcIpamPreviewNextCidr(string name, VpcIpamPreviewNextCidrArgs args, CustomResourceOptions? opts = null)
public VpcIpamPreviewNextCidr(String name, VpcIpamPreviewNextCidrArgs args)
public VpcIpamPreviewNextCidr(String name, VpcIpamPreviewNextCidrArgs args, CustomResourceOptions options)
type: aws:ec2:VpcIpamPreviewNextCidr
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcIpamPreviewNextCidrArgs
- 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 VpcIpamPreviewNextCidrArgs
- 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 VpcIpamPreviewNextCidrArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcIpamPreviewNextCidrArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcIpamPreviewNextCidrArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcIpamPreviewNextCidr 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 VpcIpamPreviewNextCidr resource accepts the following input properties:
- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Disallowed
Cidrs List<string> Exclude a particular CIDR range from being returned by the pool.
- Netmask
Length int The netmask length of the CIDR you would like to preview from the IPAM pool.
- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Disallowed
Cidrs []string Exclude a particular CIDR range from being returned by the pool.
- Netmask
Length int The netmask length of the CIDR you would like to preview from the IPAM pool.
- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- disallowed
Cidrs List<String> Exclude a particular CIDR range from being returned by the pool.
- netmask
Length Integer The netmask length of the CIDR you would like to preview from the IPAM pool.
- ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- disallowed
Cidrs string[] Exclude a particular CIDR range from being returned by the pool.
- netmask
Length number The netmask length of the CIDR you would like to preview from the IPAM pool.
- ipam_
pool_ strid The ID of the pool to which you want to assign a CIDR.
- disallowed_
cidrs Sequence[str] Exclude a particular CIDR range from being returned by the pool.
- netmask_
length int The netmask length of the CIDR you would like to preview from the IPAM pool.
- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- disallowed
Cidrs List<String> Exclude a particular CIDR range from being returned by the pool.
- netmask
Length Number The netmask length of the CIDR you would like to preview from the IPAM pool.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcIpamPreviewNextCidr resource produces the following output properties:
Look up Existing VpcIpamPreviewNextCidr Resource
Get an existing VpcIpamPreviewNextCidr 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?: VpcIpamPreviewNextCidrState, opts?: CustomResourceOptions): VpcIpamPreviewNextCidr
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cidr: Optional[str] = None,
disallowed_cidrs: Optional[Sequence[str]] = None,
ipam_pool_id: Optional[str] = None,
netmask_length: Optional[int] = None) -> VpcIpamPreviewNextCidr
func GetVpcIpamPreviewNextCidr(ctx *Context, name string, id IDInput, state *VpcIpamPreviewNextCidrState, opts ...ResourceOption) (*VpcIpamPreviewNextCidr, error)
public static VpcIpamPreviewNextCidr Get(string name, Input<string> id, VpcIpamPreviewNextCidrState? state, CustomResourceOptions? opts = null)
public static VpcIpamPreviewNextCidr get(String name, Output<String> id, VpcIpamPreviewNextCidrState 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 previewed CIDR from the pool.
- Disallowed
Cidrs List<string> Exclude a particular CIDR range from being returned by the pool.
- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Netmask
Length int The netmask length of the CIDR you would like to preview from the IPAM pool.
- Cidr string
The previewed CIDR from the pool.
- Disallowed
Cidrs []string Exclude a particular CIDR range from being returned by the pool.
- Ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- Netmask
Length int The netmask length of the CIDR you would like to preview from the IPAM pool.
- cidr String
The previewed CIDR from the pool.
- disallowed
Cidrs List<String> Exclude a particular CIDR range from being returned by the pool.
- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- netmask
Length Integer The netmask length of the CIDR you would like to preview from the IPAM pool.
- cidr string
The previewed CIDR from the pool.
- disallowed
Cidrs string[] Exclude a particular CIDR range from being returned by the pool.
- ipam
Pool stringId The ID of the pool to which you want to assign a CIDR.
- netmask
Length number The netmask length of the CIDR you would like to preview from the IPAM pool.
- cidr str
The previewed CIDR from the pool.
- disallowed_
cidrs Sequence[str] Exclude a particular CIDR range from being returned by the pool.
- ipam_
pool_ strid The ID of the pool to which you want to assign a CIDR.
- netmask_
length int The netmask length of the CIDR you would like to preview from the IPAM pool.
- cidr String
The previewed CIDR from the pool.
- disallowed
Cidrs List<String> Exclude a particular CIDR range from being returned by the pool.
- ipam
Pool StringId The ID of the pool to which you want to assign a CIDR.
- netmask
Length Number The netmask length of the CIDR you would like to preview from the IPAM pool.
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.