AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getIpamPreviewNextCidr

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var testIpamPreviewNextCidr = Output.Create(Aws.Ec2.GetIpamPreviewNextCidr.InvokeAsync(new Aws.Ec2.GetIpamPreviewNextCidrArgs
        {
            IpamPoolId = aws_vpc_ipam_pool.Test.Id,
            NetmaskLength = 28,
        }));
        var testVpcIpamPoolCidrAllocation = new Aws.Ec2.VpcIpamPoolCidrAllocation("testVpcIpamPoolCidrAllocation", new Aws.Ec2.VpcIpamPoolCidrAllocationArgs
        {
            IpamPoolId = aws_vpc_ipam_pool.Test.Id,
            Cidr = testIpamPreviewNextCidr.Apply(testIpamPreviewNextCidr => testIpamPreviewNextCidr.Cidr),
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testIpamPreviewNextCidr, err := ec2.GetIpamPreviewNextCidr(ctx, &ec2.GetIpamPreviewNextCidrArgs{
			IpamPoolId:    aws_vpc_ipam_pool.Test.Id,
			NetmaskLength: pulumi.IntRef(28),
		}, nil)
		if err != nil {
			return err
		}
		_, err = ec2.NewVpcIpamPoolCidrAllocation(ctx, "testVpcIpamPoolCidrAllocation", &ec2.VpcIpamPoolCidrAllocationArgs{
			IpamPoolId: pulumi.Any(aws_vpc_ipam_pool.Test.Id),
			Cidr:       pulumi.String(testIpamPreviewNextCidr.Cidr),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testIpamPreviewNextCidr = Output.of(Ec2Functions.getIpamPreviewNextCidr(GetIpamPreviewNextCidrArgs.builder()
            .ipamPoolId(aws_vpc_ipam_pool.getTest().getId())
            .netmaskLength(28)
            .build()));

        var testVpcIpamPoolCidrAllocation = new VpcIpamPoolCidrAllocation("testVpcIpamPoolCidrAllocation", VpcIpamPoolCidrAllocationArgs.builder()        
            .ipamPoolId(aws_vpc_ipam_pool.getTest().getId())
            .cidr(testIpamPreviewNextCidr.apply(getIpamPreviewNextCidrResult -> getIpamPreviewNextCidrResult.getCidr()))
            .build());

        }
}
import pulumi
import pulumi_aws as aws

test_ipam_preview_next_cidr = aws.ec2.get_ipam_preview_next_cidr(ipam_pool_id=aws_vpc_ipam_pool["test"]["id"],
    netmask_length=28)
test_vpc_ipam_pool_cidr_allocation = aws.ec2.VpcIpamPoolCidrAllocation("testVpcIpamPoolCidrAllocation",
    ipam_pool_id=aws_vpc_ipam_pool["test"]["id"],
    cidr=test_ipam_preview_next_cidr.cidr)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const testIpamPreviewNextCidr = aws.ec2.getIpamPreviewNextCidr({
    ipamPoolId: aws_vpc_ipam_pool.test.id,
    netmaskLength: 28,
});
const testVpcIpamPoolCidrAllocation = new aws.ec2.VpcIpamPoolCidrAllocation("testVpcIpamPoolCidrAllocation", {
    ipamPoolId: aws_vpc_ipam_pool.test.id,
    cidr: testIpamPreviewNextCidr.then(testIpamPreviewNextCidr => testIpamPreviewNextCidr.cidr),
});
resources:
  testVpcIpamPoolCidrAllocation:
    type: aws:ec2:VpcIpamPoolCidrAllocation
    properties:
      ipamPoolId: ${aws_vpc_ipam_pool.test.id}
      cidr: ${testIpamPreviewNextCidr.cidr}
variables:
  testIpamPreviewNextCidr:
    Fn::Invoke:
      Function: aws:ec2:getIpamPreviewNextCidr
      Arguments:
        ipamPoolId: ${aws_vpc_ipam_pool.test.id}
        netmaskLength: 28

Using getIpamPreviewNextCidr

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getIpamPreviewNextCidr(args: GetIpamPreviewNextCidrArgs, opts?: InvokeOptions): Promise<GetIpamPreviewNextCidrResult>
function getIpamPreviewNextCidrOutput(args: GetIpamPreviewNextCidrOutputArgs, opts?: InvokeOptions): Output<GetIpamPreviewNextCidrResult>
def get_ipam_preview_next_cidr(disallowed_cidrs: Optional[Sequence[str]] = None,
                               ipam_pool_id: Optional[str] = None,
                               netmask_length: Optional[int] = None,
                               opts: Optional[InvokeOptions] = None) -> GetIpamPreviewNextCidrResult
def get_ipam_preview_next_cidr_output(disallowed_cidrs: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                               ipam_pool_id: Optional[pulumi.Input[str]] = None,
                               netmask_length: Optional[pulumi.Input[int]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetIpamPreviewNextCidrResult]
func GetIpamPreviewNextCidr(ctx *Context, args *GetIpamPreviewNextCidrArgs, opts ...InvokeOption) (*GetIpamPreviewNextCidrResult, error)
func GetIpamPreviewNextCidrOutput(ctx *Context, args *GetIpamPreviewNextCidrOutputArgs, opts ...InvokeOption) GetIpamPreviewNextCidrResultOutput

> Note: This function is named GetIpamPreviewNextCidr in the Go SDK.

public static class GetIpamPreviewNextCidr 
{
    public static Task<GetIpamPreviewNextCidrResult> InvokeAsync(GetIpamPreviewNextCidrArgs args, InvokeOptions? opts = null)
    public static Output<GetIpamPreviewNextCidrResult> Invoke(GetIpamPreviewNextCidrInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetIpamPreviewNextCidrResult> getIpamPreviewNextCidr(GetIpamPreviewNextCidrArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:ec2/getIpamPreviewNextCidr:getIpamPreviewNextCidr
  Arguments:
    # Arguments dictionary

The following arguments are supported:

IpamPoolId string

The ID of the pool to which you want to assign a CIDR.

DisallowedCidrs List<string>

Exclude a particular CIDR range from being returned by the pool.

NetmaskLength int

The netmask length of the CIDR you would like to preview from the IPAM pool.

IpamPoolId string

The ID of the pool to which you want to assign a CIDR.

DisallowedCidrs []string

Exclude a particular CIDR range from being returned by the pool.

NetmaskLength int

The netmask length of the CIDR you would like to preview from the IPAM pool.

ipamPoolId String

The ID of the pool to which you want to assign a CIDR.

disallowedCidrs List

Exclude a particular CIDR range from being returned by the pool.

netmaskLength Integer

The netmask length of the CIDR you would like to preview from the IPAM pool.

ipamPoolId string

The ID of the pool to which you want to assign a CIDR.

disallowedCidrs string[]

Exclude a particular CIDR range from being returned by the pool.

netmaskLength number

The netmask length of the CIDR you would like to preview from the IPAM pool.

ipam_pool_id str

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.

ipamPoolId String

The ID of the pool to which you want to assign a CIDR.

disallowedCidrs List

Exclude a particular CIDR range from being returned by the pool.

netmaskLength Number

The netmask length of the CIDR you would like to preview from the IPAM pool.

getIpamPreviewNextCidr Result

The following output properties are available:

Cidr string

The previewed CIDR from the pool.

Id string

The provider-assigned unique ID for this managed resource.

IpamPoolId string
DisallowedCidrs List<string>
NetmaskLength int
Cidr string

The previewed CIDR from the pool.

Id string

The provider-assigned unique ID for this managed resource.

IpamPoolId string
DisallowedCidrs []string
NetmaskLength int
cidr String

The previewed CIDR from the pool.

id String

The provider-assigned unique ID for this managed resource.

ipamPoolId String
disallowedCidrs List
netmaskLength Integer
cidr string

The previewed CIDR from the pool.

id string

The provider-assigned unique ID for this managed resource.

ipamPoolId string
disallowedCidrs string[]
netmaskLength number
cidr str

The previewed CIDR from the pool.

id str

The provider-assigned unique ID for this managed resource.

ipam_pool_id str
disallowed_cidrs Sequence[str]
netmask_length int
cidr String

The previewed CIDR from the pool.

id String

The provider-assigned unique ID for this managed resource.

ipamPoolId String
disallowedCidrs List
netmaskLength Number

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.