# You can use any of these parameters to create conditions or mappings in your template. Parameters: App: Type: String Description: Your application's name. Env: Type: String Description: The environment name your service, job, or workflow is being deployed to. Name: Type: String Description: The name of the service, job, or workflow being deployed. Resources: # Create your resource here, such as an AWS::DynamoDB::Table: # MyTable: # Type: AWS::DynamoDB::Table # Properties: # ... AppMeshVirtualNodeCrystal: Type: AWS::AppMesh::VirtualNode Properties: MeshName: !Sub 'appmesh-${App}-${Env}' Spec: Listeners: - HealthCheck: HealthyThreshold: 3 IntervalMillis: 10000 Path: "/health" Port: 3000 Protocol: "http" TimeoutMillis: 5000 UnhealthyThreshold: 3 PortMapping: Port: 3000 Protocol: "http" ServiceDiscovery: DNS: #Hostname: "ecsdemo-crystal.prod.ecsworkshop.local" Hostname: !Sub '${Name}.${Env}.${App}.local' Logging: AccessLog: File: Path: "/dev/stdout" VirtualNodeName: crystal AppMeshVirtualServiceCrystal: Type: AWS::AppMesh::VirtualService Properties: MeshName: !Sub 'appmesh-${App}-${Env}' Spec: Provider: VirtualNode: VirtualNodeName: !GetAtt AppMeshVirtualNodeCrystal.VirtualNodeName VirtualServiceName: !Sub '${Name}.${Env}.${App}.local' # 1. In addition to your resource, if you need to access the resource from your ECS task # then you need to create an AWS::IAM::ManagedPolicy that holds the permissions for your resource. # # For example, below is a sample policy for MyTable: Outputs: # 1. You need to output the IAM ManagedPolicy so that Copilot can add it as a managed policy to your ECS task role. AppmeshResourceArn: Description: ARN of the VirtualNode Value: !Ref AppMeshVirtualNodeCrystal # 2. If you want to inject a property of your resource as an environment variable to your ECS task, # then you need to define an output for it. # # For example, the output MyTableName will be injected in capital snake case, MY_TABLE_NAME, to your task. # MyTableName: # Description: "The name of this DynamoDB." # Value: !Ref MyTable