Actions, resources, and condition keys for Amazon Elastic Container Service - Service Authorization Reference

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:

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 of the Actions table indicates whether each action supports resource-level permissions. If there is no value for this column, you must specify all resources ("*") to which the policy applies 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. If the action has one or more required resources, the caller must have permission to use the action with those resources. Required resources are indicated in the table with an asterisk (*). If you limit resource access with the Resource element in an IAM policy, you must include an ARN or pattern for each required resource type. Some actions support multiple resource types. If the resource type is optional (not indicated as required), then you can choose to use one of the optional resource types.

The Condition keys column of the Actions table includes keys that you can specify in a policy statement's Condition element. For more information on the condition keys that are associated with resources for the service, see the Condition keys column of the Resource types table.

Note

Resource condition keys are listed in the Resource types table. You can find a link to the resource type that applies to an action in the Resource types (*required) column of the Actions table. The resource type in the Resource types table includes the Condition keys column, which are the resource condition keys that apply to an action in the Actions table.

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

Actions Description Access level Resource types (*required) Condition keys Dependent actions
CreateCapacityProvider Grants permission to create a new capacity provider. Capacity providers are associated with an Amazon ECS cluster and are used in capacity provider strategies to facilitate cluster auto scaling Write

aws:RequestTag/${TagKey}

aws:TagKeys

CreateCluster Grants permission to create a new Amazon ECS cluster Write

cluster*

aws:RequestTag/${TagKey}

aws:TagKeys

ecs:capacity-provider

CreateService Grants permission to run and maintain a desired number of tasks from a specified task definition via service creation Write

service*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

ecs:cluster

ecs:capacity-provider

ecs:task-definition

ecs:enable-ebs-volumes

ecs:enable-execute-command

ecs:enable-service-connect

ecs:namespace

CreateTaskSet Grants permission to create a new Amazon ECS task set Write

aws:RequestTag/${TagKey}

aws:TagKeys

ecs:cluster

ecs:capacity-provider

ecs:service

ecs:task-definition

DeleteAccountSetting Grants permission to modify 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

ecs:account-setting

DeleteAttributes Grants permission to delete one or more custom attributes from an Amazon ECS resource Write

container-instance*

aws:ResourceTag/${TagKey}

ecs:cluster

DeleteCapacityProvider Grants permission to delete the specified capacity provider Write

capacity-provider*

aws:ResourceTag/${TagKey}

DeleteCluster Grants permission to delete the specified cluster Write

cluster*

aws:ResourceTag/${TagKey}

DeleteService Grants permission to delete a specified service within a cluster Write

service*

aws:ResourceTag/${TagKey}

ecs:cluster

DeleteTaskDefinitions Grants permission to delete the specified task definitions by family and revision Write

task-definition*

aws:ResourceTag/${TagKey}

DeleteTaskSet Grants permission to delete the specified task set Write

task-set*

aws:ResourceTag/${TagKey}

ecs:cluster

ecs:service

DeregisterContainerInstance Grants permission to deregister an Amazon ECS container instance from the specified cluster Write

cluster*

aws:ResourceTag/${TagKey}

DeregisterTaskDefinition Grants permission to deregister the specified task definition by family and revision Write
DescribeCapacityProviders Grants permission to describe one or more Amazon ECS capacity providers Read

capacity-provider*

aws:ResourceTag/${TagKey}

DescribeClusters Grants permission to describes one or more of your clusters Read

cluster*

aws:ResourceTag/${TagKey}

DescribeContainerInstances Grants permission to describes Amazon ECS container instances Read

container-instance*

aws:ResourceTag/${TagKey}

ecs:cluster

DescribeServices Grants permission to describe the specified services running in your cluster Read

service*

aws:ResourceTag/${TagKey}

ecs:cluster

DescribeTaskDefinition Grants permission to describe 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 Grants permission to describe Amazon ECS task sets Read

task-set*

aws:ResourceTag/${TagKey}

ecs:cluster

ecs:service

DescribeTasks Grants permission to describe a specified task or tasks Read

task*

