awslabs / fargatecli

CLI for AWS Fargate
Apache License 2.0
893 stars 114 forks source link

Create default SG for Task Run and Service Create #113

Open senglin opened 4 years ago

senglin commented 4 years ago

Issue #, if available:

  1. Fargate CLI currently does not check if the default security groups exist. It polls for the fargate-default security group. For fresh AWS accounts, there is no such SG. This results in a nil being returned. The CLI continues down this path to register the task/service with the SG, resulting in the following error message
  2. To reproduce this error, go to the AWS Console -> EC2> Security groups. If fargate-default is available, select it and remove it.
  3. In a terminal window, do the following:
> fargate task run web --image nginx:latest -v
...
[!] Could not run ECS task
InvalidParameterException: security group cannot be blank.
        status code: 400, request id: ce47d313-0784-4dfa-8c1b-f359f02693b0

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.