aws / amazon-ecs-cli

The Amazon ECS CLI enables users to run their applications on ECS/Fargate using the Docker Compose file format, quickly provision resources, push/pull images in ECR, and monitor running applications on ECS/Fargate.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI.html
Other
1.76k stars 302 forks source link

Windows hosts created during `ecs-cli up` don't join the cluster. #688

Open emisaacson opened 5 years ago

emisaacson commented 5 years ago

Summary

Windows hosts created during ecs-cli up don't join the cluster.

Description

Expected Behavior

Created hosts join the ECS cluster

Observed Behavior

Cloudformation completes successfully but the instances do not join the cluster.

If I run the same ecs-cli command above but substitute a linux AMI (e.g. "ami-045f1b3f87ed83659" # amzn-ami-2018.03.i-amazon-ecs-optimized) the instances join the cluster as expected.

Creating the Windows cluster through the AWS console with the same parameters above also works as expected.

emisaacson commented 5 years ago

I was able to fix this by replacing the mime-encoded bash script in UserData in the created CF stack with:

<powershell>
Initialize-ECSAgent -Cluster <ClusterName> -EnableTaskIAMRole -LoggingDrivers '[`"json-file`",`"awslogs`"]'
</powershell>