Class VpcIpv4CidrBlockAssociation


  • public class VpcIpv4CidrBlockAssociation
    extends com.pulumi.resources.CustomResource
    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
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.Vpc;
     import com.pulumi.aws.ec2.VpcArgs;
     import com.pulumi.aws.ec2.VpcIpv4CidrBlockAssociation;
     import com.pulumi.aws.ec2.VpcIpv4CidrBlockAssociationArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     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) {
             var main = new Vpc("main", VpcArgs.builder()
                 .cidrBlock("10.0.0.0/16")
                 .build());
     
             var secondaryCidr = new VpcIpv4CidrBlockAssociation("secondaryCidr", VpcIpv4CidrBlockAssociationArgs.builder()
                 .vpcId(main.id())
                 .cidrBlock("172.20.0.0/16")
                 .build());
     
         }
     }
     
     
    ## Import or or Using `pulumi import`, import `aws.ec2.VpcIpv4CidrBlockAssociation` using the VPC CIDR association ID and optionally the IPv4 IPAM pool ID and netmask length. For example: ```sh $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-021e8461d70ed08be ``` or ```sh $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-021e8461d70ed08be,ipam-pool-0a07c432810393463 ``` or ```sh $ pulumi import aws:ec2/vpcIpv4CidrBlockAssociation:VpcIpv4CidrBlockAssociation example vpc-cidr-assoc-021e8461d70ed08be,ipam-pool-0a07c432810393463,28 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> cidrBlock()  
      static VpcIpv4CidrBlockAssociation get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, VpcIpv4CidrBlockAssociationState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> ipv4IpamPoolId()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> ipv4NetmaskLength()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> vpcId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VpcIpv4CidrBlockAssociation

        public VpcIpv4CidrBlockAssociation​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • VpcIpv4CidrBlockAssociation

        public VpcIpv4CidrBlockAssociation​(java.lang.String name,
                                           VpcIpv4CidrBlockAssociationArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • VpcIpv4CidrBlockAssociation

        public VpcIpv4CidrBlockAssociation​(java.lang.String name,
                                           VpcIpv4CidrBlockAssociationArgs args,
                                           @Nullable
                                           com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • cidrBlock

        public com.pulumi.core.Output<java.lang.String> cidrBlock()
        Returns:
        IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4NetmaskLength`.
      • ipv4IpamPoolId

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> ipv4IpamPoolId()
        Returns:
        ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR. IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts. Using IPAM you can monitor IP address usage throughout your AWS Organization.
      • ipv4NetmaskLength

        public com.pulumi.core.Output<java.util.Optional<java.lang.Integer>> ipv4NetmaskLength()
        Returns:
        Netmask length of the IPv4 CIDR you want to allocate to this VPC. Requires specifying a `ipv4IpamPoolId`.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • vpcId

        public com.pulumi.core.Output<java.lang.String> vpcId()
        Returns:
        ID of the VPC to make the association with.
      • get

        public static VpcIpv4CidrBlockAssociation get​(java.lang.String name,
                                                      com.pulumi.core.Output<java.lang.String> id,
                                                      @Nullable
                                                      VpcIpv4CidrBlockAssociationState state,
                                                      @Nullable
                                                      com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.