Interface VPCPeeringConnectionOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
VPCPeeringConnectionProps
All Known Implementing Classes:
VPCPeeringConnectionOptions.Jsii$Proxy, VPCPeeringConnectionProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-22T02:24:11.446Z") @Stability(Experimental) public interface VPCPeeringConnectionOptions extends software.amazon.jsii.JsiiSerializable
(experimental) Options to define a VPC peering connection.

Example:

 Stack stack = new Stack();
 VpcV2 acceptorVpc = VpcV2.Builder.create(this, "VpcA")
         .primaryAddressBlock(IpAddresses.ipv4("10.0.0.0/16"))
         .build();
 VpcV2 requestorVpc = VpcV2.Builder.create(this, "VpcB")
         .primaryAddressBlock(IpAddresses.ipv4("10.1.0.0/16"))
         .build();
 VPCPeeringConnection peeringConnection = requestorVpc.createPeeringConnection("peeringConnection", VPCPeeringConnectionOptions.builder()
         .acceptorVpc(acceptorVpc)
         .build());
 RouteTable routeTable = RouteTable.Builder.create(this, "RouteTable")
         .vpc(requestorVpc)
         .build();
 routeTable.addRoute("vpcPeeringRoute", "10.0.0.0/16", Map.of("gateway", peeringConnection));
 
  • Method Details

    • getAcceptorVpc

      @Stability(Experimental) @NotNull IVpcV2 getAcceptorVpc()
      (experimental) The VPC that is accepting the peering connection.
    • getPeerRoleArn

      @Stability(Experimental) @Nullable default String getPeerRoleArn()
      (experimental) The role arn created in the acceptor account.

      Default: - no peerRoleArn needed if not cross account connection

    • getVpcPeeringConnectionName

      @Stability(Experimental) @Nullable default String getVpcPeeringConnectionName()
      (experimental) The resource name of the peering connection.

      Default: - peering connection provisioned without any name

    • builder

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