aws-cdk-lib.aws_appmesh.TlsCertificate

class TlsCertificate

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

Represents a TLS certificate.

Example

// A Virtual Node with listener TLS from an ACM provided certificate
declare const cert: certificatemanager.Certificate;
declare const mesh: appmesh.Mesh;

const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
  listeners: [appmesh.VirtualNodeListener.grpc({
    port: 80,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.acm(cert),
    },
  })],
});

// A Virtual Gateway with listener TLS from a customer provided file certificate
const gateway = new appmesh.VirtualGateway(this, 'gateway', {
  mesh,
  listeners: [appmesh.VirtualGatewayListener.grpc({
    port: 8080,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.file('path/to/certChain', 'path/to/privateKey'),
    },
  })],
  virtualGatewayName: 'gateway',
});

// A Virtual Gateway with listener TLS from a SDS provided certificate
const gateway2 = new appmesh.VirtualGateway(this, 'gateway2', {
  mesh,
  listeners: [appmesh.VirtualGatewayListener.http2({
    port: 8080,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.sds('secrete_certificate'),
    },
  })],
  virtualGatewayName: 'gateway2',
});

Initializer

new TlsCertificate()

Methods

NameDescription
bind(_scope)Returns TLS certificate based provider.
static acm(certificate)Returns an ACM TLS Certificate.
static file(certificateChainPath, privateKeyPath)Returns an File TLS Certificate.
static sds(secretName)Returns an SDS TLS Certificate.

bind(_scope)

public bind(_scope: Construct): TlsCertificateConfig

Parameters

  • _scope Construct

Returns

  • TlsCertificateConfig

Returns TLS certificate based provider.


static acm(certificate)

public static acm(certificate: ICertificate): TlsCertificate

Parameters

  • certificate ICertificate

Returns

  • TlsCertificate

Returns an ACM TLS Certificate.


static file(certificateChainPath, privateKeyPath)

public static file(certificateChainPath: string, privateKeyPath: string): MutualTlsCertificate

Parameters

  • certificateChainPath string
  • privateKeyPath string

Returns

  • MutualTlsCertificate

Returns an File TLS Certificate.


static sds(secretName)

public static sds(secretName: string): MutualTlsCertificate

Parameters

  • secretName string

Returns

  • MutualTlsCertificate

Returns an SDS TLS Certificate.