Class VirtualGateway
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.appmesh.VirtualGateway
- All Implemented Interfaces:
IEnvironmentAware,IResource,IVirtualGateway,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-04T09:27:34.315Z")
@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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.appmesh.IVirtualGateway
IVirtualGateway.Jsii$Default, IVirtualGateway.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVirtualGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedVirtualGateway(software.amazon.jsii.JsiiObjectRef objRef) VirtualGateway(software.constructs.Construct scope, String id, VirtualGatewayProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddGatewayRoute(String id, GatewayRouteBaseProps props) Utility method to add a new GatewayRoute to the VirtualGateway.static IVirtualGatewayfromVirtualGatewayArn(software.constructs.Construct scope, String id, String virtualGatewayArn) Import an existing VirtualGateway given an ARN.static IVirtualGatewayfromVirtualGatewayAttributes(software.constructs.Construct scope, String id, VirtualGatewayAttributes attrs) Import an existing VirtualGateway given its attributes.protected List<VirtualGatewayListenerConfig> getMesh()The Mesh that the VirtualGateway belongs to.The Amazon Resource Name (ARN) for the VirtualGateway.The name of the VirtualGateway.grantStreamAggregatedResources(IGrantable identity) Grants the given entityappmesh:StreamAggregatedResources.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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:
addGatewayRoutein interfaceIVirtualGateway- Parameters:
id- This parameter is required.props- This parameter is required.
-
grantStreamAggregatedResources
@Stability(Stable) @NotNull public Grant grantStreamAggregatedResources(@NotNull IGrantable identity) Grants the given entityappmesh:StreamAggregatedResources.- Specified by:
grantStreamAggregatedResourcesin interfaceIVirtualGateway- Parameters:
identity- This parameter is required.
-
getListeners
-
getMesh
The Mesh that the VirtualGateway belongs to.- Specified by:
getMeshin interfaceIVirtualGateway
-
getVirtualGatewayArn
The Amazon Resource Name (ARN) for the VirtualGateway.- Specified by:
getVirtualGatewayArnin interfaceIVirtualGateway
-
getVirtualGatewayName
The name of the VirtualGateway.- Specified by:
getVirtualGatewayNamein interfaceIVirtualGateway
-