Interface VpcV2Attributes

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
VpcV2Attributes.Jsii$Proxy

@Generated(value="jsii-pacmak/1.106.0 (build e852934)", date="2025-02-12T12:32:13.389Z") @Stability(Experimental) public interface VpcV2Attributes extends software.amazon.jsii.JsiiSerializable
(experimental) Options to import a VPC created outside of CDK stack.

Example:

 Stack stack = new Stack();
 IVpcV2 acceptorVpc = VpcV2.fromVpcV2Attributes(this, "acceptorVpc", VpcV2Attributes.builder()
         .vpcId("vpc-XXXX")
         .vpcCidrBlock("10.0.0.0/16")
         .region("us-east-2")
         .ownerAccountId("111111111111")
         .build());
 String acceptorRoleArn = "arn:aws:iam::111111111111:role/VpcPeeringRole";
 VpcV2 requestorVpc = VpcV2.Builder.create(this, "VpcB")
         .primaryAddressBlock(IpAddresses.ipv4("10.1.0.0/16"))
         .build();
 VPCPeeringConnection peeringConnection = requestorVpc.createPeeringConnection("crossAccountCrossRegionPeering", VPCPeeringConnectionOptions.builder()
         .acceptorVpc(acceptorVpc)
         .peerRoleArn(acceptorRoleArn)
         .build());
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder for VpcV2Attributes
    static final class 
    An implementation for VpcV2Attributes
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default String
    (experimental) The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection.
    default String
    (experimental) Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection.
    (experimental) Import Secondary CIDR blocks associated with VPC.
    (experimental) Subnets associated with imported VPC.
    (experimental) Primary VPC CIDR Block of the imported VPC Can only be IPv4.
    (experimental) The VPC ID Refers to physical Id of the resource.
    default String
    (experimental) A VPN Gateway is attached to the VPC.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • getVpcCidrBlock

      @Stability(Experimental) @NotNull String getVpcCidrBlock()
      (experimental) Primary VPC CIDR Block of the imported VPC Can only be IPv4.
    • getVpcId

      @Stability(Experimental) @NotNull String getVpcId()
      (experimental) The VPC ID Refers to physical Id of the resource.
    • getOwnerAccountId

      @Stability(Experimental) @Nullable default String getOwnerAccountId()
      (experimental) The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection.

      Default: - constructed with stack account value

    • getRegion

      @Stability(Experimental) @Nullable default String getRegion()
      (experimental) Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection.

      Default: - constructed with stack region value

    • getSecondaryCidrBlocks

      @Stability(Experimental) @Nullable default List<VPCCidrBlockattributes> getSecondaryCidrBlocks()
      (experimental) Import Secondary CIDR blocks associated with VPC.

      Default: - No secondary IP address

    • getSubnets

      @Stability(Experimental) @Nullable default List<SubnetV2Attributes> getSubnets()
      (experimental) Subnets associated with imported VPC.

      Default: - no subnets provided to be imported

    • getVpnGatewayId

      @Stability(Experimental) @Nullable default String getVpnGatewayId()
      (experimental) A VPN Gateway is attached to the VPC.

      Default: - No VPN Gateway

    • builder

      @Stability(Experimental) static VpcV2Attributes.Builder builder()
      Returns:
      a VpcV2Attributes.Builder of VpcV2Attributes