Class CfnVirtualNode
- All Implemented Interfaces:
IInspectable,IVirtualNodeRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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_ARNwhen Envoy is referring to itself in metrics and traces. You can override this behavior by setting theAPPMESH_RESOURCE_CLUSTERenvironment 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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn object that represents the access logging information for a virtual node.static interfaceAn object that represents the AWS Cloud Map attribute information for your virtual node.static interfaceAn object that represents the AWS Cloud Map service discovery information for your virtual node.static interfaceAn object that represents the default properties for a backend.static interfaceAn object that represents the backends that a virtual node is expected to send outbound traffic to.static final classA fluent builder forCfnVirtualNode.static interfaceAn object that represents a client policy.static interfaceA reference to an object that represents a Transport Layer Security (TLS) client policy.static interfaceAn object that represents the client's certificate.static interfaceAn object that represents the DNS service discovery information for your virtual node.static interfaceAn object that represents a duration of time.static interfaceAn object that represents an access log file.static interfaceAn object that represents types of timeouts.static interfaceAn object that represents the health check policy for a virtual node's listener.static interfaceAn object that represents types of timeouts.static interfaceAn object that represents the key value pairs for the JSON.static interfaceAn object that represents a listener for a virtual node.static interfaceAn object that represents timeouts for different protocols.static interfaceAn object that represents an Certificate Manager certificate.static interfaceAn object that represents a listener's Transport Layer Security (TLS) certificate.static interfaceAn object that represents a local file certificate.static interfaceAn object that represents the Transport Layer Security (TLS) properties for a listener.static interfaceAn object that represents the listener's Secret Discovery Service certificate.static interfaceAn object that represents a listener's Transport Layer Security (TLS) validation context.static interfaceAn object that represents a listener's Transport Layer Security (TLS) validation context trust.static interfaceAn object that represents the format for the logs.static interfaceAn object that represents the logging information for a virtual node.static interfaceAn object that represents the outlier detection for a virtual node's listener.static interfaceAn object representing a virtual node or virtual router listener port mapping.static interfaceAn object that represents the service discovery information for a virtual node.static interfaceAn object that represents the methods by which a subject alternative name on a peer Transport Layer Security (TLS) certificate can be matched.static interfaceAn object that represents the subject alternative names secured by the certificate.static interfaceAn object that represents types of timeouts.static interfaceAn object that represents a Transport Layer Security (TLS) validation context trust for an Certificate Manager certificate.static interfaceAn object that represents a Transport Layer Security (TLS) validation context trust for a local file.static interfaceAn object that represents how the proxy will validate its peer during Transport Layer Security (TLS) negotiation.static interfaceAn object that represents a Transport Layer Security (TLS) Secret Discovery Service validation context trust.static interfaceAn object that represents a Transport Layer Security (TLS) validation context trust.static interfaceAn object that represents the type of virtual node connection pool.static interfaceAn object that represents a type of connection pool.static interfaceAn object that represents a type of connection pool.static interfaceAn object that represents a type of connection pool.static interfaceAn object that represents the specification of a virtual node.static interfaceAn object that represents a type of connection pool.static interfaceAn object that represents a virtual service backend for a virtual node.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.appmesh.IVirtualNodeRef
IVirtualNodeRef.Jsii$Default, IVirtualNodeRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnVirtualNode(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnVirtualNode(software.amazon.jsii.JsiiObjectRef objRef) CfnVirtualNode(software.constructs.Construct scope, String id, CfnVirtualNodeProps props) Create a newAWS::AppMesh::VirtualNode. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForVirtualNode(IVirtualNodeRef resource) The full Amazon Resource Name (ARN) for the virtual node.The name of the service mesh that the virtual node resides in.The AWS IAM account ID of the service mesh owner.The AWS IAM account ID of the resource owner.The unique identifier for the virtual node.The name of the virtual node.The name of the service mesh to create the virtual node in.The AWS IAM account ID of the service mesh owner.getSpec()The virtual node specification to apply.getTags()Tag Manager which manages the tags for this resource.Optional metadata that you can apply to the virtual node to assist with categorization and organization.The name to use for the virtual node.A reference to a VirtualNode resource.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnVirtualNode.renderProperties(Map<String, Object> props) voidsetMeshName(String value) The name of the service mesh to create the virtual node in.voidsetMeshOwner(String value) The AWS IAM account ID of the service mesh owner.voidsetSpec(IResolvable value) The virtual node specification to apply.voidThe virtual node specification to apply.voidsetTagsRaw(List<CfnTag> value) Optional metadata that you can apply to the virtual node to assist with categorization and organization.voidsetVirtualNodeName(String value) The name to use for the virtual node.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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) Create a newAWS::AppMesh::VirtualNode.- 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
-
arnForVirtualNode
@Stability(Stable) @NotNull public static String arnForVirtualNode(@NotNull IVirtualNodeRef resource) - Parameters:
resource- This parameter is required.
-
isCfnVirtualNode
Checks whether the given object is a CfnVirtualNode.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The full Amazon Resource Name (ARN) for the virtual node. -
getAttrId
-
getAttrMeshName
The name of the service mesh that the virtual node resides in. -
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
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
The unique identifier for the virtual node. -
getAttrVirtualNodeName
The name of the virtual node. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getVirtualNodeRef
A reference to a VirtualNode resource.- Specified by:
getVirtualNodeRefin interfaceIVirtualNodeRef
-
getMeshName
The name of the service mesh to create the virtual node in. -
setMeshName
The name of the service mesh to create the virtual node in. -
getSpec
The virtual node specification to apply.Returns union: either
IResolvableorCfnVirtualNode.VirtualNodeSpecProperty -
setSpec
The virtual node specification to apply. -
setSpec
The virtual node specification to apply. -
getMeshOwner
The AWS IAM account ID of the service mesh owner. -
setMeshOwner
The AWS IAM account ID of the service mesh owner. -
getTagsRaw
Optional metadata that you can apply to the virtual node to assist with categorization and organization. -
setTagsRaw
Optional metadata that you can apply to the virtual node to assist with categorization and organization. -
getVirtualNodeName
The name to use for the virtual node. -
setVirtualNodeName
The name to use for the virtual node.
-