terraform-aws-ecs-alb-service-task icon indicating copy to clipboard operation
terraform-aws-ecs-alb-service-task copied to clipboard

Error when adding EFS volumes: When the volume parameter is specified, only one volume configuration type should be used.

Open richstokes opened this issue 2 years ago • 4 comments

Error: failed creating ECS Task Definition: ClientException: When the volume parameter is specified, only one volume configuration type should be used.

Terraform plan generates a change to the task definition which adds this:


      volume {

          host_path = "/test123"

          name      = "test123-efs"

 

          efs_volume_configuration {

              file_system_id          = "fs-123123123"

              root_directory          = "/test123"

              transit_encryption      = "ENABLED"

              transit_encryption_port = 2999

 

              authorization_config {

                  access_point_id = "fsap-123123123"

                  iam             = "DISABLED"

                }

            }

What actually works in AWS (by directly editing the JSON of a task), is this:


 

    "volumes": [

    {

      "fsxWindowsFileServerVolumeConfiguration": null,

      "efsVolumeConfiguration": {

        "transitEncryptionPort": null,

        "fileSystemId": "fs-123123123",

        "authorizationConfig": {

          "iam": "DISABLED",

          "accessPointId": "fsap-123123123"

        },

        "transitEncryption": "ENABLED",

        "rootDirectory": "/"

      },

      "name": "efs2",

      "host": null,

      "dockerVolumeConfiguration": null

    }

  ]

You can see the attribute names are slightly different, I'm not sure how much of that terraform translates, and how much is pointing to a bug with the module?

Currently on version 0.66.2 of the module, with terraform 1.3.2. Pretty confused since we do only have one volume configuration type set.

richstokes avatar Jan 11 '23 17:01 richstokes

Also of note, is the module requires the host_path directive with efs volume mounts, but that is specific to bind mounts, I believe and should not be set here.

richstokes avatar Jan 11 '23 17:01 richstokes

Confirmed, if you set host_path to null, it works

richstokes avatar Jan 11 '23 18:01 richstokes

@richstokes Thanks Rich! This is still a thing with the current version of this module. host_path null was a great suggestion and resolved my issue.

greg-pluto avatar Mar 22 '24 17:03 greg-pluto