aws:ResourceTag/${TagKey}

ecs:cluster

DiscoverPollEndpoint Grants permission to get an endpoint for the Amazon ECS agent to poll for updates Write
ExecuteCommand Grants permission to run a command remotely on an Amazon ECS container Write

cluster*

task*

aws:ResourceTag/${TagKey}

ecs:cluster

ecs:container-name

ecs:task

GetTaskProtection Grants permission to retrieve the protection status of tasks in an Amazon ECS service Read

task*

aws:ResourceTag/${TagKey}

ecs:cluster

ListAccountSettings Grants permission to list the account settings for an Amazon ECS resource for a specified principal Read
ListAttributes Grants permission to lists the attributes for Amazon ECS resources within a specified target type and cluster List

cluster*

aws:ResourceTag/${TagKey}

ListClusters Grants permission to get a list of existing clusters List
ListContainerInstances Grants permission to get a list of container instances in a specified cluster List

cluster*

aws:ResourceTag/${TagKey}

ListServices Grants permission to get a list of services that are running in a specified cluster List

ecs:cluster

ListServicesByNamespace Grants permission to get a list of services that are running in a specified AWS Cloud Map Namespace List

ecs:namespace

ListTagsForResource Grants permission to get a list of tags for the specified resource Read

capacity-provider

cluster

container-instance

service

task

task-definition

task-set

aws:ResourceTag/${TagKey}

ListTaskDefinitionFamilies Grants permission to get 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 Grants permission to get a list of task definitions that are registered to your account List
ListTasks Grants permission to get a list of tasks for a specified cluster List

container-instance*

aws:ResourceTag/${TagKey}

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 Grants permission to modify 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

ecs:account-setting

PutAccountSettingDefault Grants permission to modify 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

ecs:account-setting

PutAttributes Grants permission to create or update an attribute on an Amazon ECS resource Write

container-instance*

aws:ResourceTag/${TagKey}

ecs:cluster

PutClusterCapacityProviders Grants permission to modify the available capacity providers and the default capacity provider strategy for a cluster Write

cluster*

aws:ResourceTag/${TagKey}

ecs:capacity-provider

RegisterContainerInstance Grants permission to register an EC2 instance into the specified cluster Write

cluster*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

RegisterTaskDefinition Grants permission to register a new task definition from the supplied family and containerDefinitions Write

aws:RequestTag/${TagKey}

aws:TagKeys

RunTask Grants permission to start a task using random placement and the default Amazon ECS scheduler Write

task-definition*

aws:ResourceTag/${TagKey}

aws:RequestTag/${TagKey}

aws:TagKeys

ecs:cluster

ecs:capacity-provider

ecs:enable-ebs-volumes

ecs:enable-execute-command

StartTask Grants permission to start a new task from the specified task definition on the specified container instance or instances Write

task-definition*

aws:ResourceTag/${TagKey}

aws:RequestTag/${TagKey}

aws:TagKeys

ecs:cluster

ecs:container-instances

ecs:enable-ebs-volumes

ecs:enable-execute-command

StartTelemetrySession Grants permission to start a telemetry session Write

container-instance*

ecs:cluster

StopTask Grants permission to stop a running task Write

task*

aws:ResourceTag/${TagKey}

ecs:cluster

SubmitAttachmentStateChanges Grants permission to send an acknowledgement that attachments changed states Write

cluster*

aws:ResourceTag/${TagKey}

SubmitContainerStateChange Grants permission to send an acknowledgement that a container changed states Write

cluster*

aws:ResourceTag/${TagKey}

SubmitTaskStateChange Grants permission to send an acknowledgement that a task changed states Write

cluster*

aws:ResourceTag/${TagKey}

TagResource Grants permission to tag the specified resource Tagging

capacity-provider

cluster

container-instance

service

task

task-definition

task-set

aws:TagKeys

aws:ResourceTag/${TagKey}

aws:RequestTag/${TagKey}

ecs:CreateAction

UntagResource Grants permission to untag the specified resource Tagging

capacity-provider

cluster

container-instance

service

task

task-definition

