

• AWS Systems Manager CloudWatch ダッシュボードは、2026 年 4 月 30 日以降は利用できなくなります。お客様は、これまでと同様に Amazon CloudWatch コンソールを使用して、Amazon CloudWatch ダッシュボードの表示、作成、管理を継続できます。詳細については、「[Amazon CloudWatch ダッシュボードのドキュメント](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html)」を参照してください。

# アイデンティティベースのポリシーの設定例
<a name="automation-setup-identity-based-policies"></a>

以下のセクションでは、AWS Systems Manager Automation サービスの IAM アイデンティティベースのポリシーの例を示します。これらの JSON ポリシードキュメント例を使用して IAM の ID ベースのポリシーを作成する方法の詳細については、IAM ユーザーガイドの「[Creating IAM policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html#access_policies_create-json-editor)」を参照してください。

**注記**  
すべての例では架空のアカウント ID が使用されています。AWS 所有のパブリックドキュメントでは、Amazon リソースネーム (ARN) でアカウント ID は指定されていません。

 **例** 
+  [例 1: ユーザーがオートメーションドキュメントを実行してオートメーション実行を表示することを許可する](#automation-setup-identity-based-policies-example-1) 
+  [例 2: ユーザーが特定のバージョンのオートメーションドキュメントを実行することを許可する](#automation-setup-identity-based-policies-example-2) 
+  [例 3: ユーザーが特定のタグを使用してオートメーションドキュメントを実行することを許可する](#automation-setup-identity-based-policies-example-3) 
+  [例 4: 自動化の実行に特定のタグパラメータが指定されている場合にユーザーがオートメーションドキュメントを実行することを許可する](#automation-setup-identity-based-policies-example-4) 

## 例 1: ユーザーがオートメーションドキュメントを実行してオートメーション実行を表示することを許可する
<a name="automation-setup-identity-based-policies-example-1"></a>

次の IAM ポリシーの例では、ユーザーに次の操作を許可します。
+ ポリシーで指定されたオートメーションドキュメントの実行 ドキュメント名は次のエントリによって決定します。

  ```
  arn:aws:ssm:*:111122223333:document/{{DocumentName}}
  ```
+ オートメーション実行の停止とシグナル送信
+ オートメーション実行の開始後のオートメーション実行の詳細の表示

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": "ssm:StartAutomationExecution",
            "Effect": "Allow",
            "Resource": [
                "arn:aws:ssm:*:111122223333:document/{{DocumentName}}",
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ]
        },
        {
            "Action": [
                "ssm:StopAutomationExecution",
                "ssm:GetAutomationExecution",
                "ssm:DescribeAutomationExecutions",
                "ssm:DescribeAutomationStepExecutions",
                "ssm:SendAutomationSignal"
            ],
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ],
            "Effect": "Allow"
        }
    ]
}
```

------

## 例 2: ユーザーが特定のバージョンのオートメーションドキュメントを実行することを許可する
<a name="automation-setup-identity-based-policies-example-2"></a>

次の IAM ポリシーの例では、オートメーションドキュメントの特定のバージョンの実行をユーザーに許可します。
+ オートメーションドキュメントの名前は次のエントリによって決定します。

  ```
  arn:aws:ssm:*:111122223333:document/{{DocumentName}}
  ```
+ オートメーションドキュメントのバージョンは次のエントリによって決定します。

  ```
  "ssm:DocumentVersion": "5"
  ```

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": "ssm:StartAutomationExecution",
            "Effect": "Allow",
            "Resource": [
                "arn:aws:ssm:*:111122223333:document/{{DocumentName}}"
            ],
            "Condition": {
                "ForAnyValue:StringEquals": {
                   "ssm:DocumentVersion": ["5"]
                }
            }
        },
        {
            "Action": [
                "ssm:StartAutomationExecution"
            ],
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "ssm:StopAutomationExecution",
                "ssm:GetAutomationExecution",
                "ssm:DescribeAutomationExecutions",
                "ssm:DescribeAutomationStepExecutions",
                "ssm:SendAutomationSignal"
            ],
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ],
            "Effect": "Allow"
        }
    ]
}
```

------

## 例 3: ユーザーが特定のタグを使用してオートメーションドキュメントを実行することを許可する
<a name="automation-setup-identity-based-policies-example-3"></a>

次の IAM ポリシーの例では、特定のタグを持つオートメーションドキュメントの実行をユーザーに許可します。
+ オートメーションドキュメントの名前は次のエントリによって決定します。

  ```
  arn:aws:ssm:*:111122223333:document/{{DocumentName}}
  ```
+ ドキュメントのタグは次のエントリによって決定します。

  ```
  "ssm:DocumentVersion": "5"
  ```

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": "ssm:StartAutomationExecution",
            "Effect": "Allow",
            "Resource": [
                "arn:aws:ssm:*:111122223333:document/*"
            ],
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/stage": "production"
                }
            }
        },
        {
            "Action": [
                "ssm:StartAutomationExecution"
            ],
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "ssm:StopAutomationExecution",
                "ssm:GetAutomationExecution",
                "ssm:DescribeAutomationExecutions",
                "ssm:DescribeAutomationStepExecutions",
                "ssm:SendAutomationSignal"
            ],
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ],
            "Effect": "Allow"
        }
    ]
}
```

------

## 例 4: 自動化の実行に特定のタグパラメータが指定されている場合にユーザーがオートメーションドキュメントを実行することを許可する
<a name="automation-setup-identity-based-policies-example-4"></a>

次の例では、IAM ポリシーは、特定のタグパラメータがオートメーション実行に指定されている場合にオートメーションドキュメントを実行するアクセス許可をユーザーに付与します。
+ ポリシーで指定されたオートメーションドキュメントの実行 ドキュメント名は次のエントリによって決定します。

  ```
  arn:aws:ssm:*:111122223333:document/{{DocumentName}}
  ```
+ オートメーション実行に特定のタグパラメータを指定する必要があります。オートメーション実行リソースのタグパラメータは、次のエントリによって決まります。

  ```
  "aws:ResourceTag/stage": "production"
  ```
+ 指定されたタグがあるオートメーション実行の停止とシグナルの送信。
+ 指定されたタグがあるオートメーション実行の詳細の表示。
+ 指定されたタグを SSM リソースにタグの追加。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Action": "ssm:StartAutomationExecution",
            "Effect": "Allow",
            "Resource": [
                "arn:aws:ssm:*:111122223333:document/{{DocumentName}}"
            ]
        },
        {
            "Action": [
                "ssm:StartAutomationExecution",
                "ssm:StopAutomationExecution",
                "ssm:GetAutomationExecution",
                "ssm:DescribeAutomationExecutions",
                "ssm:DescribeAutomationStepExecutions",
                "ssm:SendAutomationSignal"
            ],
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ],
            "Effect": "Allow",
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/environment": "beta"
                }
            }
        },
        {
            "Action": "ssm:AddTagsToResource",
            "Effect": "Allow",
            "Resource": [
                "arn:aws:ssm:*:111122223333:automation-execution/*"
            ]
        }
    ]
}
```

------