# Trying to configure ECS taskdefinition with ephemeralStorage

**URL:** <https://forum.ansible.com/t/trying-to-configure-ecs-taskdefinition-with-ephemeralstorage/44377>\
**Category:** Get Help\
**Tags:** aws\
**Created:** [August 27, 2025, 11:26am UTC](https://forum.ansible.com/t/trying-to-configure-ecs-taskdefinition-with-ephemeralstorage/44377 "2025-08-27T11:26:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [August 27, 2025, 11:26am UTC](https://forum.ansible.com/t/trying-to-configure-ecs-taskdefinition-with-ephemeralstorage/44377/1 "2025-08-27T11:26:57Z")

</div>

Hi

I am successfully configuring an ECS Task Definition with `community.aws.ecs_taskdefinition`.  
Now one of the containers needs to have a bigger volume. According to [Fargate task ephemeral storage for Amazon ECS - Amazon Elastic Container Service](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html#fargate-task-storage-linux-pv), this can be done by adding an `ephemeralStorage` parameter.

But this does not seem to be possible using `community.aws.ecs_taskdefinition` - or I don’t know how to do that.

Clearly it’s not supported as a top level parameter for the task:

```console
fatal: [localhost]: FAILED! => changed=false 
  msg: 'Unsupported parameters for (community.aws.ecs_taskdefinition) module: ephemeralStorage. Supported parameters include: access_key, arn, aws_ca_bundle, aws_config, containers, cpu, debug_botocore_endpoint_logs, endpoint_url, execution_role_arn, family, force_create, launch_type, memory, network_mode, placement_constraints, profile, region, revision, runtime_platform, secret_key, session_token, state, task_role_arn, validate_certs, volumes (access_token, aws_access_key, aws_access_key_id, aws_endpoint_url, aws_profile, aws_region, aws_secret_access_key, aws_secret_key, aws_security_token, aws_session_token, ec2_access_key, ec2_region, ec2_secret_key, ec2_url, s3_url, security_token).'

```

and neither as a parameter for the entries in the `containers` list parameter:

```console
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: Unknown parameter in containerDefinitions[1]: "ephemeralStorage", must be one of: name, image, repositoryCredentials, cpu, memory, memoryReservation, links, portMappings, essential, entryPoint, command, environment, environmentFiles, mountPoints, volumesFrom, linuxParameters, secrets, dependsOn, startTimeout, stopTimeout, hostname, user, workingDirectory, disableNetworking, privileged, readonlyRootFilesystem, dnsServers, dnsSearchDomains, extraHosts, dockerSecurityOptions, interactive, pseudoTerminal, dockerLabels, ulimits, logConfiguration, healthCheck, systemControls, resourceRequirements, firelensConfiguration, credentialSpecs
fatal: [localhost]: FAILED! => changed=false 
  boto3_version: 1.34.64
  botocore_version: 1.34.64
  msg: |-
    Failed to register task: Parameter validation failed:
    Unknown parameter in containerDefinitions[1]: "ephemeralStorage", must be one of: name, image, repositoryCredentials, cpu, memory, memoryReservation, links, portMappings, essential, entryPoint, command, environment, environmentFiles, mountPoints, volumesFrom, linuxParameters, secrets, dependsOn, startTimeout, stopTimeout, hostname, user, workingDirectory, disableNetworking, privileged, readonlyRootFilesystem, dnsServers, dnsSearchDomains, extraHosts, dockerSecurityOptions, interactive, pseudoTerminal, dockerLabels, ulimits, logConfiguration, healthCheck, systemControls, resourceRequirements, firelensConfiguration, credentialSpecs

```

Any ideas on how to get this work?

I guess I can just build the JSON structure for the task definition myself and feed that into `aws ecs register-task-definition` but I’d rather not do that unless absolutely necessary…

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [August 27, 2025, 1:05pm UTC](https://forum.ansible.com/t/trying-to-configure-ecs-taskdefinition-with-ephemeralstorage/44377/2 "2025-08-27T13:05:07Z")

</div>

I did some more checking and I’m fairly sure what I want is not supported by `community.aws.ecs_taskdefinition`.  
So, I now have added this extra task after `community.aws.ecs_taskdefinition` that will fetch the task definition, add the required configuration, and then create a new task definition with that. Not ideal, but it does seem to work:

```yaml
- name: Add a custom ehphemeralStorage configuration to the task defintion
  ansible.builtin.shell: # noqa no-changed-when
    cmd: >-
      set -o pipefail &&
      aws ecs register-task-definition --cli-input-json
      "$(aws ecs describe-task-definition --task-definition {{ ecs_task_def.taskdefinition.taskDefinitionArn | quote }} | jq -r '
        .taskDefinition
        | del(.taskDefinitionArn, .revision, .status, .requiresAttributes,.compatibilities, .registeredAt, .registeredBy)
        |. +={ ephemeralStorage: { sizeInGiB: 128 }}' )"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [September 26, 2025, 1:05pm UTC](https://forum.ansible.com/t/trying-to-configure-ecs-taskdefinition-with-ephemeralstorage/44377/3 "2025-09-26T13:05:12Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
