

# Identity and Access Management in Amazon Simple Workflow Service
<a name="swf-dev-iam"></a>

Access to Amazon SWF requires credentials that AWS can use to authenticate your requests. These credentials must have permissions to access AWS resources, such as retrieving event data from other AWS resources.. The following sections provide details on how you can use [AWS Identity and Access Management (IAM)](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html) and Amazon SWF to help secure your resources by controlling access to them.

AWS Identity and Access Management (IAM) is an AWS service that helps an administrator securely control access to AWS resources. IAM administrators control who can be *authenticated* (signed in) and *authorized* (have permissions) to use Amazon SWF resources. IAM is an AWS service that you can use with no additional charge.

**Topics**
+ [Audience](#security_iam_audience)
+ [Authenticating with identities](#security_iam_authentication)
+ [Managing access using policies](#security_iam_access-manage)
+ [Access Control](#access-control-swf)
+ [Policy actions for Amazon SWF](#security_iam_service-with-iam-id-based-policies-actions)
+ [Policy resources for Amazon SWF](#security_iam_service-with-iam-id-based-policies-resources)
+ [Policy condition keys for Amazon SWF](#security_iam_service-with-iam-id-based-policies-conditionkeys)
+ [ACLs in Amazon SWF](#security_iam_service-with-iam-acls)
+ [ABAC with Amazon SWF](#security_iam_service-with-iam-tags)
+ [Using temporary credentials with Amazon SWF](#security_iam_service-with-iam-roles-tempcreds)
+ [Cross-service principal permissions for Amazon SWF](#security_iam_service-with-iam-principal-permissions)
+ [Service roles for Amazon SWF](#security_iam_service-with-iam-roles-service)
+ [Service-linked roles for Amazon SWF](#security_iam_service-with-iam-roles-service-linked)
+ [Identity-based policies for Amazon SWF](#security_iam_service-with-iam-id-based-policies)
+ [Resource-based policies within Amazon SWF](#security_iam_service-with-iam-resource-based-policies)
+ [How Amazon Simple Workflow Service works with IAM](security_iam_service-with-iam.md)
+ [Identity-based policy examples for Amazon Simple Workflow Service](security_iam_id-based-policy-examples.md)
+ [Basic Principles](swf-dev-iam.basic.md)
+ [Amazon SWF IAM Policies](swf-dev-iam.policies.md)
+ [API Summary](swf-dev-iam.api.md)
+ [Tag-based Policies](tag-based-policies.md)
+ [Amazon VPC endpoints for Amazon SWF](swf-vpc-endpoints.md)
+ [Troubleshooting Amazon Simple Workflow Service identity and access](security_iam_troubleshoot.md)

## Audience
<a name="security_iam_audience"></a>

How you use AWS Identity and Access Management (IAM) differs based on your role:
+ **Service user** - request permissions from your administrator if you cannot access features (see [Troubleshooting Amazon Simple Workflow Service identity and access](security_iam_troubleshoot.md))
+ **Service administrator** - determine user access and submit permission requests (see [How Amazon Simple Workflow Service works with IAM](security_iam_service-with-iam.md))
+ **IAM administrator** - write policies to manage access (see [Identity-based policy examples for Amazon Simple Workflow Service](security_iam_id-based-policy-examples.md))

## Authenticating with identities
<a name="security_iam_authentication"></a>

Authentication is how you sign in to AWS using your identity credentials. You must be authenticated as the AWS account root user, an IAM user, or by assuming an IAM role.

You can sign in as a federated identity using credentials from an identity source like AWS IAM Identity Center (IAM Identity Center), single sign-on authentication, or Google/Facebook credentials. For more information about signing in, see [How to sign in to your AWS account](https://docs.aws.amazon.com/signin/latest/userguide/how-to-sign-in.html) in the *AWS Sign-In User Guide*.

For programmatic access, AWS provides an SDK and CLI to cryptographically sign requests. For more information, see [AWS Signature Version 4 for API requests](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv.html) in the *IAM User Guide*.

### AWS account root user
<a name="security_iam_authentication-rootuser"></a>

 When you create an AWS account, you begin with one sign-in identity called the AWS account *root user* that has complete access to all AWS services and resources. We strongly recommend that you don't use the root user for everyday tasks. For tasks that require root user credentials, see [Tasks that require root user credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html#root-user-tasks) in the *IAM User Guide*. 

### Federated identity
<a name="security_iam_authentication-federated"></a>

As a best practice, require human users to use federation with an identity provider to access AWS services using temporary credentials.

A *federated identity* is a user from your enterprise directory, web identity provider, or Directory Service that accesses AWS services using credentials from an identity source. Federated identities assume roles that provide temporary credentials.

For centralized access management, we recommend AWS IAM Identity Center. For more information, see [What is IAM Identity Center?](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the *AWS IAM Identity Center User Guide*.

### IAM users and groups
<a name="security_iam_authentication-iamuser"></a>

An *[IAM user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users.html)* is an identity with specific permissions for a single person or application. We recommend using temporary credentials instead of IAM users with long-term credentials. For more information, see [Require human users to use federation with an identity provider to access AWS using temporary credentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp) in the *IAM User Guide*.

An [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html) specifies a collection of IAM users and makes permissions easier to manage for large sets of users. For more information, see [Use cases for IAM users](https://docs.aws.amazon.com/IAM/latest/UserGuide/gs-identities-iam-users.html) in the *IAM User Guide*.

### IAM roles
<a name="security_iam_authentication-iamrole"></a>

An *[IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)* is an identity with specific permissions that provides temporary credentials. You can assume a role by [switching from a user to an IAM role (console)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-console.html) or by calling an AWS CLI or AWS API operation. For more information, see [Methods to assume a role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_manage-assume.html) in the *IAM User Guide*.

IAM roles are useful for federated user access, temporary IAM user permissions, cross-account access, cross-service access, and applications running on Amazon EC2. For more information, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.

## Managing access using policies
<a name="security_iam_access-manage"></a>

You control access in AWS by creating policies and attaching them to AWS identities or resources. A policy defines permissions when associated with an identity or resource. AWS evaluates these policies when a principal makes a request. Most policies are stored in AWS as JSON documents. For more information about JSON policy documents, see [Overview of JSON policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#access_policies-json) in the *IAM User Guide*.

Using policies, administrators specify who has access to what by defining which **principal** can perform **actions** on what **resources**, and under what **conditions**.

By default, users and roles have no permissions. An IAM administrator creates IAM policies and adds them to roles, which users can then assume. IAM policies define permissions regardless of the method used to perform the operation.

### Identity-based policies
<a name="security_iam_access-manage-id-based-policies"></a>

Identity-based policies are JSON permissions policy documents that you attach to an identity (user, group, or role). These policies control what actions identities can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see [Define custom IAM permissions with customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*.

Identity-based policies can be *inline policies* (embedded directly into a single identity) or *managed policies* (standalone policies attached to multiple identities). To learn how to choose between managed and inline policies, see [Choose between managed policies and inline policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-choosing-managed-or-inline.html) in the *IAM User Guide*.

### Resource-based policies
<a name="security_iam_access-manage-resource-based-policies"></a>

Resource-based policies are JSON policy documents that you attach to a resource. Examples include IAM *role trust policies* and Amazon S3 *bucket policies*. In services that support resource-based policies, service administrators can use them to control access to a specific resource. You must [specify a principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) in a resource-based policy.

Resource-based policies are inline policies that are located in that service. You can't use AWS managed policies from IAM in a resource-based policy.

### Other policy types
<a name="security_iam_access-manage-other-policies"></a>

AWS supports additional policy types that can set the maximum permissions granted by more common policy types:
+ **Permissions boundaries** – Set the maximum permissions that an identity-based policy can grant to an IAM entity. For more information, see [Permissions boundaries for IAM entities](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) in the *IAM User Guide*.
+ **Service control policies (SCPs)** – Specify the maximum permissions for an organization or organizational unit in AWS Organizations. For more information, see [Service control policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html) in the *AWS Organizations User Guide*.
+ **Resource control policies (RCPs)** – Set the maximum available permissions for resources in your accounts. For more information, see [Resource control policies (RCPs)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html) in the *AWS Organizations User Guide*.
+ **Session policies** – Advanced policies passed as a parameter when creating a temporary session for a role or federated user. For more information, see [Session policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) in the *IAM User Guide*.

### Multiple policy types
<a name="security_iam_access-manage-multiple-policies"></a>

When multiple types of policies apply to a request, the resulting permissions are more complicated to understand. To learn how AWS determines whether to allow a request when multiple policy types are involved, see [Policy evaluation logic](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html) in the *IAM User Guide*.

## Access Control
<a name="access-control-swf"></a>

You can have valid credentials to authenticate your requests, but unless you have permissions you cannot create or access Amazon SWF resources. For example, you must have permissions to invoke AWS Lambda, Amazon Simple Notification Service (Amazon SNS), and Amazon Simple Queue Service (Amazon SQS) targets associated with your Amazon SWF rules.

The following sections describe how to manage permissions for Amazon SWF. We recommend that you read the overview first.
+ [Basic Principles](swf-dev-iam.basic.md)
+ [Amazon SWF IAM Policies](swf-dev-iam.policies.md)
+ [Writing policies for Amazon SWF](swf-dev-iam.policies.md#swf-dev-iam.policies.examples)

## Policy actions for Amazon SWF
<a name="security_iam_service-with-iam-id-based-policies-actions"></a>

**Supports policy actions:** Yes

Administrators can use AWS JSON policies to specify who has access to what. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**.

The `Action` element of a JSON policy describes the actions that you can use to allow or deny access in a policy. Include actions in a policy to grant permissions to perform the associated operation.

To see a list of Amazon SWF actions, see [Resources Defined by Amazon Simple Workflow Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsimpleworkflowservice.html#amazonsimpleworkflowservice-resources-for-iam-policies) in the *Service Authorization Reference*.

Policy actions in Amazon SWF use the following prefix before the action:

```
swf
```

To specify multiple actions in a single statement, separate them with commas.

```
"Action": [
      "swf:action1",
      "swf:action2"
         ]
```

To view examples of Amazon SWF identity-based policies, see [Identity-based policy examples for Amazon Simple Workflow Service](security_iam_id-based-policy-examples.md).

## Policy resources for Amazon SWF
<a name="security_iam_service-with-iam-id-based-policies-resources"></a>

**Supports policy resources:** Yes

Administrators can use AWS JSON policies to specify who has access to what. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**.

The `Resource` JSON policy element specifies the object or objects to which the action applies. As a best practice, specify a resource using its [Amazon Resource Name (ARN)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html). For actions that don't support resource-level permissions, use a wildcard (\$1) to indicate that the statement applies to all resources.

```
"Resource": "*"
```

To see a list of Amazon SWF resource types and their ARNs, see [Actions Defined by Amazon Simple Workflow Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsimpleworkflowservice.html#amazonsimpleworkflowservice-actions-as-permissions) in the *Service Authorization Reference*. To learn with which actions you can specify the ARN of each resource, see [Resources Defined by Amazon Simple Workflow Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsimpleworkflowservice.html#amazonsimpleworkflowservice-resources-for-iam-policies).

To view examples of Amazon SWF identity-based policies, see [Identity-based policy examples for Amazon Simple Workflow Service](security_iam_id-based-policy-examples.md).

## Policy condition keys for Amazon SWF
<a name="security_iam_service-with-iam-id-based-policies-conditionkeys"></a>

**Supports service-specific policy condition keys:** Yes

Administrators can use AWS JSON policies to specify who has access to what. That is, which **principal** can perform **actions** on what **resources**, and under what **conditions**.

The `Condition` element specifies when statements execute based on defined criteria. You can create conditional expressions that use [condition operators](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition_operators.html), such as equals or less than, to match the condition in the policy with values in the request. To see all AWS global condition keys, see [AWS global condition context keys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html) in the *IAM User Guide*.

To see a list of Amazon SWF condition keys, see [Condition Keys for Amazon Simple Workflow Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsimpleworkflowservice.html#amazonsimpleworkflowservice-policy-keys) in the *Service Authorization Reference*. To learn with which actions and resources you can use a condition key, see [Resources Defined by Amazon Simple Workflow Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsimpleworkflowservice.html#amazonsimpleworkflowservice-resources-for-iam-policies).

To view examples of Amazon SWF identity-based policies, see [Identity-based policy examples for Amazon Simple Workflow Service](security_iam_id-based-policy-examples.md).

## ACLs in Amazon SWF
<a name="security_iam_service-with-iam-acls"></a>

**Supports ACLs:** No 

Access control lists (ACLs) control which principals (account members, users, or roles) have permissions to access a resource. ACLs are similar to resource-based policies, although they do not use the JSON policy document format.

## ABAC with Amazon SWF
<a name="security_iam_service-with-iam-tags"></a>

**Supports ABAC (tags in policies):** Partial

Attribute-based access control (ABAC) is an authorization strategy that defines permissions based on attributes called tags. You can attach tags to IAM entities and AWS resources, then design ABAC policies to allow operations when the principal's tag matches the tag on the resource.

To control access based on tags, you provide tag information in the [condition element](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) of a policy using the `aws:ResourceTag/key-name`, `aws:RequestTag/key-name`, or `aws:TagKeys` condition keys.

If a service supports all three condition keys for every resource type, then the value is **Yes** for the service. If a service supports all three condition keys for only some resource types, then the value is **Partial**.

For more information about ABAC, see [Define permissions with ABAC authorization](https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction_attribute-based-access-control.html) in the *IAM User Guide*. To view a tutorial with steps for setting up ABAC, see [Use attribute-based access control (ABAC)](https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) in the *IAM User Guide*.

## Using temporary credentials with Amazon SWF
<a name="security_iam_service-with-iam-roles-tempcreds"></a>

**Supports temporary credentials:** Yes

Temporary credentials provide short-term access to AWS resources and are automatically created when you use federation or switch roles. AWS recommends that you dynamically generate temporary credentials instead of using long-term access keys. For more information, see [Temporary security credentials in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) and [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*.

## Cross-service principal permissions for Amazon SWF
<a name="security_iam_service-with-iam-principal-permissions"></a>

**Supports forward access sessions (FAS):** Yes

 Forward access sessions (FAS) use the permissions of the principal calling an AWS service, combined with the requesting AWS service to make requests to downstream services. For policy details when making FAS requests, see [Forward access sessions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_forward_access_sessions.html). 

## Service roles for Amazon SWF
<a name="security_iam_service-with-iam-roles-service"></a>

**Supports service roles:** Yes

 A service role is an [IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) that a service assumes to perform actions on your behalf. An IAM administrator can create, modify, and delete a service role from within IAM. For more information, see [Create a role to delegate permissions to an AWS service](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-service.html) in the *IAM User Guide*. 

**Warning**  
Changing the permissions for a service role might break Amazon SWF functionality. Edit service roles only when Amazon SWF provides guidance to do so.

## Service-linked roles for Amazon SWF
<a name="security_iam_service-with-iam-roles-service-linked"></a>

**Supports service-linked roles:** No 

 A service-linked role is a type of service role that is linked to an AWS service. The service can assume the role to perform an action on your behalf. Service-linked roles appear in your AWS account and are owned by the service. An IAM administrator can view, but not edit the permissions for service-linked roles. 

For details about creating or managing service-linked roles, see [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html). Find a service in the table that includes a `Yes` in the **Service-linked role** column. Choose the **Yes** link to view the service-linked role documentation for that service.

## Identity-based policies for Amazon SWF
<a name="security_iam_service-with-iam-id-based-policies"></a>

**Supports identity-based policies:** Yes

Identity-based policies are JSON permissions policy documents that you can attach to an identity, such as an IAM user, group of users, or role. These policies control what actions users and roles can perform, on which resources, and under what conditions. To learn how to create an identity-based policy, see [Define custom IAM permissions with customer managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) in the *IAM User Guide*.

With IAM identity-based policies, you can specify allowed or denied actions and resources as well as the conditions under which actions are allowed or denied. To learn about all of the elements that you can use in a JSON policy, see [IAM JSON policy elements reference](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html) in the *IAM User Guide*.

### Identity-based policy examples for Amazon SWF
<a name="security_iam_service-with-iam-id-based-policies-examples"></a>

To view examples of Amazon SWF identity-based policies, see [Identity-based policy examples for Amazon Simple Workflow Service](security_iam_id-based-policy-examples.md).

## Resource-based policies within Amazon SWF
<a name="security_iam_service-with-iam-resource-based-policies"></a>

**Supports resource-based policies:** No 

Resource-based policies are JSON policy documents that you attach to a resource. Examples of resource-based policies are IAM *role trust policies* and Amazon S3 *bucket policies*. In services that support resource-based policies, service administrators can use them to control access to a specific resource. For the resource where the policy is attached, the policy defines what actions a specified principal can perform on that resource and under what conditions. You must [specify a principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html) in a resource-based policy. Principals can include accounts, users, roles, federated users, or AWS services.

To enable cross-account access, you can specify an entire account or IAM entities in another account as the principal in a resource-based policy. For more information, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.

# How Amazon Simple Workflow Service works with IAM
<a name="security_iam_service-with-iam"></a>

Before you use IAM to manage access to Amazon SWF, learn what IAM features are available to use with Amazon SWF.


**IAM features you can use with Amazon Simple Workflow Service**  

| IAM feature | Amazon SWF support | 
| --- | --- | 
|  [Identity-based policies](swf-dev-iam.md#security_iam_service-with-iam-id-based-policies)  |   Yes  | 
|  [Resource-based policies](swf-dev-iam.md#security_iam_service-with-iam-resource-based-policies)  |   No   | 
|  [Policy actions](swf-dev-iam.md#security_iam_service-with-iam-id-based-policies-actions)  |   Yes  | 
|  [Policy resources](swf-dev-iam.md#security_iam_service-with-iam-id-based-policies-resources)  |   Yes  | 
|  [Policy condition keys (service-specific)](swf-dev-iam.md#security_iam_service-with-iam-id-based-policies-conditionkeys)  |   Yes  | 
|  [ACLs](swf-dev-iam.md#security_iam_service-with-iam-acls)  |   No   | 
|  [ABAC (tags in policies)](swf-dev-iam.md#security_iam_service-with-iam-tags)  |   Partial  | 
|  [Temporary credentials](swf-dev-iam.md#security_iam_service-with-iam-roles-tempcreds)  |   Yes  | 
|  [Principal permissions](swf-dev-iam.md#security_iam_service-with-iam-principal-permissions)  |   Yes  | 
|  [Service roles](swf-dev-iam.md#security_iam_service-with-iam-roles-service)  |   Yes  | 
|  [Service-linked roles](swf-dev-iam.md#security_iam_service-with-iam-roles-service-linked)  |   No   | 

To get a high-level view of how Amazon SWF and other AWS services work with most IAM features, see [AWS services that work with IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) in the *IAM User Guide*.

# Identity-based policy examples for Amazon Simple Workflow Service
<a name="security_iam_id-based-policy-examples"></a>

By default, users and roles don't have permission to create or modify Amazon SWF resources. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies.

To learn how to create an IAM identity-based policy by using these example JSON policy documents, see [Create IAM policies (console)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html) in the *IAM User Guide*.

For details about actions and resource types defined by Amazon SWF, including the format of the ARNs for each of the resource types, see [Actions, Resources, and Condition Keys for Amazon Simple Workflow Service](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazonsimpleworkflowservice.html) in the *Service Authorization Reference*.

**Topics**
+ [Policy best practices](#security_iam_service-with-iam-policy-best-practices)
+ [Using the Amazon SWF console](#security_iam_id-based-policy-examples-console)
+ [Allow users to view their own permissions](#security_iam_id-based-policy-examples-view-own-permissions)

## Policy best practices
<a name="security_iam_service-with-iam-policy-best-practices"></a>

Identity-based policies determine whether someone can create, access, or delete Amazon SWF resources in your account. These actions can incur costs for your AWS account. When you create or edit identity-based policies, follow these guidelines and recommendations:
+ **Get started with AWS managed policies and move toward least-privilege permissions** – To get started granting permissions to your users and workloads, use the *AWS managed policies* that grant permissions for many common use cases. They are available in your AWS account. We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases. For more information, see [AWS managed policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html#aws-managed-policies) or [AWS managed policies for job functions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html) in the *IAM User Guide*.
+ **Apply least-privilege permissions** – When you set permissions with IAM policies, grant only the permissions required to perform a task. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as *least-privilege permissions*. For more information about using IAM to apply permissions, see [ Policies and permissions in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the *IAM User Guide*.
+ **Use conditions in IAM policies to further restrict access** – You can add a condition to your policies to limit access to actions and resources. For example, you can write a policy condition to specify that all requests must be sent using SSL. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as CloudFormation. For more information, see [ IAM JSON policy elements: Condition](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html) in the *IAM User Guide*.
+ **Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions** – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language (JSON) and IAM best practices. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies. For more information, see [Validate policies with IAM Access Analyzer](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html) in the *IAM User Guide*.
+ **Require multi-factor authentication (MFA)** – If you have a scenario that requires IAM users or a root user in your AWS account, turn on MFA for additional security. To require MFA when API operations are called, add MFA conditions to your policies. For more information, see [ Secure API access with MFA](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_configure-api-require.html) in the *IAM User Guide*.

For more information about best practices in IAM, see [Security best practices in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the *IAM User Guide*.

## Using the Amazon SWF console
<a name="security_iam_id-based-policy-examples-console"></a>

To access the Amazon Simple Workflow Service console, you must have a minimum set of permissions. These permissions must allow you to list and view details about the Amazon SWF resources in your AWS account. If you create an identity-based policy that is more restrictive than the minimum required permissions, the console won't function as intended for entities (users or roles) with that policy.

You don't need to allow minimum console permissions for users that are making calls only to the AWS CLI or the AWS API. Instead, allow access to only the actions that match the API operation that they're trying to perform.

To ensure that users and roles can still use the Amazon SWF console, also attach the Amazon SWF `ConsoleAccess` or `ReadOnly` AWS managed policy to the entities. For more information, see [Adding permissions to a user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_change-permissions.html#users_change_permissions-add-console) in the *IAM User Guide*.

## Allow users to view their own permissions
<a name="security_iam_id-based-policy-examples-view-own-permissions"></a>

This example shows how you might create a policy that allows IAM users to view the inline and managed policies that are attached to their user identity. This policy includes permissions to complete this action on the console or programmatically using the AWS CLI or AWS API.

```
{
    "Version": "2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ViewOwnUserInfo",
            "Effect": "Allow",
            "Action": [
                "iam:GetUserPolicy",
                "iam:ListGroupsForUser",
                "iam:ListAttachedUserPolicies",
                "iam:ListUserPolicies",
                "iam:GetUser"
            ],
            "Resource": ["arn:aws:iam::*:user/${aws:username}"]
        },
        {
            "Sid": "NavigateInConsole",
            "Effect": "Allow",
            "Action": [
                "iam:GetGroupPolicy",
                "iam:GetPolicyVersion",
                "iam:GetPolicy",
                "iam:ListAttachedGroupPolicies",
                "iam:ListGroupPolicies",
                "iam:ListPolicyVersions",
                "iam:ListPolicies",
                "iam:ListUsers"
            ],
            "Resource": "*"
        }
    ]
}
```

# Basic Principles
<a name="swf-dev-iam.basic"></a>

Amazon SWF access control is based primarily on two types of permissions:
+ Resource permissions: Which Amazon SWF resources a user can access.

  You can express resource permissions only for domains.
+ API permissions: Which Amazon SWF actions a user can call.

The simplest approach is to grant full account access—call any Amazon SWF action in any domain—or deny access entirely. However, IAM supports a more granular approach to access control that is often more useful. For example, you could: 
+ Allow a user to call any Amazon SWF action without restrictions, but only in a specified domain. You could use such a policy to allow workflow applications that are under development to use any action, but only a "sandbox" domain.
+ Allow a user to access any domain, but constrain how they use the API. You could use such a policy to allow an "auditor" application to call the API in any domain, but allow only read access.
+ Allow a user to call only a limited set of actions in certain domains. You could use such a policy to allow a workflow starter to call only the `StartWorkflowExecution` action in a specified domain.

Amazon SWF access control is based on the following principles:
+ Access control decisions are based only on IAM policies; all policy auditing and manipulation is done through IAM.
+ The access control model uses a deny-by-default policy; any access that isn't explicitly allowed is denied. 
+ You control access to Amazon SWF resources by attaching appropriate IAM policies to the workflow's actors.
+ Resource permissions can be expressed only for domains.
+ You can further constrain the usage of some actions by applying conditions to one or more parameters.
+ If you grant permission to use [RespondDecisionTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondDecisionTaskCompleted.html), you can express permissions for the list of decisions included in that action.

  Each of the decisions has one or more parameters, much like a regular API call. To allow for policies to be as readable as possible, you can express permissions on decisions as if they were actual API calls, including applying conditions to some parameters. These types of permissions are called *pseudo API* permissions.

For a summary of which regular and pseudo API parameters can be constrained by using conditions, see [API Summary](swf-dev-iam.api.md).

# Amazon SWF IAM Policies
<a name="swf-dev-iam.policies"></a>

An IAM policy contains one or more `Statement` elements, each of which contains a set of elements that define the policy. For a complete list of elements and a general discussion of how to construct policies, see [The Access Policy Language](https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage.html). Amazon SWF access control is based on the following elements:

Effect  
(Required) The effect of the statement: `deny` or `allow`.  
You must explicitly allow access; IAM denies access by default.

Resource  
(Required) The resource—an entity in an AWS service that a user can interact with—that the statement applies to.  
You can express resource permissions only for domains. For example, a policy can allow access to only certain domains in your account. To express permissions for a domain, set `Resource` to the domain's Amazon Resource Name (ARN), which has the format "arn:aws:swf:*Region*:*AccountID*:/domain/*DomainName*". *Region* is the AWS region, *AccountID* is the account ID with no dashes, and *DomainName* is the domain name.

Action  
(Required) The action that the statement applies to, which you refer to by using the following format: *serviceId*:*action*. For Amazon SWF, set *serviceID* to `swf`. For example, `swf:StartWorkflowExecution` refers to the [StartWorkflowExecution](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_StartWorkflowExecution.html) action, and is used to control which users are allowed to start workflows.  
 If you grant permission to use [RespondDecisionTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondDecisionTaskCompleted.html), you can also control access to the included list of decisions by using `Action` to express permissions for the pseudo API. Because IAM denies access by default, a decider's decision must be explicitly allowed or it will not be accepted. You can use a `*` value to allow all decisions.

Condition  
(Optional) Expresses a constraint on one or more of an action's parameters, which restricts the allowed values.  
Amazon SWF actions often have a wide scope, which you can reduce by using IAM conditions. For example, to limit which task lists the [PollForActivityTask](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_PollForActivityTask.html) action is allowed to access, you include a `Condition` and use the `swf:taskList.name` key to specify the allowable lists.   
You can express constraints for the following entities.  
+ The workflow type. The name and version have separate keys.
+ The activity type. The name and version have separate keys.
+ Task lists.
+ Tags. You can specify multiple tags for some actions. In that case, each tag has a separate key.
For Amazon SWF, the values are all strings so you constrain a parameter by using a string operator such as `StringEquals`, which restricts the parameter to a specified string. However, the regular string comparison operators such as `StringEquals` require all requests to include the parameter. If you don't include the parameter explicitly, and there is no default value such as the default task list provided during type registration, access will be denied.  
It is often useful to treat conditions as optional, so that you can call an action without necessarily including the associated parameter. For example, you might want to allow a decider to specify a set of [RespondDecisionTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondDecisionTaskCompleted.html) decisions, but also allow it to specify only one of them for any particular call. In that case, you constrain the appropriate parameters by using a `StringEqualsIfExists` operator, which allows access if the parameter satisfies the condition, but doesn't deny access if the parameter is absent.
For a complete list of constrainable parameters and the associated keys, see [API Summary](swf-dev-iam.api.md).

The following section provides examples of how to construct Amazon SWF policies. For details, see [String Conditions](https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage_ElementDescriptions.html#AccessPolicyLanguage_ConditionType). 

## Writing policies for Amazon SWF
<a name="swf-dev-iam.policies.examples"></a>

A workflow consists of multiple *actors*—activities, deciders, and so on. You can control access for each actor by attaching an appropriate IAM policy.

With the following action, the actor will be granted full account access across all regions:
+ **Action** : `swf:*`
+ **Resource** : `arn:aws:swf:*:123456789012:/domain/*`

 You can use wildcards to have a single value represent multiple resources, actions, or regions.
+ The first wildcard (`*`) in the `Resource` value indicates that the resource permissions apply to all **regions**. 

  To restrict permissions to a single region, replace the wildcard with the appropriate region string, such as us-east-1. 
+ The second wildcard (`*`) in the `Resource` value allows the actor to access any of the account's domains in the specified regions.
+ The wildcard (`*`) in the `Action` value allows the actor to call any Amazon SWF action. 

For details on how to use wildcards, see [Element Descriptions](https://docs.aws.amazon.com/IAM/latest/UserGuide/AccessPolicyLanguage_ElementDescriptions.html)

### Domain Permissions
<a name="swf-dev-iam.policies.examples.domain"></a>

To restrict a department's workflows to a particular domain, you could grant permission that allows an actor to call any action, but only for a specific department. 

To gran an actor access to more than one domain, express permission for each domain as a list of Statements:
+ **Action** : `swf:*`
+ **Resource** : `arn:aws:swf:*:123456789012:/domain/department1` 
+ **Resource** : `arn:aws:swf:*:123456789012:/domain/department2` 

You can allow an actor to use any Amazon SWF action in the `department1` and `department2` domains. You can also sometimes use wildcards to represent multiple domains. 

### API Permissions and Constraints
<a name="swf-dev-iam.policies.examples.api"></a>

You control which **actions** an actor can use by specifying the action in the `Action` element. 

With the following action, an actor can only call `StartWorkflowExecution` to start workflows. It can't use any other actions.
+ **Action** : `swf:StartWorkflowExecution` 

**Conditions**  
You can optionally constrain the action's allowable parameter values by using a `Condition` element.

To restrict which workflows an actor can start, constrain one or more of the `StartWorkflowExecution` parameter values, as follows:

```
"Condition" : {
   "StringEquals" : { 
      "swf:workflowType.name" : "workflow1",
      "swf:workflowType.version" : "version2" 
    }
}
```

An actor with the previous constraints can run only `version2` of `workflow1` and both parameters must be included in the request.

You can constrain a parameter without requiring it to be included in a request by using a `StringEqualsIfExists` operator, as follows:

```
"Condition" : {
   "StringEqualsIfExists" : { "swf:taskList.name" : "task_list_name" }
}
```

An actor with the previous policy can optionally specify a task list when starting a workflow execution.

You can constrain a list of tags for some actions. Each tag has a separate key, so you use `swf:tagList.member.0` to constrain the first tag in the list, `swf:tagList.member.1` to constrain the second tag in the list, and so on, up to a maximum of 5. 

You must be careful how you constrain tag lists. For instance, the following condition is ***not*** recommended. 

The following Condition is **not** recommended because it allows you to optionally specify either `some_ok_tag` or `another_ok_tag`. However, the Condition constrains only the **first element **of the tag list. The list could have additional elements with arbitrary values that would all be allowed because the condition doesn't apply any conditions to `swf:tagList.member.1`, `swf:tagList.member.2`, and so on.

```
// Example to illustrate an insecure Condition
"Condition" : {
   "StringEqualsIfExists" : {
      "swf:tagList.member.0" : "some_ok_tag", "another_ok_tag"
   }
}
```

One way to address the previous issue is to disallow the use of tag lists. 

The following policy ensures that only `some_ok_tag` or `another_ok_tag` are allowed by requiring the list to have only one element.

```
"Condition" : {
   "StringEqualsIfExists" : {
      "swf:tagList.member.0" : "some_ok_tag", "another_ok_tag"
    },
    "Null" : { "swf:tagList.member.1" : "true" }
}
```

### Pseudo API Permissions and Constraints
<a name="pseudo-api-permissions-constraints"></a>

To restrict the decisions available to `RespondDecisionTaskCompleted`, you must first allow the actor to call `RespondDecisionTaskCompleted`. You then express permissions for the appropriate pseudo API members using the same syntax as for the regular API, as follows:
+ **Statement 1**

  **Resource** : `arn:aws:swf:*:123456789012:/domain/*` 

  **Action** : `swf:RespondDecisionTaskCompleted` 
+ **Statement 2**

  **Resource** : `*` 

  **Action** : `swf:ScheduleActivityTask` 

  **Condition** : ` "StringEquals" : { "swf:activityType.name" : "SomeActivityType" }` 

The first `Statement` allows the actor to call `RespondDecisionTaskCompleted`. The second statement allows the actor to use the `ScheduleActivityTask` decision to direct Amazon SWF to schedule an activity task. To allow all decisions, replace "swf:ScheduleActivityTask" with "swf:\$1".

You can use Condition operators to constrain parameters just as with the regular API. The `StringEquals` operator in the previous example `Condition` allows `RespondDecisionTaskCompleted` to schedule an activity task for the `SomeActivityType` activity, and it must schedule that task. If you want to allow `RespondDecisionTaskCompleted` to use a parameter value but not require it to do so, you can instead use the `StringEqualsIfExists` operator.

## AWS managed policy: SimpleWorkflowFullAccess
<a name="swf-full-accss-mngd-policy"></a>

You can attach the `SimpleWorkflowFullAccess` policy to your IAM identities.

This policy provides full access to the Amazon SWF configuration service.

## Service Model Limitations on IAM Policies
<a name="swf-dev-iam.policies.allowed"></a>

You must consider service model constraints when creating IAM policies. It is possible to create a syntactically valid IAM policy that represents an invalid Amazon SWF request; a request that is allowed in terms of access control can still fail because it is an invalid request. 

For example, the Amazon SWF service model does **not** allow the `typeFilter` and `tagFilter` parameters to be used in the same `[ListOpenWorkflowExecutions](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListOpenWorkflowExecutions.html)` request. The following condition would allow calls that the service will reject—by throwing `ValidationException`—as an invalid request:

```
"Condition" : {
   "StringEquals" : { 
      "swf:typeFilter.name" : "workflow_name",
      "swf:typeFilter.version" : "workflow_version",
      "swf:tagFilter.tag" : "some_tag" 
    }
}
```

# API Summary
<a name="swf-dev-iam.api"></a>

This section briefly describes how you can use IAM policies to control how an actor can use each API and pseudo API to access Amazon SWF resources.
+ For all actions except `RegisterDomain` and `ListDomains`, you can allow or deny access to any or all of an account's domains by expressing permissions for the domain resource. 
+ You can allow or deny permission for any member of the regular API and, if you grant permission to call `[RespondDecisionTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondDecisionTaskCompleted.html)`, any member of the pseudo API. 
+ You can use a Condition to constrain some parameters' allowable values.

The following sections list the parameters that can be constrained for each member of the regular and pseudo API and provide the associated key, and note any limitations on how you can control domain access. 

## Regular API
<a name="swf-dev-iam.api.regular"></a>

This section lists the regular API members, and briefly describes the parameters that can be constrained and the associated keys. It also notes any limitations on how you can control domain access.

`[CountClosedWorkflowExecutions](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_CountClosedWorkflowExecutions.html)`
+ `tagFilter.tag` – String constraint. The key is `swf:tagFilter.tag`
+ `typeFilter.name` – String constraint. The key is `swf:typeFilter.name`.
+ `typeFilter.version` – String constraint. The key is `swf:typeFilter.version`. 

**Note**  
`CountClosedWorkflowExecutions` requires `typeFilter` and `tagFilter` to be mutually exclusive.

`[CountOpenWorkflowExecutions](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_CountOpenWorkflowExecutions.html)`
+ `tagFilter.tag` – String constraint. The key is `swf:tagFilter.tag`
+ `typeFilter.name` – String constraint. The key is `swf:typeFilter.name`.
+ `typeFilter.version` – String constraint. The key is `swf:typeFilter.version`. 

**Note**  
`CountOpenWorkflowExecutions` requires `typeFilter` and `tagFilter` to be mutually exclusive.

`[CountPendingActivityTasks](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_CountPendingActivityTasks.html)`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.

`[CountPendingDecisionTasks](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_CountPendingDecisionTasks.html)`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.

`[DeleteActivityType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DeleteActivityType.html)`
+ `activityType.name` – String constraint. The key is `swf:activityType.name`.
+ `activityType.version` – String constraint. The key is `swf:activityType.version`.

`[DeprecateActivityType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DeprecateActivityType.html)`
+ `activityType.name` – String constraint. The key is `swf:activityType.name`.
+ `activityType.version` – String constraint. The key is `swf:activityType.version`.

`[DeprecateDomain](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DeprecateDomain.html)`
+ You can't constrain this action's parameters.

`[DeleteWorkflowType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DeleteWorkflowType.html)`
+ `workflowType.name` – String constraint. The key is `swf:workflowType.name`.
+ `workflowType.version` – String constraint. The key is `swf:workflowType.version`. 

`[DeprecateWorkflowType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DeprecateWorkflowType.html)`
+ `workflowType.name` – String constraint. The key is `swf:workflowType.name`.
+ `workflowType.version` – String constraint. The key is `swf:workflowType.version`. 

`[DescribeActivityType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DescribeActivityType.html)`
+ `activityType.name` – String constraint. The key is `swf:activityType.name`.
+ `activityType.version` – String constraint. The key is `swf:activityType.version`.

`[DescribeDomain](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DescribeDomain.html)`
+ You can't constrain this action's parameters.

`[DescribeWorkflowExecution](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DescribeWorkflowExecution.html)`
+ You can't constrain this action's parameters.

`[DescribeWorkflowType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_DescribeWorkflowType.html)`
+ `workflowType.name` – String constraint. The key is `swf:workflowType.name`.
+ `workflowType.version` – String constraint. The key is `swf:workflowType.version`.

`[GetWorkflowExecutionHistory](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_GetWorkflowExecutionHistory.html)`
+ You can't constrain this action's parameters.

`[ListActivityTypes](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListActivityTypes.html)`
+ You can't constrain this action's parameters.

`[ListClosedWorkflowExecutions](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListClosedWorkflowExecutions.html)`
+ `tagFilter.tag` – String constraint. The key is `swf:tagFilter.tag`
+ `typeFilter.name` – String constraint. The key is `swf:typeFilter.name`.
+ `typeFilter.version` – String constraint. The key is `swf:typeFilter.version`. 

**Note**  
`ListClosedWorkflowExecutions` requires `typeFilter` and `tagFilter` to be mutually exclusive.

`[ListDomains](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListDomains.html)`
+ You can't constrain this action's parameters.

`[ListOpenWorkflowExecutions](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListOpenWorkflowExecutions.html)`
+ `tagFilter.tag` – String constraint. The key is `swf:tagFilter.tag`
+ `typeFilter.name` – String constraint. The key is `swf:typeFilter.name`.
+ `typeFilter.version` – String constraint. The key is `swf:typeFilter.version`. 

**Note**  
`ListOpenWorkflowExecutions` requires `typeFilter` and `tagFilter` to be mutually exclusive.

`[ListWorkflowTypes](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_ListWorkflowTypes.html)`
+ You can't constrain this action's parameters.

`[PollForActivityTask](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_PollForActivityTask.html)`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.

`[PollForDecisionTask](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_PollForDecisionTask.html)`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.

`[RecordActivityTaskHeartbeat](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RecordActivityTaskHeartbeat.html)`
+ You can't constrain this action's parameters.

`[RegisterActivityType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RegisterActivityType.html)`
+ `defaultTaskList.name` – String constraint. The key is `swf:defaultTaskList.name`. 
+ `name` – String constraint. The key is `swf:name`.
+ `version` – String constraint. The key is `swf:version`.

`[RegisterDomain](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RegisterDomain.html)`
+ `name` – The name of the domain being registered is available as the resource of this action. 

`[RegisterWorkflowType](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RegisterWorkflowType.html)`
+ `defaultTaskList.name` – String constraint. The key is `swf:defaultTaskList.name`. 
+ `name` – String constraint. The key is `swf:name`.
+ `version` – String constraint. The key is `swf:version`.

`[RequestCancelWorkflowExecution](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RequestCancelWorkflowExecution.html)`
+ You can't constrain this action's parameters.

`[RespondActivityTaskCanceled](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondActivityTaskCanceled.html)`
+ You can't constrain this action's parameters.

`[RespondActivityTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondActivityTaskCompleted.html)`
+ You can't constrain this action's parameters.

`[RespondActivityTaskFailed](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondActivityTaskFailed.html)`
+ You can't constrain this action's parameters.

`[RespondDecisionTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondDecisionTaskCompleted.html)`
+ `decisions.member.N` – Restricted indirectly through pseudo API permissions. For details, see [Pseudo API](#swf-dev-iam.api.pseudo).

`[SignalWorkflowExecution](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_SignalWorkflowExecution.html)`
+ You can't constrain this action's parameters.

`[StartWorkflowExecution](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_StartWorkflowExecution.html)`
+ `tagList.member.0` – String constraint. The key is `swf:tagList.member.0`
+ `tagList.member.1` – String constraint. The key is `swf:tagList.member.1`
+ `tagList.member.2` – String constraint. The key is `swf:tagList.member.2`
+ `tagList.member.3` – String constraint. The key is `swf:tagList.member.3`
+ `tagList.member.4` – String constraint. The key is `swf:tagList.member.4`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.
+ `workflowType.name` – String constraint. The key is `swf:workflowType.name`.
+ `workflowType.version` – String constraint. The key is `swf:workflowType.version`.

**Note**  
You can't constrain more than five tags.

`[TerminateWorkflowExecution](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_TerminateWorkflowExecution.html)`
+ You can't constrain this action's parameters.

## Pseudo API
<a name="swf-dev-iam.api.pseudo"></a>

This section lists the members of the pseudo API, which represent the decisions included in `[RespondDecisionTaskCompleted](https://docs.aws.amazon.com/amazonswf/latest/apireference/API_RespondDecisionTaskCompleted.html)`. If you have granted permission to use `RespondDecisionTaskCompleted`, your policy can express permissions for the members of this API in the same way as the regular API. You can further restrict some members of the pseudo-API by setting conditions on one or more parameters. This section lists the pseudo API members, and briefly describes the parameters that can be constrained and the associated keys.

**Note**  
The `aws:SourceIP`, `aws:UserAgent`, and `aws:SecureTransport` keys are not available for the pseudo API. If your intended security policy requires these keys to control access to the pseudo API, you can use them with the `RespondDecisionTaskCompleted` action. 

`CancelTimer`
+ You can't constrain this action's parameters.

`CancelWorkflowExecution`
+ You can't constrain this action's parameters.

`CompleteWorkflowExecution`
+ You can't constrain this action's parameters.

`ContinueAsNewWorkflowExecution`
+ `tagList.member.0` – String constraint. The key is `swf:tagList.member.0`
+ `tagList.member.1` – String constraint. The key is `swf:tagList.member.1`
+ `tagList.member.2` – String constraint. The key is `swf:tagList.member.2`
+ `tagList.member.3` – String constraint. The key is `swf:tagList.member.3`
+ `tagList.member.4` – String constraint. The key is `swf:tagList.member.4`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.
+ `workflowTypeVersion` – String constraint. The key is `swf:workflowTypeVersion`.

**Note**  
You can't constrain more than five tags.

`FailWorkflowExecution`
+ You can't constrain this action's parameters.

`RecordMarker`
+ You can't constrain this action's parameters.

`RequestCancelActivityTask`
+ You can't constrain this action's parameters.

`RequestCancelExternalWorkflowExecution`
+ You can't constrain this action's parameters.

`ScheduleActivityTask`
+ `activityType.name` – String constraint. The key is `swf:activityType.name`.
+ `activityType.version` – String constraint. The key is `swf:activityType.version`.
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.

`SignalExternalWorkflowExecution`
+ You can't constrain this action's parameters.

`StartChildWorkflowExecution`
+ `tagList.member.0` – String constraint. The key is `swf:tagList.member.0`
+ `tagList.member.1` – String constraint. The key is `swf:tagList.member.1`
+ `tagList.member.2` – String constraint. The key is `swf:tagList.member.2`
+ `tagList.member.3` – String constraint. The key is `swf:tagList.member.3`
+ `tagList.member.4` – String constraint. The key is `swf:tagList.member.4`
+ `taskList.name` – String constraint. The key is `swf:taskList.name`.
+ `workflowType.name` – String constraint. The key is `swf:workflowType.name`.
+ `workflowType.version` – String constraint. The key is `swf:workflowType.version`.

**Note**  
You can't constrain more than five tags.

`StartTimer`
+ You can't constrain this action's parameters.

# Tag-based Policies
<a name="tag-based-policies"></a>

Amazon SWF supports policies based on tags. For instance, you could restrict Amazon SWF domains that include a tag with the key `environment` and the value `production` with the following condition:

```
"Condition": {
    "StringEquals": {"aws:ResourceTag/environment": "production"}
}
```

For more information on tagging, see:
+ [Tags in Amazon SWF](swf-dev-adv-tags.md)
+ [Controlling Access Using IAM Tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html)

# Amazon VPC endpoints for Amazon SWF
<a name="swf-vpc-endpoints"></a>

**Note**  
AWS PrivateLink support is currently available in the AWS Top Secret - East, AWS Secret Region, and China Regions only.

If you use Amazon Virtual Private Cloud (Amazon VPC) to host your AWS resources, you can establish a connection between your Amazon VPC and Amazon Simple Workflow Service workflows. You can use this connection with your Amazon SWF workflows without crossing the public internet. 

Amazon VPC lets you launch AWS resources in a custom virtual network. You can use a VPC to control your network settings, such as the IP address range, subnets, route tables, and network gateways. For more information about VPCs, see the [Amazon VPC User Guide](https://docs.aws.amazon.com/vpc/latest/userguide/).

To connect your Amazon VPC to Amazon SWF you must first define an *interface VPC endpoint*, which lets you connect your VPC to other AWS services. The endpoint provides reliable, scalable connectivity, without requiring an internet gateway, network address translation (NAT) instance, or VPN connection. For more information, see [Interface VPC Endpoints (AWS PrivateLink)](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html) in the *Amazon VPC User Guide*.

## Creating the Endpoint
<a name="swf-vpc-endpoint-create"></a>

You can create an Amazon SWF endpoint in your VPC using the AWS Management Console, the AWS Command Line Interface (AWS CLI), an AWS SDK, the Amazon SWF API, or CloudFormation.

For information about creating and configuring an endpoint using the Amazon VPC console or the AWS CLI, see [Creating an Interface Endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint) in the *Amazon VPC User Guide.*

**Note**  
 When you create an endpoint, specify Amazon SWF as the service that you want your VPC to connect to. In the Amazon VPC console, service names vary based on the AWS Region. For example, in the AWS Top Secret - East Region, the service name for Amazon SWF is **com.amazonaws.us-iso-east-1.swf**.

For information about creating and configuring an endpoint using CloudFormation, see the [AWS::EC2::VPCEndpoint](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpcendpoint.html) resource in the *CloudFormation User Guide*.

## Amazon VPC Endpoint Policies
<a name="swf-vpc-endpoint-policy"></a>

To control connectivity access to Amazon SWF you can attach an AWS Identity and Access Management (IAM) endpoint policy while creating an Amazon VPC endpoint. You can create complex IAM rules by attaching multiple endpoint policies. For more information, see:
+  [Amazon Virtual Private Cloud Endpoint Policies for Amazon SWF](swf-vpc-iam.md) 
+  [Controlling Access to Services with VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html) 

# Amazon Virtual Private Cloud Endpoint Policies for Amazon SWF
<a name="swf-vpc-iam"></a>

You can create an Amazon VPC endpoint policy for Amazon SWF in which you specify the following:
+ The **principal** that can perform actions.
+ The actions that can be performed.
+ The resources on which the actions can be performed.

The following example adds a specific IAM role to a policy:

```
"Principal": {
   "AWS": "arn:aws:iam::123456789012:role/MyRole"
}
```
+ For more information about creating endpoint policies, see [Controlling Access to Services with VPC Endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html).
+ For information about how you can use IAM to control access to your AWS and Amazon SWF resources, see [Identity and Access Management in Amazon Simple Workflow Service](swf-dev-iam.md).

# Troubleshooting Amazon Simple Workflow Service identity and access
<a name="security_iam_troubleshoot"></a>

Use the following information to help you diagnose and fix common issues that you might encounter when working with Amazon SWF and IAM.

**Topics**
+ [I am not authorized to perform an action in Amazon SWF](#security_iam_troubleshoot-no-permissions)
+ [I am not authorized to perform iam:PassRole](#security_iam_troubleshoot-passrole)
+ [I want to allow people outside of my AWS account to access my Amazon SWF resources](#security_iam_troubleshoot-cross-account-access)

## I am not authorized to perform an action in Amazon SWF
<a name="security_iam_troubleshoot-no-permissions"></a>

If you receive an error that you're not authorized to perform an action, your policies must be updated to allow you to perform the action.

The following example error occurs when the `mateojackson` user tries to use the console to view details about a fictional `my-example-widget` resource but does not have the fictional `swf:GetWidget` permissions.

```
User: arn:aws:iam::123456789012:user/mateojackson is not authorized to perform: swf:GetWidget on resource: my-example-widget
```

In this case, Mateo's policy must be updated to allow him to access the `my-example-widget` resource using the `swf:GetWidget` action.

If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

## I am not authorized to perform iam:PassRole
<a name="security_iam_troubleshoot-passrole"></a>

If you receive an error that you're not authorized to perform the `iam:PassRole` action, your policies must be updated to allow you to pass a role to Amazon SWF.

Some AWS services allow you to pass an existing role to that service instead of creating a new service role or service-linked role. To do this, you must have permissions to pass the role to the service.

The following example error occurs when an IAM user named `marymajor` tries to use the console to perform an action in Amazon SWF. However, the action requires the service to have permissions that are granted by a service role. Mary does not have permissions to pass the role to the service.

```
User: arn:aws:iam::123456789012:user/marymajor is not authorized to perform: iam:PassRole
```

In this case, Mary's policies must be updated to allow her to perform the `iam:PassRole` action.

If you need help, contact your AWS administrator. Your administrator is the person who provided you with your sign-in credentials.

## I want to allow people outside of my AWS account to access my Amazon SWF resources
<a name="security_iam_troubleshoot-cross-account-access"></a>

You can create a role that users in other accounts or people outside of your organization can use to access your resources. You can specify who is trusted to assume the role. For services that support resource-based policies or access control lists (ACLs), you can use those policies to grant people access to your resources.

To learn more, consult the following:
+ To learn whether Amazon SWF supports these features, see [How Amazon Simple Workflow Service works with IAM](security_iam_service-with-iam.md).
+ To learn how to provide access to your resources across AWS accounts that you own, see [Providing access to an IAM user in another AWS account that you own](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_aws-accounts.html) in the *IAM User Guide*.
+ To learn how to provide access to your resources to third-party AWS accounts, see [Providing access to AWS accounts owned by third parties](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html) in the *IAM User Guide*.
+ To learn how to provide access through identity federation, see [Providing access to externally authenticated users (identity federation)](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_federated-users.html) in the *IAM User Guide*.
+ To learn the difference between using roles and resource-based policies for cross-account access, see [Cross account resource access in IAM](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html) in the *IAM User Guide*.