Actions, Resources, and Condition Keys for Amazon Elastic Container Service - AWS Identity and Access Management
Keywords: IAM,AWS Identity and Access Management,IAM user,user,IAM group,group,IAM role,role,permission policy,trust policy,policy,access key,password

Did this page help you? - Yes

Thanks for letting us know we're doing a good job!

If you've got a moment, please tell us what we did right so we can do more of it.

Did this page help you? - No

Thanks for letting us know this page needs work. We're sorry we let you down.

If you've got a moment, please tell us how we can make the documentation better.

# Actions, Resources, and Condition Keys for Amazon Elastic Container Service

Amazon Elastic Container Service (service prefix: `ecs` ) provides the following service-specific resources, actions, and condition context keys for use in IAM permission policies.

References:

- Learn how to configure this service .

- View a list of the API operations available for this service .

- Learn how to secure this service and its resources by using IAM permission policies.

Topics

- Actions Defined by Amazon Elastic Container Service
- Resource Types Defined by Amazon Elastic Container Service
- Condition Keys for Amazon Elastic Container Service

## Actions Defined by Amazon Elastic Container Service

You can specify the following actions in the `Action` element of an IAM policy statement. Use policies to grant permissions to perform an operation in AWS. When you use an action in a policy, you usually allow or deny access to the API operation or CLI command with the same name. However, in some cases, a single action controls access to more than one operation. Alternatively, some operations require several different actions.

The Resource Types column indicates whether each action supports resource-level permissions. If there is no value for this column, you must specify all resources ("*") in the `Resource` element of your policy statement. If the column includes a resource type, then you can specify an ARN of that type in a statement with that action. Required resources are indicated in the table with an asterisk (*). If you specify a resource-level permission ARN in a statement using this action, then it must be of this type. Some actions support multiple resource types. If the resource type is optional (not indicated as required), then you can choose to use one but not the other.

For details about the columns in the following table, see The Actions Table .

Actions | Description | Access Level | Resource Types (*required) | Condition Keys | Dependent Actions
--- | --- | --- | --- | --- | ---
CreateCluster | Creates a new Amazon ECS cluster. | Write |  | aws:RequestTag/${TagKey} aws:TagKeys |
CreateService | Runs and maintains a desired number of tasks from a specified task definition. | Write | service* |  |
| ecs:cluster ecs:task-definition aws:RequestTag/${TagKey} aws:TagKeys |
CreateTaskSet | Creates a new Amazon ECS task set. | Write |  | ecs:cluster ecs:service ecs:task-definition |
DeleteAccountSetting | Modifies the ARN and resource ID format of a resource for a specified IAM user, IAM role, or the root user for an account. You can specify whether the new ARN and resource ID format are disabled for new resources that are created. | Write |  |  |
DeleteAttributes | Deletes one or more custom attributes from an Amazon ECS resource. | Write | container-instance* |  |
| ecs:cluster |
DeleteCluster | Deletes the specified cluster. | Write | cluster* |  |
DeleteService | Deletes a specified service within a cluster. | Write | service* |  |
| ecs:cluster |
DeleteTaskSet | Deletes the specified task set. | Write | task-set* |  |
| ecs:cluster ecs:service |
DeregisterContainerInstance | Deregisters an Amazon ECS container instance from the specified cluster. | Write | cluster* |  |
DeregisterTaskDefinition | Deregisters the specified task definition by family and revision. | Write |  |  |
DescribeClusters | Describes one or more of your clusters. | Read | cluster* |  |
DescribeContainerInstances | Describes Amazon ECS container instances. | Read | container-instance* |  |
| ecs:cluster |
DescribeServices | Describes the specified services running in your cluster. | Read | service* |  |
| ecs:cluster |
DescribeTaskDefinition | Describes a task definition. You can specify a family and revision to find information about a specific task definition, or you can simply specify the family to find the latest ACTIVE revision in that family. | Read |  |  |
DescribeTaskSets | Describes Amazon ECS task sets. | Read | task-set* |  |
| ecs:cluster ecs:service |
DescribeTasks | Describes a specified task or tasks. | Read | task* |  |
| ecs:cluster |
DiscoverPollEndpoint | Returns an endpoint for the Amazon ECS agent to poll for updates. | Write |  |  |
ListAccountSettings | Lists the account settings for an Amazon ECS resource for a specified principal. | List |  |  |
ListAttributes | Lists the attributes for Amazon ECS resources within a specified target type and cluster. | List | cluster* |  |
ListClusters | Returns a list of existing clusters. | List |  |  |
ListContainerInstances | Returns a list of container instances in a specified cluster. | List | cluster* |  |
ListServices | Lists the services that are running in a specified cluster. | List |  | ecs:cluster |
ListTagsForResource | List tags for the specified resource. | List | cluster |  |
container-instance |  |
task |  |
task-definition |  |
ListTaskDefinitionFamilies | Returns a list of task definition families that are registered to your account (which may include task definition families that no longer have any ACTIVE task definitions). | List |  |  |
ListTaskDefinitions | Returns a list of task definitions that are registered to your account. | List |  |  |
ListTasks | Returns a list of tasks for a specified cluster. | List | container-instance* |  |
| ecs:cluster |
Poll [permission only] | Grants permission to an agent to connect with the Amazon ECS service to report status and get commands. | Write | container-instance* |  |
| ecs:cluster |
PutAccountSetting | Modifies the ARN and resource ID format of a resource for a specified IAM user, IAM role, or the root user for an account. You can specify whether the new ARN and resource ID format are enabled for new resources that are created. Enabling this setting is required to use new Amazon ECS features such as resource tagging. | Write |  |  |
PutAccountSettingDefault | Modifies the ARN and resource ID format of a resource type for all IAM users on an account for which no individual account setting has been set. Enabling this setting is required to use new Amazon ECS features such as resource tagging. | Write |  |  |
PutAttributes | Create or update an attribute on an Amazon ECS resource. | Write | container-instance* |  |
| ecs:cluster |
RegisterContainerInstance | Registers an EC2 instance into the specified cluster. | Write | cluster* |  |
| aws:RequestTag/${TagKey} aws:TagKeys |
RegisterTaskDefinition | Registers a new task definition from the supplied family and containerDefinitions. | Write |  | aws:RequestTag/${TagKey} aws:TagKeys |
RunTask | Start a task using random placement and the default Amazon ECS scheduler. | Write | task-definition* |  |
| ecs:cluster aws:RequestTag/${TagKey} aws:TagKeys |
StartTask | Starts a new task from the specified task definition on the specified container instance or instances. | Write | task-definition* |  |
| ecs:cluster ecs:container-instances aws:RequestTag/${TagKey} aws:TagKeys |
StartTelemetrySession | Grants permission to start a telemetry session. | Write | container-instance* |  |
| ecs:cluster |
StopTask | Stops a running task. | Write | task* |  |
| ecs:cluster |
SubmitAttachmentStateChanges | Sent to acknowledge that attachments changed states. | Write | cluster* |  |
SubmitContainerStateChange | Sent to acknowledge that a container changed states. | Write | cluster* |  |
SubmitTaskStateChange | Sent to acknowledge that a task changed states. | Write | cluster* |  |
TagResource | Tags the specified resource. | Tagging | cluster |  |
container-instance |  |
service |  |
task |  |
task-definition |  |
| aws:TagKeys aws:RequestTag/${TagKey} |
UntagResource | Untags the specified resource. | Tagging | cluster |  |
container-instance |  |
service |  |
task |  |
task-definition |  |
| aws:TagKeys |
UpdateContainerAgent | Updates the Amazon ECS container agent on a specified container instance. | Write | container-instance* |  |
| ecs:cluster |
UpdateContainerInstancesState | Enables the user to modify the status of an Amazon ECS container instance. | Write | container-instance* |  |
| ecs:cluster |
UpdateService | Modifies the desired count, deployment configuration, or task definition used in a service. | Write | service* |  |
| ecs:cluster ecs:task-definition |
UpdateServicePrimaryTaskSet | Modifies the primary task set used in a service. | Write | service* |  |
| ecs:cluster |
UpdateTaskSet | Updates the specified task set. | Write | task-set* |  |
| ecs:cluster ecs:service |

