ECS Fargate EBS volume task-definition rejected for configuredAtLaunch

0

I'm trying to register a new task-definition via CLI (also from GH Actions), my request is getting rejected because of the config for volume attachment. I'm trying to create an EBS vol from a snapshot. This works from the web console & i've copied my task-definition json from a successful existing revision. The cli command i'm using is: aws ecs register-task-definition --cli-input-json file://tools-testmount.json

The error I'm getting is: Parameter validation failed: Unknown parameter in volumes[0]: "configuredAtLaunch", must be one of: name, host, dockerVolumeConfiguration, efsVolumeConfiguration, fsxWindowsFileServerVolumeConfiguration

my task def:

{
    "containerDefinitions": [
        {
            "name": "nginx",
            "image": "XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/tools-website:latest",
            "cpu": 0,
            "portMappings": [
                {
                    "name": "nginx-80-tcp",
                    "containerPort": 80,
                    "hostPort": 80,
                    "protocol": "tcp",
                    "appProtocol": "http"
                }
            ],
            "essential": true,
            "environment": [],
            "environmentFiles": [],
            "mountPoints": [
                {
                    "sourceVolume": "testvol",
                    "containerPath": "/bindmount",
                    "readOnly": true
                }
            ],
            "volumesFrom": [],
            "ulimits": [],
            "logConfiguration": {
                "logDriver": "awslogs",
                "options": {
                    "awslogs-create-group": "true",
                    "awslogs-group": "/ecs/tools-test",
                    "awslogs-region": "us-east-1",
                    "awslogs-stream-prefix": "ecs"
                },
                "secretOptions": []
            },
            "systemControls": []
        }
    ],
    "family": "tools-test",
    "taskRoleArn": "arn:aws:iam::XXXXXXXXXXXX:role/ecsTaskExecutionRole",
    "executionRoleArn": "arn:aws:iam::XXXXXXXXXXXX:role/ecsTaskExecutionRole",
    "networkMode": "awsvpc",
    "volumes": [
        {
            "name": "testvol",
            "configuredAtLaunch": true
        }
    ],
    "placementConstraints": [],
    "requiresCompatibilities": [
        "FARGATE"
    ],
    "cpu": "512",
    "memory": "1024",
    "runtimePlatform": {
        "cpuArchitecture": "X86_64",
        "operatingSystemFamily": "LINUX"
    },
    "tags": []
}

The service is configured for a 'Volume configured at deployment'; Amazon EBS; GP3; SnapshotID, ext4 & default encryption.

As i said, this all works when configured or updated from the console, just not the CLI or from my GH Actions pipelines, which are using aws-actions/amazon-ecs-deploy-task-definition@v1 (getting the same error). This seems specific to the API. Any suggestions?

1 Answer
0

Hello.

What version of AWS CLI are you using?
If the AWS CLI version is older than "2.15.10", the parameter "configuredAtLaunch" cannot be found.
https://awscli.amazonaws.com/v2/documentation/api/2.15.10/reference/ecs/register-task-definition.html

Since EBS support was implemented in "2.15.10", I think that if the version of AWS CLI you are using is older than "2.15.10", you will be able to use it by updating it.
https://github.com/aws/aws-cli/blob/v2/.changes/2.15.10.json

profile picture
EXPERT
answered 24 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions