Create a new virtual node
- Create a new virtual node for our Crystal backend. This time, the virtual node will reference our error version.
# Define variables #
SPEC=$(cat <<-EOF
{
"serviceDiscovery": {
"awsCloudMap": {
"namespaceName": "appmeshworkshop.pvt.local",
"serviceName": "crystal",
"attributes": [
{
"key": "ECS_TASK_SET_EXTERNAL_ID",
"value": "error-task-set"
}
]
}
},
"logging": {
"accessLog": {
"file": {
"path": "/dev/stdout"
}
}
},
"listeners": [
{
"healthCheck": {
"healthyThreshold": 3,
"intervalMillis": 10000,
"path": "/health",
"port": 3000,
"protocol": "http",
"timeoutMillis": 5000,
"unhealthyThreshold": 3
},
"portMapping": { "port": 3000, "protocol": "http" }
}
]
}
EOF
); \
# Create app mesh virtual node #
aws appmesh create-virtual-node \
--mesh-name appmesh-workshop \
--virtual-node-name crystal-sd-error \
--spec "$SPEC"