## Resource Types Defined by Amazon Elastic Container Service

The following resource types are defined by this service and can be used in the `Resource` element of IAM permission policy statements. Each action in the Actions table identifies the resource types that can be specified with that action. A resource type can also define which condition keys you can include in a policy. These keys are displayed in the last column of the table. For details about the columns in the following table, see The Resource Types Table .

Resource Types | ARN | Condition Keys
--- | --- | ---
cluster | `arn:$ { Partition}:ecs:$ { Region}:$ { Account}:cluster/$ { ClusterName}` | aws:ResourceTag/${TagKey} ecs:ResourceTag/${TagKey}
container-instance | `arn:$ { Partition}:ecs:$ { Region}:$ { Account}:container-instance/$ { ContainerInstanceId}` | aws:ResourceTag/${TagKey} ecs:ResourceTag/${TagKey}
service | `arn:$ { Partition}:ecs:$ { Region}:$ { Account}:service/$ { ServiceName}` | aws:ResourceTag/${TagKey} ecs:ResourceTag/${TagKey}
task | `arn:$ { Partition}:ecs:$ { Region}:$ { Account}:task/$ { TaskId}` | aws:ResourceTag/${TagKey} ecs:ResourceTag/${TagKey}
task-definition | `arn:$ { Partition}:ecs:$ { Region}:$ { Account}:task-definition/$ { TaskDefinitionFamilyName}:$ { TaskDefinitionRevisionNumber}` | aws:ResourceTag/${TagKey} ecs:ResourceTag/${TagKey}
task-set | `arn:$ { Partition}:ecs:$ { region}:$ { Account}:task-set/$ { ClusterName}/$ { ServiceName}/$ { TaskSetId}` | aws:ResourceTag/${TagKey} ecs:ResourceTag/${TagKey}

## Condition Keys for Amazon Elastic Container Service

Amazon Elastic Container Service defines the following condition keys that can be used in the `Condition` element of an IAM policy. You can use these keys to further refine the conditions under which the policy statement applies. For details about the columns in the following table, see The Condition Keys Table .

To view the global condition keys that are available to all services, see Available Global Condition Keys in the IAM Policy Reference .

Condition Keys | Description | Type
--- | --- | ---
aws:RequestTag/$ { TagKey} |  | String
aws:ResourceTag/$ { TagKey} |  | String
aws:TagKeys |  | String
ecs:ResourceTag/$ { TagKey} |  | String
ecs:cluster | The ARN of an ECS cluster. | ARN
ecs:container-instances | The ARN of an ECS container instance. | ARN
ecs:service | The ARN of an ECS service. | ARN
ecs:task-definition | The ARN of an ECS task definition. | ARN