Class CfnVirtualNode

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, ITaggable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:33:57.417Z") @Stability(Stable) public class CfnVirtualNode extends CfnResource implements IInspectable, ITaggable
Creates a virtual node within a service mesh.

A virtual node acts as a logical pointer to a particular task group, such as an Amazon ECS service or a Kubernetes deployment. When you create a virtual node, you can specify the service discovery information for your task group, and whether the proxy running in a task group will communicate with other proxies using Transport Layer Security (TLS).

You define a listener for any inbound traffic that your virtual node expects. Any virtual service that your virtual node expects to communicate to is specified as a backend .

The response metadata for your new virtual node contains the arn that is associated with the virtual node. Set this value to the full ARN; for example, arn:aws:appmesh:us-west-2:123456789012:myMesh/default/virtualNode/myApp ) as the APPMESH_RESOURCE_ARN environment variable for your task group's Envoy proxy container in your task definition or pod spec. This is then mapped to the node.id and node.cluster Envoy parameters.

By default, App Mesh uses the name of the resource you specified in APPMESH_RESOURCE_ARN when Envoy is referring to itself in metrics and traces. You can override this behavior by setting the APPMESH_RESOURCE_CLUSTER environment variable with your own name.

For more information about virtual nodes, see Virtual nodes . You must be using 1.15.0 or later of the Envoy image when setting these variables. For more information aboutApp Mesh Envoy variables, see Envoy image in the AWS App Mesh User Guide.

