aws-cdk-lib.aws_appmesh.Mesh

class Mesh (construct)

LanguageType name
.NETAmazon.CDK.AWS.AppMesh.Mesh
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#Mesh
Javasoftware.amazon.awscdk.services.appmesh.Mesh
Pythonaws_cdk.aws_appmesh.Mesh
TypeScript (source)aws-cdk-lib » aws_appmesh » Mesh

Implements IConstruct, IDependable, IResource, IMesh

Define a new AppMesh mesh.

See also: https://docs.aws.amazon.com/app-mesh/latest/userguide/meshes.html

Example

// This is the ARN for the mesh from different AWS IAM account ID.
// Ensure mesh is properly shared with your account. For more details, see: https://github.com/aws/aws-cdk/issues/15404
const arn = 'arn:aws:appmesh:us-east-1:123456789012:mesh/testMesh';
const sharedMesh = appmesh.Mesh.fromMeshArn(this, 'imported-mesh', arn);

// This VirtualNode resource can communicate with the resources in the mesh from different AWS IAM account ID.
new appmesh.VirtualNode(this, 'test-node', {
  mesh: sharedMesh,
});

Initializer

new Mesh(scope: Construct, id: string, props?: MeshProps)

Parameters

  • scope Construct
  • id string
  • props MeshProps

Construct Props

NameTypeDescription
egressFilter?MeshFilterTypeEgress filter to be applied to the Mesh.
meshName?stringThe name of the Mesh being defined.
serviceDiscovery?MeshServiceDiscoveryDefines how upstream clients will discover VirtualNodes in the Mesh.

egressFilter?

Type: MeshFilterType (optional, default: DROP_ALL)

Egress filter to be applied to the Mesh.


meshName?

Type: string (optional, default: A name is automatically generated)

The name of the Mesh being defined.


serviceDiscovery?

Type: MeshServiceDiscovery (optional, default: No Service Discovery)

Defines how upstream clients will discover VirtualNodes in the Mesh.

Properties

NameTypeDescription
envResourceEnvironmentThe environment this resource belongs to.
meshArnstringThe Amazon Resource Name (ARN) of the AppMesh mesh.
meshNamestringThe name of the AppMesh mesh.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.

env

Type: ResourceEnvironment

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.


meshArn

Type: string

The Amazon Resource Name (ARN) of the AppMesh mesh.


meshName

Type: string

The name of the AppMesh mesh.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
addVirtualGateway(id, props?)Adds a VirtualGateway to the Mesh.
addVirtualNode(id, props?)Adds a VirtualNode to the Mesh.
addVirtualRouter(id, props?)Adds a VirtualRouter to the Mesh with the given id and props.
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
toString()Returns a string representation of this construct.
static fromMeshArn(scope, id, meshArn)Import an existing mesh by arn.
static fromMeshName(scope, id, meshName)Import an existing mesh by name.

addVirtualGateway(id, props?)

public addVirtualGateway(id: string, props?: VirtualGatewayBaseProps): VirtualGateway

Parameters

  • id string
  • props VirtualGatewayBaseProps

Returns

  • VirtualGateway

Adds a VirtualGateway to the Mesh.


addVirtualNode(id, props?)

public addVirtualNode(id: string, props?: VirtualNodeBaseProps): VirtualNode

Parameters

  • id string
  • props VirtualNodeBaseProps

Returns

  • VirtualNode

Adds a VirtualNode to the Mesh.


addVirtualRouter(id, props?)

public addVirtualRouter(id: string, props?: VirtualRouterBaseProps): VirtualRouter

Parameters

  • id string
  • props VirtualRouterBaseProps

Returns

  • VirtualRouter

Adds a VirtualRouter to the Mesh with the given id and props.


applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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).


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromMeshArn(scope, id, meshArn)

public static fromMeshArn(scope: Construct, id: string, meshArn: string): IMesh

Parameters

  • scope Construct
  • id string
  • meshArn string

Returns

  • IMesh

Import an existing mesh by arn.


static fromMeshName(scope, id, meshName)

public static fromMeshName(scope: Construct, id: string, meshName: string): IMesh

Parameters

  • scope Construct
  • id string
  • meshName string

Returns

  • IMesh

Import an existing mesh by name.