Class GatewayVpcEndpoint.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.GatewayVpcEndpoint.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<GatewayVpcEndpoint>
Enclosing class:
GatewayVpcEndpoint

@Stability(Stable) public static final class GatewayVpcEndpoint.Builder extends Object implements software.amazon.jsii.Builder<GatewayVpcEndpoint>
A fluent builder for GatewayVpcEndpoint.
  • Method Details

    • create

      @Stability(Stable) public static GatewayVpcEndpoint.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of GatewayVpcEndpoint.Builder.
    • service

      @Stability(Stable) public GatewayVpcEndpoint.Builder service(IGatewayVpcEndpointService service)
      The service to use for this gateway VPC endpoint.

      Parameters:
      service - The service to use for this gateway VPC endpoint. This parameter is required.
      Returns:
      this
    • subnets

      @Stability(Stable) public GatewayVpcEndpoint.Builder subnets(List<? extends SubnetSelection> subnets)
      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());
       

      Parameters:
      subnets - Where to add endpoint routing. This parameter is required.
      Returns:
      this
    • vpc

      @Stability(Stable) public GatewayVpcEndpoint.Builder vpc(IVpc vpc)
      The VPC network in which the gateway endpoint will be used.

      Parameters:
      vpc - The VPC network in which the gateway endpoint will be used. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public GatewayVpcEndpoint build()
      Specified by:
      build in interface software.amazon.jsii.Builder<GatewayVpcEndpoint>
      Returns:
      a newly built instance of GatewayVpcEndpoint.