class VirtualGateway (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppMesh.VirtualGateway |
Java | software.amazon.awscdk.services.appmesh.VirtualGateway |
Python | aws_cdk.aws_appmesh.VirtualGateway |
TypeScript (source) | @aws-cdk/aws-appmesh » VirtualGateway |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IVirtual
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.
See also: https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_gateways.html
Example
// A Virtual Node with a gRPC listener with a connection pool set
declare const mesh: appmesh.Mesh;
const node = new appmesh.VirtualNode(this, 'node', {
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: appmesh.ServiceDiscovery.dns('node', appmesh.DnsResponseType.ENDPOINTS),
listeners: [appmesh.VirtualNodeListener.http({
port: 80,
connectionPool: {
maxConnections: 100,
maxPendingRequests: 10,
},
})],
});
// A Virtual Gateway with a gRPC listener with a connection pool set
const gateway = new appmesh.VirtualGateway(this, 'gateway', {
mesh,
listeners: [appmesh.VirtualGatewayListener.grpc({
port: 8080,
connectionPool: {
maxRequests: 10,
},
})],
virtualGatewayName: 'gateway',
});
Initializer
new VirtualGateway(scope: Construct, id: string, props: VirtualGatewayProps)
Parameters
- scope
Construct
- id
string
- props
Virtual
Gateway Props
Construct Props
Name | Type | Description |
---|---|---|
mesh | IMesh | The Mesh which the VirtualGateway belongs to. |
access | Access | Access Logging Configuration for the VirtualGateway. |
backend | Backend | Default Configuration Virtual Node uses to communicate with Virtual Service. |
listeners? | Virtual [] | Listeners for the VirtualGateway. |
virtual | string | Name of the VirtualGateway. |
mesh
Type:
IMesh
The Mesh which the VirtualGateway belongs to.
accessLog?
Type:
Access
(optional, default: no access logging)
Access Logging Configuration for the VirtualGateway.
backendDefaults?
Type:
Backend
(optional, default: No Config)
Default Configuration Virtual Node uses to communicate with Virtual Service.
listeners?
Type:
Virtual
[]
(optional, default: Single HTTP listener on port 8080)
Listeners for the VirtualGateway.
Only one is supported.
virtualGatewayName?
Type:
string
(optional, default: A name is automatically determined)
Name of the VirtualGateway.
Properties
Name | Type | Description |
---|---|---|
env | Resource | The environment this resource belongs to. |
listeners | Virtual [] | |
mesh | IMesh | The Mesh that the VirtualGateway belongs to. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
virtual | string | The Amazon Resource Name (ARN) for the VirtualGateway. |
virtual | string | The name of the VirtualGateway. |
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
listeners
Type:
Virtual
[]
mesh
Type:
IMesh
The Mesh that the VirtualGateway belongs to.
node
Type:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
virtualGatewayArn
Type:
string
The Amazon Resource Name (ARN) for the VirtualGateway.
virtualGatewayName
Type:
string
The name of the VirtualGateway.
Methods
Name | Description |
---|---|
add | Utility method to add a new GatewayRoute to the VirtualGateway. |
apply | Apply the given removal policy to this resource. |
grant | Grants the given entity appmesh:StreamAggregatedResources . |
to | Returns a string representation of this construct. |
static from | Import an existing VirtualGateway given an ARN. |
static from | Import an existing VirtualGateway given its attributes. |
GatewayRoute(id, props)
addpublic addGatewayRoute(id: string, props: GatewayRouteBaseProps): GatewayRoute
Parameters
- id
string
- props
Gateway
Route Base Props
Returns
Utility method to add a new GatewayRoute to the VirtualGateway.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
StreamAggregatedResources(identity)
grantpublic grantStreamAggregatedResources(identity: IGrantable): Grant
Parameters
- identity
IGrantable
Returns
Grants the given entity appmesh:StreamAggregatedResources
.
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
VirtualGatewayArn(scope, id, virtualGatewayArn)
static frompublic static fromVirtualGatewayArn(scope: Construct, id: string, virtualGatewayArn: string): IVirtualGateway
Parameters
- scope
Construct
- id
string
- virtualGatewayArn
string
Returns
Import an existing VirtualGateway given an ARN.
VirtualGatewayAttributes(scope, id, attrs)
static frompublic static fromVirtualGatewayAttributes(scope: Construct, id: string, attrs: VirtualGatewayAttributes): IVirtualGateway
Parameters
- scope
Construct
- id
string
- attrs
Virtual
Gateway Attributes
Returns
Import an existing VirtualGateway given its attributes.