# TlsValidationContextProperty

An object that represents how the proxy will validate its peer during Transport Layer Security (TLS) negotiation.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appmesh as appmesh } from 'aws-cdk-lib';
const tlsValidationContextProperty: appmesh.CfnVirtualNode.TlsValidationContextProperty = {
  trust: {
    acm: {
      certificateAuthorityArns: ['certificateAuthorityArns'],
    },
    file: {
      certificateChain: 'certificateChain',
    },
    sds: {
      secretName: 'secretName',
    },
  },

  // the properties below are optional
  subjectAlternativeNames: {
    match: {
      exact: ['exact'],
    },
  },
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_appmesh as appmesh

tls_validation_context_property = appmesh.CfnVirtualNode.TlsValidationContextProperty(
    trust=appmesh.CfnVirtualNode.TlsValidationContextTrustProperty(
        acm=appmesh.CfnVirtualNode.TlsValidationContextAcmTrustProperty(
            certificate_authority_arns=["certificateAuthorityArns"]
        ),
        file=appmesh.CfnVirtualNode.TlsValidationContextFileTrustProperty(
            certificate_chain="certificateChain"
        ),
        sds=appmesh.CfnVirtualNode.TlsValidationContextSdsTrustProperty(
            secret_name="secretName"
        )
    ),

    # the properties below are optional
    subject_alternative_names=appmesh.CfnVirtualNode.SubjectAlternativeNamesProperty(
        match=appmesh.CfnVirtualNode.SubjectAlternativeNameMatchersProperty(
            exact=["exact"]
        )
    )
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.appmesh.*;

TlsValidationContextProperty tlsValidationContextProperty = TlsValidationContextProperty.builder()
        .trust(TlsValidationContextTrustProperty.builder()
                .acm(TlsValidationContextAcmTrustProperty.builder()
                        .certificateAuthorityArns(List.of("certificateAuthorityArns"))
                        .build())
                .file(TlsValidationContextFileTrustProperty.builder()
                        .certificateChain("certificateChain")
                        .build())
                .sds(TlsValidationContextSdsTrustProperty.builder()
                        .secretName("secretName")
                        .build())
                .build())

        // the properties below are optional
        .subjectAlternativeNames(SubjectAlternativeNamesProperty.builder()
                .match(SubjectAlternativeNameMatchersProperty.builder()
                        .exact(List.of("exact"))
                        .build())
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.AppMesh;

var tlsValidationContextProperty = new TlsValidationContextProperty {
    Trust = new TlsValidationContextTrustProperty {
        Acm = new TlsValidationContextAcmTrustProperty {
            CertificateAuthorityArns = new [] { "certificateAuthorityArns" }
        },
        File = new TlsValidationContextFileTrustProperty {
            CertificateChain = "certificateChain"
        },
        Sds = new TlsValidationContextSdsTrustProperty {
            SecretName = "secretName"
        }
    },

    // the properties below are optional
    SubjectAlternativeNames = new SubjectAlternativeNamesProperty {
        Match = new SubjectAlternativeNameMatchersProperty {
            Exact = new [] { "exact" }
        }
    }
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

tlsValidationContextProperty := &TlsValidationContextProperty{
	Trust: &TlsValidationContextTrustProperty{
		Acm: &TlsValidationContextAcmTrustProperty{
			CertificateAuthorityArns: []*string{
				jsii.String("certificateAuthorityArns"),
			},
		},
		File: &TlsValidationContextFileTrustProperty{
			CertificateChain: jsii.String("certificateChain"),
		},
		Sds: &TlsValidationContextSdsTrustProperty{
			SecretName: jsii.String("secretName"),
		},
	},

	// the properties below are optional
	SubjectAlternativeNames: &SubjectAlternativeNamesProperty{
		Match: &SubjectAlternativeNameMatchersProperty{
			Exact: []*string{
				jsii.String("exact"),
			},
		},
	},
}
```

## Properties

- `subjectAlternativeNames`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVirtualNode.SubjectAlternativeNamesProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.SubjectAlternativeNamesProperty.html) — A reference to an object that represents the SANs for a Transport Layer Security (TLS) validation context.

  If you don't specify SANs on the *terminating* mesh endpoint, the Envoy proxy for that node doesn't verify the SAN on a peer client certificate. If you don't specify SANs on the *originating* mesh endpoint, the SAN on the certificate provided by the terminating endpoint must match the mesh endpoint service discovery configuration. Since SPIRE vended certificates have a SPIFFE ID as a name, you must set the SAN since the name doesn't match the service discovery name.

- `trust`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnVirtualNode.TlsValidationContextTrustProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appmesh.CfnVirtualNode.TlsValidationContextTrustProperty.html) (required) — A reference to where to retrieve the trust chain when validating a peer’s Transport Layer Security (TLS) certificate.
