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
> 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:
Added SetDefaultSecurityGroupID() call to check for default security groups for run task and
create service.
Run task and create service creates default security group if default
security group does not exist.
Similar function invpc_operation.go is refactored into EC2 client and
shared with service_create.go and task_run.go.
Added console logs in EC2 client, service_create.go, task_run.go.
Unit tests for refactored code. Increased EC2 module code coverage by 10%.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue #, if available:
fargate-default
security group. For fresh AWS accounts, there is no such SG. This results in anil
being returned. The CLI continues down this path to register the task/service with the SG, resulting in the following error messagefargate-default
is available, select it and remove it.Description of changes:
SetDefaultSecurityGroupID()
call to check for default security groups for run task and create service.vpc_operation.go
is refactored into EC2 client and shared withservice_create.go
andtask_run.go
.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.