Interface GatewayVpcEndpointOptions

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-12-06T14:43:17.921Z") @Stability(Stable) public interface GatewayVpcEndpointOptions extends software.amazon.jsii.JsiiSerializable
Options to add a gateway endpoint to a VPC.

Example:

 // Add gateway endpoints when creating the VPC
 Vpc vpc = Vpc.Builder.create(this, "MyVpc")
         .gatewayEndpoints(Map.of(
                 "S3", GatewayVpcEndpointOptions.builder()
                         .service(GatewayVpcEndpointAwsService.S3)
                         .build()))
         .build();
 // Alternatively gateway endpoints can be added on the VPC
 GatewayVpcEndpoint dynamoDbEndpoint = vpc.addGatewayEndpoint("DynamoDbEndpoint", GatewayVpcEndpointOptions.builder()
         .service(GatewayVpcEndpointAwsService.DYNAMODB)
         .build());
 // This allows to customize the endpoint policy
 dynamoDbEndpoint.addToPolicy(
 PolicyStatement.Builder.create() // Restrict to listing and describing tables
         .principals(List.of(new AnyPrincipal()))
         .actions(List.of("dynamodb:DescribeTable", "dynamodb:ListTables"))
         .resources(List.of("*")).build());
 // Add an interface endpoint
 vpc.addInterfaceEndpoint("EcrDockerEndpoint", InterfaceVpcEndpointOptions.builder()
         .service(InterfaceVpcEndpointAwsService.ECR_DOCKER)
         .build());
 
  • Method Details

    • getService

      @Stability(Stable) @NotNull IGatewayVpcEndpointService getService()
      The service to use for this gateway VPC endpoint.
    • getSubnets

      @Stability(Stable) @Nullable default List<SubnetSelection> getSubnets()
      Where to add endpoint routing.

      By default, this endpoint will be routable from all subnets in the VPC. Specify a list of subnet selection objects here to be more specific.

      Default: - All subnets in the VPC

      Example:

       Vpc vpc;
       vpc.addGatewayEndpoint("DynamoDbEndpoint", GatewayVpcEndpointOptions.builder()
               .service(GatewayVpcEndpointAwsService.DYNAMODB)
               // Add only to ISOLATED subnets
               .subnets(List.of(SubnetSelection.builder().subnetType(SubnetType.PRIVATE_ISOLATED).build()))
               .build());
       
    • builder

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