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
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 |
---|---|---|---|---|---|
CreateCapacityProvider | Creates 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 | |||
CreateCluster | Creates a new Amazon ECS cluster. | Write | |||
CreateService | Runs and maintains a desired number of tasks from a specified task definition. | Write | |||
CreateTaskSet | Creates a new Amazon ECS task set. | Write | |||
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 | |||
DeleteCapacityProvider | Deletes the specified capacity provider. | Write | |||
DeleteCluster | Deletes the specified cluster. | Write | |||
DeleteService | Deletes a specified service within a cluster. | Write | |||
DeleteTaskSet | Deletes the specified task set. | Write | |||
DeregisterContainerInstance | Deregisters an Amazon ECS container instance from the specified cluster. | Write | |||
DeregisterTaskDefinition | Deregisters the specified task definition by family and revision. | Write | |||
DescribeCapacityProviders | Describes one or more Amazon ECS capacity providers. | Read | |||
DescribeClusters | Describes one or more of your clusters. | Read | |||
DescribeContainerInstances | Describes Amazon ECS container instances. | Read | |||
DescribeServices | Describes the specified services running in your cluster. | Read | |||
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 | |||
DescribeTasks | Describes a specified task or tasks. | Read | |||
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 | |||
ListClusters | Returns a list of existing clusters. | List | |||
ListContainerInstances | Returns a list of container instances in a specified cluster. | List | |||
ListServices | Lists the services that are running in a specified cluster. | List | |||
ListTagsForResource | List tags for the specified resource. | List | |||
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 | |||
Poll [permission only] | Grants permission to an agent to connect with the Amazon ECS service to report status and get commands. | Write | |||
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 | |||
PutClusterCapacityProviders | Modifies the available capacity providers and the default capacity provider strategy for a cluster. | Write | |||
RegisterContainerInstance | Registers an EC2 instance into the specified cluster. | Write | |||
RegisterTaskDefinition | Registers a new task definition from the supplied family and containerDefinitions. | Write | |||
RunTask | Start a task using random placement and the default Amazon ECS scheduler. | Write | |||
StartTask | Starts a new task from the specified task definition on the specified container instance or instances. | Write | |||
StartTelemetrySession | Grants permission to start a telemetry session. | Write | |||
StopTask | Stops a running task. | Write | |||
SubmitAttachmentStateChanges | Sent to acknowledge that attachments changed states. | Write | |||
SubmitContainerStateChange | Sent to acknowledge that a container changed states. | Write | |||
SubmitTaskStateChange | Sent to acknowledge that a task changed states. | Write | |||
TagResource | Tags the specified resource. | Tagging | |||
UntagResource | Untags the specified resource. | Tagging | |||
UpdateClusterSettings | Modifies the settings to use for a cluster. | Write | |||
UpdateContainerAgent | Updates the Amazon ECS container agent on a specified container instance. | Write | |||
UpdateContainerInstancesState | Enables the user to modify the status of an Amazon ECS container instance. | Write | |||
UpdateService | Modifies the parameters of a service. | Write | |||
UpdateServicePrimaryTaskSet | Modifies the primary task set used in a service. | Write | |||
UpdateTaskSet | Updates the specified task set. | Write | |||
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}
|
|
container-instance |
arn:${Partition}:ecs:${Region}:${Account}:container-instance/${ContainerInstanceId}
|
|
service |
arn:${Partition}:ecs:${Region}:${Account}:service/${ServiceName}
|
|
task |
arn:${Partition}:ecs:${Region}:${Account}:task/${TaskId}
|
|
task-definition |
arn:${Partition}:ecs:${Region}:${Account}:task-definition/${TaskDefinitionFamilyName}:${TaskDefinitionRevisionNumber}
|
|
capacity-provider |
arn:${Partition}:ecs:${Region}:${Account}:capacity-provider/${CapacityProviderName}
|
|
task-set |
arn:${Partition}:ecs:${region}:${Account}:task-set/${ClusterName}/${ServiceName}/${TaskSetId}
|
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.
Condition keys | Description | Type |
---|---|---|
aws:RequestTag/${TagKey} | Filters actions based on the presence of tag key-value pairs in the request. | String |
aws:ResourceTag/${TagKey} | Filters actions based on tag key-value pairs attached to the resource. | String |
aws:TagKeys | Filters actions based on the presence of tag keys in the request. | String |
ecs:ResourceTag/${TagKey} | Filters actions based on tag key-value pairs attached to the resource. | String |
ecs:capacity-provider | The ARN of an Amazon ECS capacity provider. | ARN |
ecs:cluster | The ARN of an Amazon ECS cluster. | ARN |
ecs:container-instances | The ARN of an Amazon ECS container instance. | ARN |
ecs:service | The ARN of an Amazon ECS service. | ARN |
ecs:task-definition | The ARN of an Amazon ECS task definition. | ARN |