Class CfnVPC

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:00.782Z") @Stability(Stable) public class CfnVPC extends CfnResource implements IInspectable, ITaggable
Specifies a virtual private cloud (VPC).

To add an IPv6 CIDR block to the VPC, see AWS::EC2::VPCCidrBlock .

For more information, see Virtual private clouds (VPC) in the Amazon VPC User Guide .

Example:

 CfnInclude cfnTemplate;
 // using from*Attributes()
 CfnSubnet privateCfnSubnet1;
 CfnSubnet privateCfnSubnet2;
 // using from*Name()
 CfnBucket cfnBucket = (CfnBucket)cfnTemplate.getResource("Bucket");
 IBucket bucket = Bucket.fromBucketName(this, "L2Bucket", cfnBucket.getRef());
 // using from*Arn()
 CfnKey cfnKey = (CfnKey)cfnTemplate.getResource("Key");
 IKey key = Key.fromKeyArn(this, "L2Key", cfnKey.getAttrArn());
 CfnVPC cfnVpc = (CfnVPC)cfnTemplate.getResource("Vpc");
 IVpc vpc = Vpc.fromVpcAttributes(this, "L2Vpc", VpcAttributes.builder()
         .vpcId(cfnVpc.getRef())
         .availabilityZones(Fn.getAzs())
         .privateSubnetIds(List.of(privateCfnSubnet1.getRef(), privateCfnSubnet2.getRef()))
         .build());
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnVPC

      protected CfnVPC(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnVPC

      protected CfnVPC(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnVPC

      @Stability(Stable) public CfnVPC(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnVPCProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties.
    • CfnVPC

      @Stability(Stable) public CfnVPC(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrCidrBlock

      @Stability(Stable) @NotNull public String getAttrCidrBlock()
      The primary IPv4 CIDR block for the VPC.

      For example, 10.0.0.0/16.

    • getAttrCidrBlockAssociations

      @Stability(Stable) @NotNull public List<String> getAttrCidrBlockAssociations()
      The association IDs of the IPv4 CIDR blocks for the VPC.

      For example, [ vpc-cidr-assoc-0280ab6b ].

    • getAttrDefaultNetworkAcl

      @Stability(Stable) @NotNull public String getAttrDefaultNetworkAcl()
      The ID of the default network ACL for the VPC.

      For example, acl-814dafe3.

    • getAttrDefaultSecurityGroup

      @Stability(Stable) @NotNull public String getAttrDefaultSecurityGroup()
      The ID of the default security group for the VPC.

      For example, sg-b178e0d3.

    • getAttrIpv6CidrBlocks

      @Stability(Stable) @NotNull public List<String> getAttrIpv6CidrBlocks()
      The IPv6 CIDR blocks for the VPC.

      For example, [ 2001:db8:1234:1a00::/56 ].

    • getAttrVpcId

      @Stability(Stable) @NotNull public String getAttrVpcId()
      The ID of the VPC.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getCidrBlock

      @Stability(Stable) @Nullable public String getCidrBlock()
      The IPv4 network range for the VPC, in CIDR notation.
    • setCidrBlock

      @Stability(Stable) public void setCidrBlock(@Nullable String value)
      The IPv4 network range for the VPC, in CIDR notation.
    • getEnableDnsHostnames

      @Stability(Stable) @Nullable public Object getEnableDnsHostnames()
      Indicates whether the instances launched in the VPC get DNS hostnames.
    • setEnableDnsHostnames

      @Stability(Stable) public void setEnableDnsHostnames(@Nullable Boolean value)
      Indicates whether the instances launched in the VPC get DNS hostnames.
    • setEnableDnsHostnames

      @Stability(Stable) public void setEnableDnsHostnames(@Nullable IResolvable value)
      Indicates whether the instances launched in the VPC get DNS hostnames.
    • getEnableDnsSupport

      @Stability(Stable) @Nullable public Object getEnableDnsSupport()
      Indicates whether the DNS resolution is supported for the VPC.
    • setEnableDnsSupport

      @Stability(Stable) public void setEnableDnsSupport(@Nullable Boolean value)
      Indicates whether the DNS resolution is supported for the VPC.
    • setEnableDnsSupport

      @Stability(Stable) public void setEnableDnsSupport(@Nullable IResolvable value)
      Indicates whether the DNS resolution is supported for the VPC.
    • getInstanceTenancy

      @Stability(Stable) @Nullable public String getInstanceTenancy()
      The allowed tenancy of instances launched into the VPC.
    • setInstanceTenancy

      @Stability(Stable) public void setInstanceTenancy(@Nullable String value)
      The allowed tenancy of instances launched into the VPC.
    • getIpv4IpamPoolId

      @Stability(Stable) @Nullable public String getIpv4IpamPoolId()
      The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.
    • setIpv4IpamPoolId

      @Stability(Stable) public void setIpv4IpamPoolId(@Nullable String value)
      The ID of an IPv4 IPAM pool you want to use for allocating this VPC's CIDR.
    • getIpv4NetmaskLength

      @Stability(Stable) @Nullable public Number getIpv4NetmaskLength()
      The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool.
    • setIpv4NetmaskLength

      @Stability(Stable) public void setIpv4NetmaskLength(@Nullable Number value)
      The netmask length of the IPv4 CIDR you want to allocate to this VPC from an Amazon VPC IP Address Manager (IPAM) pool.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      The tags for the VPC.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      The tags for the VPC.