{
  "typeName" : "AWS::ECS::TaskDefinition",
  "description" : "Resource Schema describing various properties for ECS TaskDefinition",
  "sourceUrl" : "https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html",
  "definitions" : {
    "ContainerDefinition" : {
      "description" : "List of container definitions that are passed to the Docker daemon on a container instance",
      "type" : "object",
      "required" : [ "Name", "Image" ],
      "properties" : {
        "Command" : {
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Cpu" : {
          "type" : "integer"
        },
        "DependsOn" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/ContainerDependency"
          }
        },
        "DisableNetworking" : {
          "type" : "boolean"
        },
        "DnsSearchDomains" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "DnsServers" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "DockerLabels" : {
          "type" : "object",
          "patternProperties" : {
            ".{1,}" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        },
        "DockerSecurityOptions" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "EntryPoint" : {
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Environment" : {
          "description" : "The environment variables to pass to a container",
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/KeyValuePair"
          }
        },
        "EnvironmentFiles" : {
          "description" : "The list of one or more files that contain the environment variables to pass to a container",
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "$ref" : "#/definitions/EnvironmentFile"
          }
        },
        "Essential" : {
          "type" : "boolean"
        },
        "ExtraHosts" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/HostEntry"
          }
        },
        "FirelensConfiguration" : {
          "$ref" : "#/definitions/FirelensConfiguration"
        },
        "HealthCheck" : {
          "$ref" : "#/definitions/HealthCheck"
        },
        "Hostname" : {
          "type" : "string"
        },
        "Image" : {
          "description" : "The image used to start a container. This string is passed directly to the Docker daemon.",
          "type" : "string"
        },
        "Links" : {
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        },
        "LinuxParameters" : {
          "$ref" : "#/definitions/LinuxParameters"
        },
        "LogConfiguration" : {
          "$ref" : "#/definitions/LogConfiguration"
        },
        "Memory" : {
          "description" : "The amount (in MiB) of memory to present to the container. If your container attempts to exceed the memory specified here, the container is killed.",
          "type" : "integer"
        },
        "MemoryReservation" : {
          "type" : "integer"
        },
        "MountPoints" : {
          "type" : "array",
          "insertionOrder" : true,
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/MountPoint"
          }
        },
        "Name" : {
          "description" : "The name of a container. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed",
          "type" : "string"
        },
        "PortMappings" : {
          "description" : "Port mappings allow containers to access ports on the host container instance to send or receive traffic.",
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/PortMapping"
          }
        },
        "Privileged" : {
          "type" : "boolean"
        },
        "ReadonlyRootFilesystem" : {
          "type" : "boolean"
        },
        "RepositoryCredentials" : {
          "$ref" : "#/definitions/RepositoryCredentials"
        },
        "ResourceRequirements" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/ResourceRequirement"
          }
        },
        "Secrets" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Secret"
          }
        },
        "StartTimeout" : {
          "type" : "integer"
        },
        "StopTimeout" : {
          "type" : "integer"
        },
        "Ulimits" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Ulimit"
          }
        },
        "User" : {
          "type" : "string"
        },
        "VolumesFrom" : {
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/VolumeFrom"
          }
        },
        "WorkingDirectory" : {
          "type" : "string"
        },
        "Interactive" : {
          "type" : "boolean"
        },
        "PseudoTerminal" : {
          "type" : "boolean"
        },
        "SystemControls" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/SystemControl"
          }
        }
      },
      "additionalProperties" : false
    },
    "SystemControl" : {
      "type" : "object",
      "properties" : {
        "Namespace" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "ContainerDependency" : {
      "type" : "object",
      "properties" : {
        "ContainerName" : {
          "type" : "string"
        },
        "Condition" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Device" : {
      "type" : "object",
      "properties" : {
        "ContainerPath" : {
          "type" : "string"
        },
        "HostPath" : {
          "type" : "string"
        },
        "Permissions" : {
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : true,
          "items" : {
            "type" : "string"
          }
        }
      },
      "additionalProperties" : false
    },
    "DockerVolumeConfiguration" : {
      "type" : "object",
      "properties" : {
        "Autoprovision" : {
          "type" : "boolean"
        },
        "Driver" : {
          "type" : "string"
        },
        "DriverOpts" : {
          "type" : "object",
          "patternProperties" : {
            ".{1,}" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        },
        "Labels" : {
          "type" : "object",
          "patternProperties" : {
            ".{1,}" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        },
        "Scope" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "AuthorizationConfig" : {
      "type" : "object",
      "properties" : {
        "IAM" : {
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "AccessPointId" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "EFSVolumeConfiguration" : {
      "type" : "object",
      "required" : [ "FilesystemId" ],
      "properties" : {
        "FilesystemId" : {
          "type" : "string"
        },
        "RootDirectory" : {
          "type" : "string"
        },
        "TransitEncryption" : {
          "type" : "string",
          "enum" : [ "ENABLED", "DISABLED" ]
        },
        "TransitEncryptionPort" : {
          "type" : "integer"
        },
        "AuthorizationConfig" : {
          "$ref" : "#/definitions/AuthorizationConfig"
        }
      },
      "additionalProperties" : false
    },
    "EnvironmentFile" : {
      "type" : "object",
      "properties" : {
        "Value" : {
          "type" : "string"
        },
        "Type" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "EphemeralStorage" : {
      "type" : "object",
      "properties" : {
        "SizeInGiB" : {
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    },
    "FirelensConfiguration" : {
      "type" : "object",
      "properties" : {
        "Type" : {
          "type" : "string"
        },
        "Options" : {
          "type" : "object",
          "patternProperties" : {
            ".{1,}" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        }
      },
      "additionalProperties" : false
    },
    "HealthCheck" : {
      "description" : "The health check command and associated configuration parameters for the container.",
      "type" : "object",
      "properties" : {
        "Command" : {
          "description" : "A string array representing the command that the container runs to determine if it is healthy.",
          "type" : "array",
          "insertionOrder" : true,
          "items" : {
            "type" : "string"
          }
        },
        "Interval" : {
          "description" : "The time period in seconds between each health check execution. You may specify between 5 and 300 seconds. The default value is 30 seconds.",
          "type" : "integer"
        },
        "Timeout" : {
          "description" : "The time period in seconds to wait for a health check to succeed before it is considered a failure. You may specify between 2 and 60 seconds. The default value is 5 seconds.",
          "type" : "integer"
        },
        "Retries" : {
          "description" : "The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries. The default value is three retries.",
          "type" : "integer"
        },
        "StartPeriod" : {
          "description" : "The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries. You may specify between 0 and 300 seconds. The startPeriod is disabled by default.",
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    },
    "HostEntry" : {
      "type" : "object",
      "properties" : {
        "Hostname" : {
          "type" : "string"
        },
        "IpAddress" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "HostVolumeProperties" : {
      "type" : "object",
      "properties" : {
        "SourcePath" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "InferenceAccelerator" : {
      "type" : "object",
      "properties" : {
        "DeviceName" : {
          "type" : "string"
        },
        "DeviceType" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "KernelCapabilities" : {
      "type" : "object",
      "properties" : {
        "Add" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "Drop" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        }
      },
      "additionalProperties" : false
    },
    "KeyValuePair" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "LinuxParameters" : {
      "type" : "object",
      "properties" : {
        "Capabilities" : {
          "$ref" : "#/definitions/KernelCapabilities"
        },
        "Devices" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Device"
          }
        },
        "InitProcessEnabled" : {
          "type" : "boolean"
        },
        "MaxSwap" : {
          "type" : "integer"
        },
        "SharedMemorySize" : {
          "type" : "integer"
        },
        "Swappiness" : {
          "type" : "integer"
        },
        "Tmpfs" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Tmpfs"
          }
        }
      },
      "additionalProperties" : false
    },
    "LogConfiguration" : {
      "type" : "object",
      "required" : [ "LogDriver" ],
      "properties" : {
        "LogDriver" : {
          "type" : "string"
        },
        "Options" : {
          "type" : "object",
          "patternProperties" : {
            ".{1,}" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        },
        "SecretOptions" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Secret"
          }
        }
      },
      "additionalProperties" : false
    },
    "PortMapping" : {
      "type" : "object",
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "ContainerPort" : {
          "type" : "integer"
        },
        "ContainerPortRange" : {
          "type" : "string"
        },
        "HostPort" : {
          "type" : "integer"
        },
        "Protocol" : {
          "type" : "string"
        },
        "AppProtocol" : {
          "type" : "string",
          "enum" : [ "http", "http2", "grpc" ]
        }
      },
      "additionalProperties" : false
    },
    "MountPoint" : {
      "type" : "object",
      "properties" : {
        "ContainerPath" : {
          "type" : "string"
        },
        "ReadOnly" : {
          "type" : "boolean"
        },
        "SourceVolume" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "ProxyConfiguration" : {
      "type" : "object",
      "required" : [ "ContainerName" ],
      "properties" : {
        "ContainerName" : {
          "type" : "string"
        },
        "ProxyConfigurationProperties" : {
          "type" : "array",
          "insertionOrder" : false,
          "uniqueItems" : true,
          "items" : {
            "$ref" : "#/definitions/KeyValuePair"
          }
        },
        "Type" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "RepositoryCredentials" : {
      "type" : "object",
      "properties" : {
        "CredentialsParameter" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "ResourceRequirement" : {
      "type" : "object",
      "required" : [ "Type", "Value" ],
      "properties" : {
        "Type" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "RuntimePlatform" : {
      "type" : "object",
      "properties" : {
        "CpuArchitecture" : {
          "type" : "string"
        },
        "OperatingSystemFamily" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Secret" : {
      "type" : "object",
      "required" : [ "Name", "ValueFrom" ],
      "properties" : {
        "Name" : {
          "type" : "string"
        },
        "ValueFrom" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "TaskDefinitionPlacementConstraint" : {
      "type" : "object",
      "required" : [ "Type" ],
      "properties" : {
        "Type" : {
          "type" : "string"
        },
        "Expression" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Tmpfs" : {
      "type" : "object",
      "required" : [ "Size" ],
      "properties" : {
        "ContainerPath" : {
          "type" : "string"
        },
        "MountOptions" : {
          "type" : "array",
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "Size" : {
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    },
    "Ulimit" : {
      "type" : "object",
      "required" : [ "HardLimit", "Name", "SoftLimit" ],
      "properties" : {
        "HardLimit" : {
          "type" : "integer"
        },
        "Name" : {
          "type" : "string"
        },
        "SoftLimit" : {
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    },
    "Volume" : {
      "type" : "object",
      "properties" : {
        "DockerVolumeConfiguration" : {
          "$ref" : "#/definitions/DockerVolumeConfiguration"
        },
        "EFSVolumeConfiguration" : {
          "$ref" : "#/definitions/EFSVolumeConfiguration"
        },
        "Host" : {
          "$ref" : "#/definitions/HostVolumeProperties"
        },
        "Name" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "VolumeFrom" : {
      "type" : "object",
      "properties" : {
        "ReadOnly" : {
          "type" : "boolean"
        },
        "SourceContainer" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string"
        },
        "Value" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    }
  },
  "additionalProperties" : false,
  "properties" : {
    "TaskDefinitionArn" : {
      "description" : "The Amazon Resource Name (ARN) of the Amazon ECS task definition",
      "type" : "string"
    },
    "Family" : {
      "type" : "string"
    },
    "ContainerDefinitions" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/ContainerDefinition"
      }
    },
    "Cpu" : {
      "type" : "string"
    },
    "ExecutionRoleArn" : {
      "type" : "string"
    },
    "EphemeralStorage" : {
      "$ref" : "#/definitions/EphemeralStorage"
    },
    "InferenceAccelerators" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/InferenceAccelerator"
      }
    },
    "Memory" : {
      "type" : "string"
    },
    "NetworkMode" : {
      "type" : "string"
    },
    "PlacementConstraints" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/TaskDefinitionPlacementConstraint"
      }
    },
    "ProxyConfiguration" : {
      "$ref" : "#/definitions/ProxyConfiguration"
    },
    "RequiresCompatibilities" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "type" : "string"
      }
    },
    "TaskRoleArn" : {
      "type" : "string"
    },
    "Volumes" : {
      "type" : "array",
      "insertionOrder" : false,
      "uniqueItems" : true,
      "items" : {
        "$ref" : "#/definitions/Volume"
      }
    },
    "PidMode" : {
      "type" : "string"
    },
    "RuntimePlatform" : {
      "$ref" : "#/definitions/RuntimePlatform"
    },
    "IpcMode" : {
      "type" : "string"
    },
    "Tags" : {
      "type" : "array",
      "insertionOrder" : false,
      "items" : {
        "$ref" : "#/definitions/Tag"
      }
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "cloudFormationSystemTags" : true,
    "tagProperty" : "/properties/Tags"
  },
  "createOnlyProperties" : [ "/properties/Family", "/properties/ContainerDefinitions", "/properties/Cpu", "/properties/ExecutionRoleArn", "/properties/InferenceAccelerators", "/properties/Memory", "/properties/NetworkMode", "/properties/PlacementConstraints", "/properties/ProxyConfiguration", "/properties/RequiresCompatibilities", "/properties/RuntimePlatform", "/properties/TaskRoleArn", "/properties/Volumes", "/properties/PidMode", "/properties/IpcMode", "/properties/EphemeralStorage" ],
  "readOnlyProperties" : [ "/properties/TaskDefinitionArn" ],
  "primaryIdentifier" : [ "/properties/TaskDefinitionArn" ],
  "propertyTransform" : {
    "/properties/TaskRoleArn" : "$split(TaskRoleArn, \"role/\")[-1]"
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "ecs:RegisterTaskDefinition", "iam:GetRole", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "ecs:DescribeTaskDefinition" ]
    },
    "update" : {
      "permissions" : [ "ecs:TagResource", "ecs:UntagResource", "ecs:ListTagsForResource", "iam:GetRole", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "ecs:DeregisterTaskDefinition", "iam:GetRole", "iam:PassRole" ]
    },
    "list" : {
      "permissions" : [ "ecs:ListTaskDefinitions", "ecs:DescribeTaskDefinition" ]
    }
  }
}