Example:

 // 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.*;
 CfnVirtualNode cfnVirtualNode = CfnVirtualNode.Builder.create(this, "MyCfnVirtualNode")
         .meshName("meshName")
         .spec(VirtualNodeSpecProperty.builder()
                 .backendDefaults(BackendDefaultsProperty.builder()
                         .clientPolicy(ClientPolicyProperty.builder()
                                 .tls(ClientPolicyTlsProperty.builder()
                                         .validation(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())
                                         // the properties below are optional
                                         .certificate(ClientTlsCertificateProperty.builder()
                                                 .file(ListenerTlsFileCertificateProperty.builder()
                                                         .certificateChain("certificateChain")
                                                         .privateKey("privateKey")
                                                         .build())
                                                 .sds(ListenerTlsSdsCertificateProperty.builder()
                                                         .secretName("secretName")
                                                         .build())
                                                 .build())
                                         .enforce(false)
                                         .ports(List.of(123))
                                         .build())
                                 .build())
                         .build())
                 .backends(List.of(BackendProperty.builder()
                         .virtualService(VirtualServiceBackendProperty.builder()
                                 .virtualServiceName("virtualServiceName")
                                 // the properties below are optional
                                 .clientPolicy(ClientPolicyProperty.builder()
                                         .tls(ClientPolicyTlsProperty.builder()
                                                 .validation(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())
                                                 // the properties below are optional
                                                 .certificate(ClientTlsCertificateProperty.builder()
                                                         .file(ListenerTlsFileCertificateProperty.builder()
                                                                 .certificateChain("certificateChain")
                                                                 .privateKey("privateKey")
                                                                 .build())
                                                         .sds(ListenerTlsSdsCertificateProperty.builder()
                                                                 .secretName("secretName")
                                                                 .build())
                                                         .build())
                                                 .enforce(false)
                                                 .ports(List.of(123))
                                                 .build())
                                         .build())
                                 .build())
                         .build()))
                 .listeners(List.of(ListenerProperty.builder()
                         .portMapping(PortMappingProperty.builder()
                                 .port(123)
                                 .protocol("protocol")
                                 .build())
                         // the properties below are optional
                         .connectionPool(VirtualNodeConnectionPoolProperty.builder()
                                 .grpc(VirtualNodeGrpcConnectionPoolProperty.builder()
                                         .maxRequests(123)
                                         .build())
                                 .http(VirtualNodeHttpConnectionPoolProperty.builder()
                                         .maxConnections(123)
                                         // the properties below are optional
                                         .maxPendingRequests(123)
                                         .build())
                                 .http2(VirtualNodeHttp2ConnectionPoolProperty.builder()
                                         .maxRequests(123)
                                         .build())
                                 .tcp(VirtualNodeTcpConnectionPoolProperty.builder()
                                         .maxConnections(123)
                                         .build())
                                 .build())
                         .healthCheck(HealthCheckProperty.builder()
                                 .healthyThreshold(123)
                                 .intervalMillis(123)
                                 .protocol("protocol")
                                 .timeoutMillis(123)
                                 .unhealthyThreshold(123)
                                 // the properties below are optional
                                 .path("path")
                                 .port(123)
                                 .build())
                         .outlierDetection(OutlierDetectionProperty.builder()
                                 .baseEjectionDuration(DurationProperty.builder()
                                         .unit("unit")
                                         .value(123)
                                         .build())
                                 .interval(DurationProperty.builder()
                                         .unit("unit")
                                         .value(123)
                                         .build())
                                 .maxEjectionPercent(123)
                                 .maxServerErrors(123)
                                 .build())
                         .timeout(ListenerTimeoutProperty.builder()
                                 .grpc(GrpcTimeoutProperty.builder()
                                         .idle(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .perRequest(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .build())
                                 .http(HttpTimeoutProperty.builder()
                                         .idle(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .perRequest(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .build())
                                 .http2(HttpTimeoutProperty.builder()
                                         .idle(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .perRequest(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .build())
                                 .tcp(TcpTimeoutProperty.builder()
                                         .idle(DurationProperty.builder()
                                                 .unit("unit")
                                                 .value(123)
                                                 .build())
                                         .build())
                                 .build())
                         .tls(ListenerTlsProperty.builder()
                                 .certificate(ListenerTlsCertificateProperty.builder()
                                         .acm(ListenerTlsAcmCertificateProperty.builder()
                                                 .certificateArn("certificateArn")
                                                 .build())
                                         .file(ListenerTlsFileCertificateProperty.builder()
                                                 .certificateChain("certificateChain")
                                                 .privateKey("privateKey")
                                                 .build())
                                         .sds(ListenerTlsSdsCertificateProperty.builder()
                                                 .secretName("secretName")
                                                 .build())
                                         .build())
                                 .mode("mode")
                                 // the properties below are optional
                                 .validation(ListenerTlsValidationContextProperty.builder()
                                         .trust(ListenerTlsValidationContextTrustProperty.builder()
                                                 .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())
                                 .build())
                         .build()))
                 .logging(LoggingProperty.builder()
                         .accessLog(AccessLogProperty.builder()
                                 .file(FileAccessLogProperty.builder()
                                         .path("path")
                                         // the properties below are optional
                                         .format(LoggingFormatProperty.builder()
                                                 .json(List.of(JsonFormatRefProperty.builder()
                                                         .key("key")
                                                         .value("value")
                                                         .build()))
                                                 .text("text")
                                                 .build())
                                         .build())
                                 .build())
                         .build())
                 .serviceDiscovery(ServiceDiscoveryProperty.builder()
                         .awsCloudMap(AwsCloudMapServiceDiscoveryProperty.builder()
                                 .namespaceName("namespaceName")
                                 .serviceName("serviceName")
                                 // the properties below are optional
                                 .attributes(List.of(AwsCloudMapInstanceAttributeProperty.builder()
                                         .key("key")
                                         .value("value")
                                         .build()))
                                 .ipPreference("ipPreference")
                                 .build())
                         .dns(DnsServiceDiscoveryProperty.builder()
                                 .hostname("hostname")
                                 // the properties below are optional
                                 .ipPreference("ipPreference")
                                 .responseType("responseType")
                                 .build())
                         .build())
                 .build())
         // the properties below are optional
         .meshOwner("meshOwner")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .virtualNodeName("virtualNodeName")
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnVirtualNode

      protected CfnVirtualNode(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnVirtualNode

      protected CfnVirtualNode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnVirtualNode

      @Stability(Stable) public CfnVirtualNode(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnVirtualNodeProps props)
      Parameters:
      scope - Scope in which this resource is defined. This parameter is required.
      id - Construct identifier for this resource (unique in its scope). This parameter is required.
      props - Resource properties. This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector - tree inspector to collect and process attributes. This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The full Amazon Resource Name (ARN) for the virtual node.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
    • getAttrMeshName

      @Stability(Stable) @NotNull public String getAttrMeshName()
      The name of the service mesh that the virtual node resides in.
    • getAttrMeshOwner

      @Stability(Stable) @NotNull public String getAttrMeshOwner()
      The AWS IAM account ID of the service mesh owner.

      If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see Working with Shared Meshes .

    • getAttrResourceOwner

      @Stability(Stable) @NotNull public String getAttrResourceOwner()
      The AWS IAM account ID of the resource owner.

      If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see Working with Shared Meshes .

    • getAttrUid

      @Stability(Stable) @NotNull public String getAttrUid()
      The unique identifier for the virtual node.
    • getAttrVirtualNodeName

      @Stability(Stable) @NotNull public String getAttrVirtualNodeName()
      The name of the virtual node.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getTags in interface ITaggable
    • getMeshName

      @Stability(Stable) @NotNull public String getMeshName()
      The name of the service mesh to create the virtual node in.
    • setMeshName

      @Stability(Stable) public void setMeshName(@NotNull String value)
      The name of the service mesh to create the virtual node in.
    • getSpec

      @Stability(Stable) @NotNull public Object getSpec()
      The virtual node specification to apply.
    • setSpec

      @Stability(Stable) public void setSpec(@NotNull IResolvable value)
      The virtual node specification to apply.
    • setSpec

      @Stability(Stable) public void setSpec(@NotNull CfnVirtualNode.VirtualNodeSpecProperty value)
      The virtual node specification to apply.
    • getMeshOwner

      @Stability(Stable) @Nullable public String getMeshOwner()
      The AWS IAM account ID of the service mesh owner.
    • setMeshOwner

      @Stability(Stable) public void setMeshOwner(@Nullable String value)
      The AWS IAM account ID of the service mesh owner.
    • getTagsRaw

      @Stability(Stable) @Nullable public List<CfnTag> getTagsRaw()
      Optional metadata that you can apply to the virtual node to assist with categorization and organization.
    • setTagsRaw

      @Stability(Stable) public void setTagsRaw(@Nullable List<CfnTag> value)
      Optional metadata that you can apply to the virtual node to assist with categorization and organization.
    • getVirtualNodeName

      @Stability(Stable) @Nullable public String getVirtualNodeName()
      The name to use for the virtual node.
    • setVirtualNodeName

      @Stability(Stable) public void setVirtualNodeName(@Nullable String value)
      The name to use for the virtual node.