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
{
CidrBlock = "172.2.0.0/16",
VpcId = main.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/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{
CidrBlock: pulumi.String("172.2.0.0/16"),
VpcId: main.ID(),
})
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",
cidr_block="172.2.0.0/16",
vpc_id=main.id)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("secondary_cidr", {
cidrBlock: "172.2.0.0/16",
vpcId: main.id,
});Create a VpcIpv4CidrBlockAssociation Resource
new VpcIpv4CidrBlockAssociation(name: string, args: VpcIpv4CidrBlockAssociationArgs, opts?: CustomResourceOptions);def VpcIpv4CidrBlockAssociation(resource_name, opts=None, cidr_block=None, vpc_id=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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:
- 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:
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): VpcIpv4CidrBlockAssociationstatic get(resource_name, id, opts=None, cidr_block=None, vpc_id=None, __props__=None);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:
- 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.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.