task-set

aws:ResourceTag/${TagKey}

aws:TagKeys

UpdateCapacityProvider Grants permission to update the specified capacity provider Write

capacity-provider*

aws:ResourceTag/${TagKey}

UpdateCluster Grants permission to modify the configuration or settings to use for a cluster Write

cluster*

aws:ResourceTag/${TagKey}

UpdateClusterSettings Grants permission to modify the settings to use for a cluster Write

cluster*

aws:ResourceTag/${TagKey}

UpdateContainerAgent Grants permission to update the Amazon ECS container agent on a specified container instance Write

container-instance*

aws:ResourceTag/${TagKey}

ecs:cluster

UpdateContainerInstancesState Grants permission to the user to modify the status of an Amazon ECS container instance Write

container-instance*

aws:ResourceTag/${TagKey}

ecs:cluster

UpdateService Grants permission to modify the parameters of a service Write

service*

aws:ResourceTag/${TagKey}

ecs:cluster

ecs:capacity-provider

ecs:enable-ebs-volumes

ecs:enable-execute-command

ecs:enable-service-connect

ecs:namespace

ecs:task-definition

UpdateServicePrimaryTaskSet Grants permission to modify the primary task set used in a service Write

service*

aws:ResourceTag/${TagKey}

ecs:cluster

UpdateTaskProtection Grants permission to modify the protection status of a task Write

task*

aws:ResourceTag/${TagKey}

ecs:cluster

UpdateTaskSet Grants permission to update the specified task set Write

task-set*

aws:ResourceTag/${TagKey}

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 Resource types table. For details about the columns in the following table, see 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/${ClusterName}/${ContainerInstanceId}

aws:ResourceTag/${TagKey}

ecs:ResourceTag/${TagKey}

service arn:${Partition}:ecs:${Region}:${Account}:service/${ClusterName}/${ServiceName}

aws:ResourceTag/${TagKey}

ecs:ResourceTag/${TagKey}

task arn:${Partition}:ecs:${Region}:${Account}:task/${ClusterName}/${TaskId}

aws:ResourceTag/${TagKey}

ecs:ResourceTag/${TagKey}

task-definition arn:${Partition}:ecs:${Region}:${Account}:task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevisionNumber}

aws:ResourceTag/${TagKey}

ecs:ResourceTag/${TagKey}

capacity-provider arn:${Partition}:ecs:${Region}:${Account}:capacity-provider/${CapacityProviderName}

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 Condition keys table.

To view the global condition keys that are available to all services, see Available global condition keys.

Condition keys Description Type
aws:RequestTag/${TagKey} Filters access by the tags that are passed in the request String
aws:ResourceTag/${TagKey} Filters access by the tag key-value pairs attached to the resource String
aws:TagKeys Filters access by the tag keys that are passed in the request ArrayOfString
ecs:CreateAction Filters access by the name of a resource-creating API action String
ecs:ResourceTag/${TagKey} Filters access by the tag key-value pairs attached to the resource String
ecs:account-setting Filters access by the Amazon ECS account setting name String
ecs:capacity-provider Filters access by the ARN of an Amazon ECS capacity provider ARN
ecs:cluster Filters access by the ARN of an Amazon ECS cluster ARN
ecs:container-instances Filters access by the ARN of an Amazon ECS container instance ARN
ecs:container-name Filters access by the name of an Amazon ECS container which is defined in the ECS task definition String
ecs:enable-ebs-volumes Filters access by the Amazon ECS managed Amazon EBS volume capability of your ECS task or service String
ecs:enable-execute-command Filters access by the execute-command capability of your Amazon ECS task or Amazon ECS service String
ecs:enable-service-connect Filters access by the enable field value in the Service Connect configuration String
ecs:namespace Filters access by the ARN of AWS Cloud Map namespace which is defined in the Service Connect Configuration ARN
ecs:service Filters access by the ARN of an Amazon ECS service ARN
ecs:task Filters access by the ARN of an Amazon ECS task ARN
ecs:task-definition Filters access by the ARN of an Amazon ECS task definition ARN