Skip to content
v2.275.0

SubjectAlternativeNames Class ​

Used to generate Subject Alternative Names Matchers.

Example ​

ts
declare const mesh: appmesh.Mesh;

const node1 = new appmesh.VirtualNode(this, 'node1', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node'),
  listeners: [appmesh.VirtualNodeListener.grpc({
    port: 80,
    tls: {
      mode: appmesh.TlsMode.STRICT,
      certificate: appmesh.TlsCertificate.file('path/to/certChain', 'path/to/privateKey'),
      // Validate a file client certificates to enable mutual TLS authentication when a client provides a certificate.
      mutualTlsValidation: {
        trust: appmesh.TlsValidationTrust.file('path-to-certificate'),
      },
    },
  })],
});

const certificateAuthorityArn = 'arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012';
const node2 = new appmesh.VirtualNode(this, 'node2', {
  mesh,
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node2'),
  backendDefaults: {
    tlsClientPolicy: {
      ports: [8080, 8081],
      validation: {
        subjectAlternativeNames: appmesh.SubjectAlternativeNames.matchingExactly('mesh-endpoint.apps.local'),
        trust: appmesh.TlsValidationTrust.acm([
          acmpca.CertificateAuthority.fromCertificateAuthorityArn(this, 'certificate', certificateAuthorityArn)]),
      },
      // Provide a SDS client certificate when a server requests it and enable mutual TLS authentication.
      mutualTlsCertificate: appmesh.TlsCertificate.sds('secret_certificate'),
    },
  },
});

Initializer ​

ts
new SubjectAlternativeNames()
python
SubjectAlternativeNames()
java
new SubjectAlternativeNames()
csharp
new SubjectAlternativeNames()
go
NewSubjectAlternativeNames()

Methods ​

bind(scope: Construct): SubjectAlternativeNamesMatcherConfigdef bind(self, scope: Construct) -> SubjectAlternativeNamesMatcherConfigpublic SubjectAlternativeNamesMatcherConfig bind(Construct scope)public SubjectAlternativeNamesMatcherConfig Bind(Construct scope)func Bind(Scope Construct) SubjectAlternativeNamesMatcherConfig#
Returns Subject Alternative Names Matcher based on method type.
matchingExactly(...names: string[]): SubjectAlternativeNames // chainable@staticmethod def matching_exactly(names: str) -> SubjectAlternativeNamespublic static SubjectAlternativeNames matchingExactly(String names)public static SubjectAlternativeNames MatchingExactly(string names)func MatchingExactly(Names *string) SubjectAlternativeNamesstatic#
The values of the SAN must match the specified values exactly.
1 parameter

Parameters

  • namesnamesnamesnamesNames — The exact values to test against.