Class VirtualGateway

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.appmesh.VirtualGateway
All Implemented Interfaces:
IConstruct, IDependable, IResource, IVirtualGateway, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.175Z") @Stability(Stable) public class VirtualGateway extends Resource implements IVirtualGateway
VirtualGateway represents a newly defined App Mesh Virtual Gateway.

A virtual gateway allows resources that are outside of your mesh to communicate to resources that are inside of your mesh.

Example:

 // A Virtual Node with a gRPC listener with a connection pool set
 Mesh mesh;
 VirtualNode node = VirtualNode.Builder.create(this, "node")
         .mesh(mesh)
         // DNS service discovery can optionally specify the DNS response type as either LOAD_BALANCER or ENDPOINTS.
         // LOAD_BALANCER means that the DNS resolver returns a loadbalanced set of endpoints,
         // whereas ENDPOINTS means that the DNS resolver is returning all the endpoints.
         // By default, the response type is assumed to be LOAD_BALANCER
         .serviceDiscovery(ServiceDiscovery.dns("node", DnsResponseType.ENDPOINTS))
         .listeners(List.of(VirtualNodeListener.http(HttpVirtualNodeListenerOptions.builder()
                 .port(80)
                 .connectionPool(HttpConnectionPool.builder()
                         .maxConnections(100)
                         .maxPendingRequests(10)
                         .build())
                 .build())))
         .build();
 // A Virtual Gateway with a gRPC listener with a connection pool set
 VirtualGateway gateway = VirtualGateway.Builder.create(this, "gateway")
         .mesh(mesh)
         .listeners(List.of(VirtualGatewayListener.grpc(GrpcGatewayListenerOptions.builder()
                 .port(8080)
                 .connectionPool(GrpcConnectionPool.builder()
                         .maxRequests(10)
                         .build())
                 .build())))
         .virtualGatewayName("gateway")
         .build();
 

See Also:
  • Constructor Details

    • VirtualGateway

      protected VirtualGateway(software.amazon.jsii.JsiiObjectRef objRef)
    • VirtualGateway

      protected VirtualGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • VirtualGateway

      @Stability(Stable) public VirtualGateway(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VirtualGatewayProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromVirtualGatewayArn

      @Stability(Stable) @NotNull public static IVirtualGateway fromVirtualGatewayArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String virtualGatewayArn)
      Import an existing VirtualGateway given an ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      virtualGatewayArn - This parameter is required.
    • fromVirtualGatewayAttributes

      @Stability(Stable) @NotNull public static IVirtualGateway fromVirtualGatewayAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VirtualGatewayAttributes attrs)
      Import an existing VirtualGateway given its attributes.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • addGatewayRoute

      @Stability(Stable) @NotNull public GatewayRoute addGatewayRoute(@NotNull String id, @NotNull GatewayRouteBaseProps props)
      Utility method to add a new GatewayRoute to the VirtualGateway.

      Specified by:
      addGatewayRoute in interface IVirtualGateway
      Parameters:
      id - This parameter is required.
      props - This parameter is required.
    • grantStreamAggregatedResources

      @Stability(Stable) @NotNull public Grant grantStreamAggregatedResources(@NotNull IGrantable identity)
      Grants the given entity appmesh:StreamAggregatedResources.

      Specified by:
      grantStreamAggregatedResources in interface IVirtualGateway
      Parameters:
      identity - This parameter is required.
    • getListeners

      @Stability(Stable) @NotNull protected List<VirtualGatewayListenerConfig> getListeners()
    • getMesh

      @Stability(Stable) @NotNull public IMesh getMesh()
      The Mesh that the VirtualGateway belongs to.
      Specified by:
      getMesh in interface IVirtualGateway
    • getVirtualGatewayArn

      @Stability(Stable) @NotNull public String getVirtualGatewayArn()
      The Amazon Resource Name (ARN) for the VirtualGateway.
      Specified by:
      getVirtualGatewayArn in interface IVirtualGateway
    • getVirtualGatewayName

      @Stability(Stable) @NotNull public String getVirtualGatewayName()
      The name of the VirtualGateway.
      Specified by:
      getVirtualGatewayName in interface IVirtualGateway