

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

# Auth
<a name="sam-property-graphqlapi-auth"></a>

GraphQL API 用の認可を設定します。

## 構文
<a name="sam-property-graphqlapi-auth-syntax"></a>

 AWS Serverless Application Model (AWS SAM) テンプレートでこのエンティティを宣言するには、次の構文を使用します。

### YAML
<a name="sam-property-graphqlapi-auth-syntax-yaml"></a>

```
Additional:
- AuthProvider
LambdaAuthorizer: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)
OpenIDConnect: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)
Type: String
UserPool: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)
```

## プロパティ
<a name="sam-property-graphqlapi-auth-properties"></a>

`Additional`  <a name="sam-graphqlapi-auth-additional"></a>
GraphQL API 向けの、追加の認可タイプのリストです。  
タイプ: [AuthProvider](sam-property-graphqlapi-auth-authprovider.md) のリスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、同等の CloudFormation プロパティはありません。

`LambdaAuthorizer`  <a name="sam-graphqlapi-auth-lambdaauthorizer"></a>
Lambda 関数オーソライザーのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AWS_LAMBDA` として指定する場合に設定できます。  
*タイプ*: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[ LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)`プロパティに直接渡されます。

`OpenIDConnect`  <a name="sam-graphqlapi-auth-openidconnect"></a>
OpenID Connect 準拠サービスのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `OPENID_CONNECT` として指定する場合に設定できます。  
*タイプ*: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-openidconnectconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[ OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)`プロパティに直接渡されます。

`Type`  <a name="sam-graphqlapi-auth-type"></a>
アプリケーションと AWS AppSync GraphQL API 間のデフォルトの認可タイプ。  
許可される値のリストと説明については、「*AWS AppSync Developer Guide*」の「[Authorization and authentication](https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html)」を参照してください。  
Lambda オーソライザー () を指定すると`AWS_LAMBDA`、 は GraphQL API と Lambda 関数間のアクセス許可をプロビジョニングする AWS Identity and Access Management (IAM) ポリシー AWS SAM を作成します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[AuthenticationType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-authenticationtype)`プロパティに直接渡されます。

`UserPool`  <a name="sam-graphqlapi-auth-userpool"></a>
Amazon Cognito ユーザープールを使用するためのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AMAZON_COGNITO_USER_POOLS` として指定する場合に設定できます。  
*タイプ*: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-userpoolconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi`リソースの `[ UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)`プロパティに直接渡されます。

## 例
<a name="sam-property-graphqlapi-auth-examples"></a>

### デフォルトとその他の認可タイプの設定
<a name="sam-property-graphqlapi-auth-examples-example1"></a>

この例では、まず Lambda オーソライザーを GraphQL API のデフォルトの認可タイプとして設定します。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyGraphQLAPI:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      Auth:
        Type: AWS_LAMBDA
        LambdaAuthorizer:
          AuthorizerUri: !GetAtt Authorizer1.Arn
          AuthorizerResultTtlInSeconds: 10
          IdentityValidationExpression: hello
```

次に、 AWS SAM テンプレートに以下を追加して、GraphQL API のその他の認可タイプを設定します。

```
        Additional:
        - Type: AWS_IAM
        - Type: API_KEY
        - Type: OPENID_CONNECT
          OpenIDConnect:
            AuthTTL: 10
            ClientId: myId
            IatTTL: 10
            Issuer: prod
```

これにより、次の AWS SAM テンプレートが生成されます。

```
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
...
Resources:
  MyGraphQLAPI:
    Type: AWS::Serverless::GraphQLApi
    Properties:
      Auth:
        Type: AWS_LAMBDA
        LambdaAuthorizer:
          AuthorizerUri: !GetAtt Authorizer1.Arn
          AuthorizerResultTtlInSeconds: 10
          IdentityValidationExpression: hello
        Additional:
        - Type: AWS_IAM
        - Type: API_KEY
        - Type: OPENID_CONNECT
          OpenIDConnect:
            AuthTTL: 10
            ClientId: myId
            IatTTL: 10
            Issuer: prod
```

# AuthProvider
<a name="sam-property-graphqlapi-auth-authprovider"></a>

追加の GraphQL API 認可タイプ用のオプションの認可設定。

## 構文
<a name="sam-property-graphqlapi-auth-authprovider-syntax"></a>

 AWS Serverless Application Model (AWS SAM) テンプレートでこのエンティティを宣言するには、次の構文を使用します。

### YAML
<a name="sam-property-graphqlapi-auth-authprovider-syntax-yaml"></a>

```
LambdaAuthorizer: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)
OpenIDConnect: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)
Type: String
UserPool: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)
```

## プロパティ
<a name="sam-property-graphqlapi-auth-authprovider-properties"></a>

`LambdaAuthorizer`  <a name="sam-graphqlapi-auth-authprovider-lambdaauthorizer"></a>
 AWS Lambda 関数オーソライザーのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AWS_LAMBDA` として指定する場合に設定できます。  
*タイプ*: [LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-lambdaauthorizerconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ LambdaAuthorizerConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-lambdaauthorizerconfig.html)`プロパティに直接渡されます。

`OpenIDConnect`  <a name="sam-graphqlapi-auth-authprovider-openidconnect"></a>
OpenID Connect 準拠サービスのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `OPENID_CONNECT` として指定する場合に設定できます。  
*タイプ*: [OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-openidconnectconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ OpenIDConnectConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-openidconnectconfig.html)`プロパティに直接渡されます。

`Type`  <a name="sam-graphqlapi-auth-authprovider-type"></a>
アプリケーションと AWS AppSync GraphQL API 間のデフォルトの認可タイプ。  
許可される値のリストと説明については、「*AWS AppSync Developer Guide*」の「[Authorization and authentication](https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html)」を参照してください。  
Lambda オーソライザー () を指定すると`AWS_LAMBDA`、 は GraphQL API と Lambda 関数間のアクセス許可をプロビジョニングする AWS Identity and Access Management (IAM) ポリシー AWS SAM を作成します。  
*タイプ*: 文字列  
*必須*: はい  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ AuthenticationType](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html#cfn-appsync-graphqlapi-additionalauthenticationprovider-authenticationtype)`プロパティに直接渡されます。

`UserPool`  <a name="sam-graphqlapi-auth-authprovider-userpool"></a>
Amazon Cognito ユーザープールを使用するためのオプションの認可設定を指定します。このオプションプロパティは、`Type` を `AMAZON_COGNITO_USER_POOLS` として指定する場合に設定できます。  
*タイプ*: [UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-userpoolconfig)  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは、 `AWS::AppSync::GraphQLApi` `[ AdditionalAuthenticationProvider](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-additionalauthenticationprovider.html)` オブジェクトの `[ UserPoolConfig](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-appsync-graphqlapi-userpoolconfig.html)`プロパティに直接渡されます。