

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# と AWS Serverless Application Repository IAM の連携方法


IAM を使用して へのアクセスを管理する前に AWS Serverless Application Repository、 で使用できる IAM 機能を理解しておく必要があります AWS Serverless Application Repository。

IAM の仕組みの概要については、*IAM ユーザーガイド*の [IAM の仕組みについて](https://docs.aws.amazon.com/IAM/latest/UserGuide/intro-structure.html)を参照してください。 AWS Serverless Application Repository およびその他の AWS のサービスが IAM と連携する方法の概要を把握するには、IAM *ユーザーガイド*の[AWS 「IAM と連携する のサービス](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html)」を参照してください。

**Topics**
+ [

## AWS Serverless Application Repository ID ベースのポリシー
](#security_iam_service-with-iam-id-based-policies)
+ [

## AWS Serverless Application Repository アプリケーションポリシー
](#security_iam_service-with-iam-resource-based-policies)
+ [

## AWS Serverless Application Repository タグに基づいた認可
](#security_iam_service-with-iam-tags)
+ [

## AWS Serverless Application Repository IAM ロール
](#security_iam_service-with-iam-roles)

## AWS Serverless Application Repository ID ベースのポリシー


IAM アイデンティティベースポリシーでは、許可または拒否するアクションとリソース、またアクションを許可または拒否する条件を指定できます。 AWS Serverless Application Repository は、特定のアクション、リソース、および条件キーをサポートしています。JSON ポリシーで使用するすべての要素については、「IAM ユーザーガイド」の「[IAM JSON ポリシー要素のリファレンス](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html)」を参照してください。

以下に示しているのは、アクセス許可ポリシーの例です。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "CreateApplication",
            "Effect": "Allow",
            "Action": [
                "serverlessrepo:CreateApplication"
            ],
            "Resource": "*"
        },
        {
            "Sid": "CreateApplicationVersion",
            "Effect": "Allow",
            "Action": [
                "serverlessrepo:CreateApplicationVersion"
            ],
            "Resource": "arn:aws:serverlessrepo:us-east-1:111122223333:applications/application-name"
        }
    ]
}
```

------

 このポリシーには以下の 2 つのステートメントがあります。




+  最初のステートメントは、ワイルドカード文字 (\$1) を`Resource`値として指定して、すべての AWS Serverless Application Repository リソース`serverlessrepo:CreateApplication`に対する AWS Serverless Application Repository アクションのアクセス許可を付与します。
+ 2 番目のステートメントは、 AWS Serverless Application Repository アプリケーションの Amazon リソースネーム (ARN) を使用して、 AWS リソース`serverlessrepo:CreateApplicationVersion`に対する AWS Serverless Application Repository アクションのアクセス許可を付与します。アプリケーションは、`Resource` 値を使用して指定します。

アイデンティティベースのポリシーでは、アクセス許可の付与先のプリンシパルを指定しないため、`Principal` 要素は指定されません。ユーザーにポリシーをアタッチすると、そのユーザーが暗黙のプリンシパルになります。IAM ロールにアクセス許可ポリシーをアタッチすると、ロールの信頼ポリシーで識別されたプリンシパルがアクセス許可を得ることになります。

 すべての AWS Serverless Application Repository API オペレーションとそれらが適用される AWS リソースを示す表については、「」を参照してください[AWS Serverless Application Repository API アクセス許可: アクションとリソースのリファレンス](serverlessrepo-api-permissions-ref.md)。

### アクション


管理者は JSON AWS ポリシーを使用して、誰が何にアクセスできるかを指定できます。つまり、どの**プリンシパル**がどの**リソース**に対してどのような**条件下で****アクション**を実行できるかということです。

JSON ポリシーの `Action` 要素にはポリシー内のアクセスを許可または拒否するために使用できるアクションが記述されます。このアクションは関連付けられたオペレーションを実行するためのアクセス許可を付与するポリシーで使用されます。

のポリシーアクションは、アクションの前にプレフィックス AWS Serverless Application Repository を使用します`serverlessrepo:`。たとえば、 `SearchApplications` API オペレーションで AWS Serverless Application Repository AWS Serverless Application Repository インスタンスを実行するアクセス許可を付与するには、ポリシーに `serverlessrepo:SearchApplications`アクションを含めます。ポリシーステートメントには`Action` または `NotAction` 要素を含める必要があります。は、このサービスで実行できるタスクを記述する独自のアクションのセット AWS Serverless Application Repository を定義します。

単一のステートメントに複数のアクションを指定するには次のようにコンマで区切ります。

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

ワイルドカード (\$1) を使用して複数アクションを指定できます。例えば、`List` という単語で始まるすべてのアクションを指定するには次のアクションを含めます。

```
"Action": "serverlessrepo:List*"
```



 AWS Serverless Application Repository アクションのリストを確認するには、*IAM ユーザーガイド*の[「 で定義されるアクション AWS Serverless Application Repository](https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awsserverlessapplicationrepository.html#awsserverlessapplicationrepository-actions-as-permissions)」を参照してください。

### リソース


管理者は JSON AWS ポリシーを使用して、誰が何にアクセスできるかを指定できます。つまり、どの**プリンシパル**がどの**リソース**に対してどのような**条件**下で**アクション**を実行できるかということです。

`Resource` JSON ポリシー要素はアクションが適用されるオブジェクトを指定します。ベストプラクティスとして、[Amazon リソースネーム (ARN)](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html) を使用してリソースを指定します。リソースレベルのアクセス許可をサポートしないアクションの場合は、ステートメントがすべてのリソースに適用されることを示すために、ワイルドカード (\$1) を使用します。

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

では AWS Serverless Application Repository、プライマリ AWS リソースは *application* AWS Serverless Application Repository . AWS Serverless Application Repository applications です。次の表に示すように、アプリケーションには一意の Amazon リソースネーム (ARNs) が関連付けられています。


****  

| AWS リソースタイプ | Amazon リソースネーム（ARN）形式  | 
| --- | --- | 
| アプリケーション |  arn:*partition*:serverlessrepo:*region*:*account-id*:applications/*application-name*  | 

ARN の形式の詳細については、[「Amazon リソースネーム (ARNs AWS 「サービス名前空間](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)」を参照してください。

以下は、すべての AWS リソースに対する `serverlessrepo:ListApplications`アクションのアクセス許可を付与するポリシーの例です。現在の実装では、 AWS Serverless Application Repository は一部の API アクションで AWS リソース ARNs (リソースレベルのアクセス許可とも呼ばれます) を使用した特定の AWS リソースの識別をサポートしていません。このような場合は、ワイルドカード文字 (\$1) を指定する必要があります。

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

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ListExistingApplications",
            "Effect": "Allow",
            "Action": [
                "serverlessrepo:ListApplications"
            ],
            "Resource": "*"
        }
    ]
}
```

------

すべての AWS Serverless Application Repository API アクションとそれらが適用される AWS リソースを示す表については、「」を参照してください[AWS Serverless Application Repository API アクセス許可: アクションとリソースのリファレンス](serverlessrepo-api-permissions-ref.md)。

### 条件キー


 AWS Serverless Application Repository にはサービス固有の条件キーはありませんが、一部のグローバル条件キーの使用がサポートされています。すべての AWS グローバル条件キーを確認するには、*IAM ユーザーガイド*の[AWS 「グローバル条件コンテキストキー](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)」を参照してください。

### 例




 AWS Serverless Application Repository アイデンティティベースのポリシーの例を表示するには、「」を参照してください[AWS Serverless Application Repository ID ベースのポリシーの例](security_iam_id-based-policy-examples.md)。

## AWS Serverless Application Repository アプリケーションポリシー


アプリケーションポリシーは、指定されたプリンシパルまたは principalOrg が AWS Serverless Application Repository アプリケーションで実行できるアクションを決定します。

 AWS Serverless Application Repository アプリケーションに関連付けられたポリシーにアクセス許可を追加できます。 AWS Serverless Application Repository アプリケーションにアタッチされたアクセス許可ポリシーは、*アプリケーションポリシー*と呼ばれます。[アプリケーションポリシー](security_iam_resource-based-policy-examples.md)は、[IAM リソースベースのポリシー](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_identity-vs-resource.html)の拡張機能です。プライマリリソースはアプリケーションです AWS Serverless Application Repository 。 AWS Serverless Application Repository アプリケーションポリシーを使用して、アプリケーションのデプロイ許可を管理できます。

AWS Serverless Application Repository アプリケーションポリシーは、主にパブリッシャーがアプリケーションをデプロイするためのアクセス許可をコンシューマーに付与するために使用されます。また、これらのアプリケーションの詳細を検索して表示するための などの関連オペレーションも使用します。パブリッシャーは、アプリケーションへのアクセス許可を次の 3 つのカテゴリに設定できます。
+ **非公開** – 同じアカウントで作成され、他のアカウントと共有されていないアプリケーション。この AWS アカウントを使用して作成されたアプリケーションをデプロイするためのアクセス許可が付与されます。
+ **プライベート共有** – パブリッシャーが特定の AWS アカウントまたは AWS Organizations のセットと明示的に共有したアプリケーション。アカウント AWS または AWS Organization と共有されているアプリケーションをデプロイするアクセス許可があります。
+ **公開共有** – パブリッシャーがすべてのユーザーと共有しているアプリケーション。すべての公開共有アプリケーションをデプロイするためのアクセス許可が付与されます。

アクセス許可を付与するには AWS CLI、、 AWS SDKs、または を使用します AWS マネジメントコンソール。

### 例


 AWS Serverless Application Repository アプリケーションポリシーの管理例については、「」を参照してください[AWS Serverless Application Repository アプリケーションポリシーの例](security_iam_resource-based-policy-examples.md)。

## AWS Serverless Application Repository タグに基づいた認可


 AWS Serverless Application Repository は、タグに基づくリソースまたはアクションへのアクセスの制御をサポートしていません。

## AWS Serverless Application Repository IAM ロール


[IAM ロール](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html)は、特定のアクセス許可を持つ AWS アカウント内のエンティティです。

### での一時的な認証情報の使用 AWS Serverless Application Repository


一時的な認証情報を使用して、フェデレーションでサインイン、IAM ロールを引き受ける、またはクロスアカウントロールを引き受けることができます。一時的なセキュリティ認証情報を取得するには、[AssumeRole](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) や [GetFederationToken](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetFederationToken.html) などの AWS STS API オペレーションを呼び出します。

では、一時的な認証情報の使用 AWS Serverless Application Repository がサポートされています。

### サービスリンクロール


 AWS Serverless Application Repository は、サービスにリンクされたロールをサポートしていません。

### サービスロール


 AWS Serverless Application Repository はサービスロールをサポートしていません。