VpcIpv4CidrBlockAssociation

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var main = new Aws.Ec2.Vpc("main", new Aws.Ec2.VpcArgs
        {
            CidrBlock = "10.0.0.0/16",
        });
        var secondaryCidr = new Aws.Ec2.VpcIpv4CidrBlockAssociation("secondaryCidr", new Aws.Ec2.VpcIpv4CidrBlockAssociationArgs
        {
            VpcId = main.Id,
            CidrBlock = "172.2.0.0/16",
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
			CidrBlock: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		_, err = ec2.NewVpcIpv4CidrBlockAssociation(ctx, "secondaryCidr", &ec2.VpcIpv4CidrBlockAssociationArgs{
			VpcId:     main.ID(),
			CidrBlock: pulumi.String("172.2.0.0/16"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")
secondary_cidr = aws.ec2.VpcIpv4CidrBlockAssociation("secondaryCidr",
    vpc_id=main.id,
    cidr_block="172.2.0.0/16")
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("secondaryCidr", {
    vpcId: main.id,
    cidrBlock: "172.2.0.0/16",
});

Create a VpcIpv4CidrBlockAssociation Resource

new VpcIpv4CidrBlockAssociation(name: string, args: VpcIpv4CidrBlockAssociationArgs, opts?: CustomResourceOptions);
@overload
def VpcIpv4CidrBlockAssociation(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                cidr_block: Optional[str] = None,
                                vpc_id: Optional[str] = None)
@overload
def VpcIpv4CidrBlockAssociation(resource_name: str,
                                args: VpcIpv4CidrBlockAssociationArgs,
                                opts: Optional[ResourceOptions] = None)
func NewVpcIpv4CidrBlockAssociation(ctx *Context, name string, args VpcIpv4CidrBlockAssociationArgs, opts ...ResourceOption) (*VpcIpv4CidrBlockAssociation, error)
public VpcIpv4CidrBlockAssociation(string name, VpcIpv4CidrBlockAssociationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VpcIpv4CidrBlockAssociationArgs
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 VpcIpv4CidrBlockAssociationArgs
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 VpcIpv4CidrBlockAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VpcIpv4CidrBlockAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VpcIpv4CidrBlockAssociation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The VpcIpv4CidrBlockAssociation resource accepts the following input properties:

CidrBlock string
The additional IPv4 CIDR block to associate with the VPC.
VpcId string
The ID of the VPC to make the association with.
CidrBlock string
The additional IPv4 CIDR block to associate with the VPC.
VpcId string
The ID of the VPC to make the association with.
cidrBlock string
The additional IPv4 CIDR block to associate with the VPC.
vpcId string
The ID of the VPC to make the association with.
cidr_block str
The additional IPv4 CIDR block to associate with the VPC.
vpc_id str
The ID of the VPC to make the association with.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpcIpv4CidrBlockAssociation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VpcIpv4CidrBlockAssociation Resource

Get an existing VpcIpv4CidrBlockAssociation 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?: VpcIpv4CidrBlockAssociationState, opts?: CustomResourceOptions): VpcIpv4CidrBlockAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cidr_block: Optional[str] = None,
        vpc_id: Optional[str] = None) -> VpcIpv4CidrBlockAssociation
func GetVpcIpv4CidrBlockAssociation(ctx *Context, name string, id IDInput, state *VpcIpv4CidrBlockAssociationState, opts ...ResourceOption) (*VpcIpv4CidrBlockAssociation, error)
public static VpcIpv4CidrBlockAssociation Get(string name, Input<string> id, VpcIpv4CidrBlockAssociationState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

CidrBlock string
The additional IPv4 CIDR block to associate with the VPC.
VpcId string
The ID of the VPC to make the association with.
CidrBlock string
The additional IPv4 CIDR block to associate with the VPC.
VpcId string
The ID of the VPC to make the association with.
cidrBlock string
The additional IPv4 CIDR block to associate with the VPC.
vpcId string
The ID of the VPC to make the association with.
cidr_block str
The additional IPv4 CIDR block to associate with the VPC.
vpc_id str
The ID of the VPC to make the association with.

Import

aws_vpc_ipv4_cidr_block_association can be imported by using the VPC CIDR Association ID, e.g.

 $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-xxxxxxxx

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.