Configuring ECS specific parameters
We also need to create an ECS specific parameters file, ecs-params.yml
, which defines resource (CPU and memory) settings for the task to create in addition to setting the Network Mode as awsvpc
, which is the only supported Network Mode for the Fargate launch type. The run parameters include the network configuration for subnets, security groups, and setting the Assign public IP
option for the task toENABLED
. The subnets are obtained from the output of the ecs-cli up
command. The security group is obtained from the output of the Get-EC2SecurityGroup -Region "us-east-1" -GroupId $groupid
command, as listed earlier:
version: 1 task_definition: task_execution_role: ecsExecutionRole ecs_network_mode: awsvpc task_size: mem_limit: 0.5GB cpu_limit: 256 run_params: network_configuration: awsvpc_configuration: subnets: - "subnet-2c02dd4b" - "subnet-f2d50bdc" security_groups: - "sg-8c7dafc7" assign_public_ip...