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 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 | |||
CreateCluster | Grants permission to create a new Amazon ECS cluster | Write | |||
CreateService | Grants permission to run and maintain a desired number of tasks from a specified task definition via service creation | Write | |||
CreateTaskSet | Grants permission to create a new Amazon ECS task set | Write | |||
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 | |||
DeleteAttributes | Grants permission to delete one or more custom attributes from an Amazon ECS resource | Write | |||
DeleteCapacityProvider | Grants permission to delete the specified capacity provider | Write | |||
DeleteCluster | Grants permission to delete the specified cluster | Write | |||
DeleteService | Grants permission to delete a specified service within a cluster | Write | |||
DeleteTaskDefinitions | Grants permission to delete the specified task definitions by family and revision | Write | |||
DeleteTaskSet | Grants permission to delete the specified task set | Write | |||
DeregisterContainerInstance | Grants permission to deregister an Amazon ECS container instance from the specified cluster | Write | |||
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 | |||
DescribeClusters | Grants permission to describes one or more of your clusters | Read | |||
DescribeContainerInstances | Grants permission to describes Amazon ECS container instances | Read | |||
DescribeServiceDeployments | Grants permission to describe one or more of your service deployments | Read | |||
DescribeServiceRevisions | Grants permission to describe one or more of your service revisions | Read | |||
DescribeServices | Grants permission to describe the specified services running in your cluster | Read | |||
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 | |||
DescribeTasks | Grants permission to describe a specified task or tasks | Read | |||
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 | |||
GetTaskProtection | Grants permission to retrieve the protection status of tasks in an Amazon ECS service | Read | |||
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 | |||
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 | |||
ListServiceDeployments | Grants permission to get a list of service deployments for a specified service | List | |||
ListServices | Grants permission to get a list of services that are running in a specified cluster | List | |||
ListServicesByNamespace | Grants permission to get a list of services that are running in a specified AWS Cloud Map Namespace | List | |||
ListTagsForResource | Grants permission to get a list of tags for the specified resource | Read | |||
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 | |||
Poll [permission only] | Grants permission to an agent to connect with the Amazon ECS service to report status and get commands | Write | |||
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 | |||
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 | |||
PutAttributes | Grants permission to create or update an attribute on an Amazon ECS resource | Write | |||
PutClusterCapacityProviders | Grants permission to modify the available capacity providers and the default capacity provider strategy for a cluster | Write | |||
RegisterContainerInstance | Grants permission to register an EC2 instance into the specified cluster | Write | |||
RegisterTaskDefinition | Grants permission to register a new task definition from the supplied family and containerDefinitions | Write | |||
RunTask | Grants permission to start a task using random placement and the default Amazon ECS scheduler | Write |
iam:PassRole |
||
StartTask | Grants permission to start a new task from the specified task definition on the specified container instance or instances | Write |
iam:PassRole |
||
StartTelemetrySession | Grants permission to start a telemetry session | Write | |||
StopTask | Grants permission to stop a running task | Write | |||
SubmitAttachmentStateChanges | Grants permission to send an acknowledgement that attachments changed states | Write | |||
SubmitContainerStateChange | Grants permission to send an acknowledgement that a container changed states | Write | |||
SubmitTaskStateChange | Grants permission to send an acknowledgement that a task changed states | Write | |||
TagResource | Grants permission to tag the specified resource | Tagging | |||
UntagResource | Grants permission to untag the specified resource | Tagging | |||
UpdateCapacityProvider | Grants permission to update the specified capacity provider | Write | |||
UpdateCluster | Grants permission to modify the configuration or settings to use for a cluster | Write | |||
UpdateClusterSettings | Grants permission to modify the settings to use for a cluster | Write | |||
UpdateContainerAgent | Grants permission to update the Amazon ECS container agent on a specified container instance | Write | |||
UpdateContainerInstancesState | Grants permission to the user to modify the status of an Amazon ECS container instance | Write | |||
UpdateService | Grants permission to modify the parameters of a service | Write | |||
UpdateServicePrimaryTaskSet | Grants permission to modify the primary task set used in a service | Write | |||
UpdateTaskProtection | Grants permission to modify the protection status of a task | Write | |||
UpdateTaskSet | Grants permission to update 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 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}
|
|
container-instance |
arn:${Partition}:ecs:${Region}:${Account}:container-instance/${ClusterName}/${ContainerInstanceId}
|
|
service |
arn:${Partition}:ecs:${Region}:${Account}:service/${ClusterName}/${ServiceName}
|
|
service-deployment |
arn:${Partition}:ecs:${Region}:${Account}:service-deployment/${ClusterName}/${ServiceName}/${ServiceDeploymentId}
|
|
service-revision |
arn:${Partition}:ecs:${Region}:${Account}:service-revision/${ClusterName}/${ServiceName}/${ServiceRevisionId}
|
|
task |
arn:${Partition}:ecs:${Region}:${Account}:task/${ClusterName}/${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 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:enable-vpc-lattice | Filters access by the VPC lattice capability of your Amazon ECS service | String |
ecs:fargate-ephemeral-storage-kms-key | Filters access by the AWS KMS key id provided in the request | 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 |