Interface AddRouteOptions

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.372Z") @Stability(Stable) public interface AddRouteOptions extends software.amazon.jsii.JsiiSerializable
Options for adding a new route to a subnet.

Example:

 Vpc vpc = Vpc.Builder.create(this, "VPC")
         .subnetConfiguration(List.of(SubnetConfiguration.builder()
                 .subnetType(SubnetType.PUBLIC)
                 .name("Public")
                 .build(), SubnetConfiguration.builder()
                 .subnetType(SubnetType.PRIVATE_ISOLATED)
                 .name("Isolated")
                 .build()))
         .build();
 ((Subnet)vpc.isolatedSubnets[0]).addRoute("StaticRoute", AddRouteOptions.builder()
         .routerId(vpc.getInternetGatewayId())
         .routerType(RouterType.GATEWAY)
         .destinationCidrBlock("8.8.8.8/32")
         .build());
 
  • Method Details

    • getRouterId

      @Stability(Stable) @NotNull String getRouterId()
      The ID of the router.

      Can be an instance ID, gateway ID, etc, depending on the router type.

    • getRouterType

      @Stability(Stable) @NotNull RouterType getRouterType()
      What type of router to route this traffic to.
    • getDestinationCidrBlock

      @Stability(Stable) @Nullable default String getDestinationCidrBlock()
      IPv4 range this route applies to.

      Default: '0.0.0.0/0'

    • getDestinationIpv6CidrBlock

      @Stability(Stable) @Nullable default String getDestinationIpv6CidrBlock()
      IPv6 range this route applies to.

      Default: - Uses IPv6

    • getEnablesInternetConnectivity

      @Stability(Stable) @Nullable default Boolean getEnablesInternetConnectivity()
      Whether this route will enable internet connectivity.

      If true, this route will be added before any AWS resources that depend on internet connectivity in the VPC will be created.

      Default: false

    • builder

      @Stability(Stable) static AddRouteOptions.Builder builder()
      Returns:
      a AddRouteOptions.Builder of AddRouteOptions