AWS::Cognito::UserPoolIdentityProvider
AWS::Cognito::UserPoolIdentityProvider
リソースは、ユーザープールの ID プロバイダーを作成します。
構文
AWS CloudFormation テンプレートでこのエンティティを宣言するには、次の構文を使用します。
JSON
{ "Type" : "AWS::Cognito::UserPoolIdentityProvider", "Properties" : { "AttributeMapping" :
Json
, "IdpIdentifiers" :[ String, ... ]
, "ProviderDetails" :Json
, "ProviderName" :String
, "ProviderType" :String
, "UserPoolId" :String
} }
YAML
Type: AWS::Cognito::UserPoolIdentityProvider Properties: AttributeMapping:
Json
IdpIdentifiers:- String
ProviderDetails:Json
ProviderName:String
ProviderType:String
UserPoolId:String
プロパティ
AttributeMapping
-
ID プロバイダー属性の標準およびカスタムユーザープール属性へのマッピング。
必須: いいえ
タイプ: Json
Update requires: No interruption
IdpIdentifiers
-
ID プロバイダー 識別子のリスト。
必須: いいえ
タイプ: 文字列のリスト
最大:
50
Update requires: No interruption
ProviderDetails
-
ID プロバイダの詳細。以下のリストは、各 ID プロバイダの種類のプロバイダ詳細キーを示しています。
-
Google と Login with Amazon の場合:
-
client_id
-
client_secret
-
authorize_scopes
-
-
Facebook の場合:
-
client_id
-
client_secret
-
authorize_scopes
-
api_version
-
-
Sign in with Apple の場合:
-
client_id
-
team_id
-
key_id
-
private_key
-
authorize_scopes
-
-
OIDC プロバイダの場合:
-
client_id
-
client_secret
-
attributes_request_method
-
oidc_issuer
-
authorize_scopes
-
oidc_issuer キーで指定された検出 URL から利用できない場合は authorize_url
-
oidc_issuer キーで指定された検出 URL から利用できない場合は token_url
-
oidc_issuer キーで指定された検出 URL から利用できない場合は attributes_url
-
oidc_issuer キーで指定された検出 URL から利用できない場合は jwks_uri
-
-
SAML プロバイダの場合:
-
MetadataFile または MetadataURL
-
IDPSignout オプション
-
必須: いいえ
タイプ: Json
Update requires: No interruption
-
ProviderName
-
ID プロバイダー名。
必須: はい
タイプ: 文字列
最小:
1
最大:
32
パターン:
[^_][\p{L}\p{M}\p{S}\p{N}\p{P}][^_]+
Update requires: Replacement
ProviderType
-
ID プロバイダーのタイプ。
必須: はい
タイプ: 文字列
許可された値:
Facebook | Google | LoginWithAmazon | OIDC | SAML | SignInWithApple
Update requires: Replacement
UserPoolId
-
ユーザープール ID。
必須: はい
タイプ: 文字列
最小:
1
最大:
55
パターン:
[\w-]+_[0-9a-zA-Z]+
Update requires: Replacement
戻り値
参照番号
このリソースの論理 ID を組み込みの Ref
関数に渡すと、Ref
は次を返します: physicalResourceId。これは「ProviderName」です。次に例を示します。
{ "Ref": "testProvider" }
Amazon Cognito ID プロバイダー testProvider
の場合、Ref は ID プロバイダーの名前を返します。
For more information about using the Ref
function, see Ref.
例
新しい Login with Amazon ID プロバイダの作成
次の例では、参照されるユーザープールに Login with Amazon ID プロバイダを作成します。
JSON
{ "UserPoolIdentityProvider": { "Type": "AWS::Cognito::UserPoolIdentityProvider", "Properties": { "UserPoolId": { "Ref": "UserPool" }, "ProviderName": "LoginWithAmazon", "ProviderDetails": { "client_id": "YourLoginWithAmazonAppId", "client_secret": "YourLoginWithAmazonAppSecret", "authorize_scopes": "profile postal_code" }, "ProviderType": "LoginWithAmazon", "AttributeMapping": { "email": "email" } } } }
YAML
UserPoolIdentityProvider: Type: AWS::Cognito::UserPoolIdentityProvider Properties: UserPoolId: !Ref UserPool ProviderName: "LoginWithAmazon" ProviderDetails: client_id: "YourLoginWithAmazonAppId" client_secret: "YourLoginWithAmazonAppSecret" authorize_scopes: "profile postal_code" ProviderType: "LoginWithAmazon" AttributeMapping: email: "email"
新しい Google ID プロバイダの作成
次の例では、参照されるユーザープールに Google ID プロバイダを作成します。
JSON
{ "UserPoolIdentityProvider": { "Type": "AWS::Cognito::UserPoolIdentityProvider", "Properties": { "UserPoolId": { "Ref": "UserPool" }, "ProviderName": "Google", "ProviderDetails": { "client_id": "YourGoogleAppId", "client_secret": "YourGoogleAppSecret", "authorize_scopes": "profile email openid" }, "ProviderType": "Google", "AttributeMapping": { "email": "email" } } } }
YAML
UserPoolIdentityProvider: Type: AWS::Cognito::UserPoolIdentityProvider Properties: UserPoolId: !Ref UserPool ProviderName: "Google" ProviderDetails: client_id: "YourGoogleAppId" client_secret: "YourGoogleAppSecret" authorize_scopes: "profile email openid" ProviderType: "Google" AttributeMapping: email: "email"
新しい Facebook ID プロバイダの作成
次の例では、参照されるユーザープールに Facebook プロバイダを作成します。
JSON
{ "UserPoolIdentityProvider": { "Type": "AWS::Cognito::UserPoolIdentityProvider", "Properties": { "UserPoolId": { "Ref": "UserPool" }, "ProviderName": "Facebook", "ProviderDetails": { "client_id": "YourFacebookAppId", "client_secret": "YourFacebookAppSecret", "authorize_scopes": "public_profile,email" }, "ProviderType": "Facebook", "AttributeMapping": { "email": "email" } } } }
YAML
UserPoolIdentityProvider: Type: AWS::Cognito::UserPoolIdentityProvider Properties: UserPoolId: !Ref UserPool ProviderName: "Facebook" ProviderDetails: client_id: "YourFacebookAppId" client_secret: "YourFacebookAppSecret" authorize_scopes: "public_profile,email" ProviderType: "Facebook" AttributeMapping: email: "email"
新しい Sign in With Apple ID プロバイダの作成
次の例では、参照されるユーザープールに Sign in with Apple ID プロバイダを作成します。
JSON
{ "UserPoolIdentityProvider": { "Type": "AWS::Cognito::UserPoolIdentityProvider", "Properties": { "UserPoolId": { "Ref": "UserPool" }, "ProviderName": "SignInWithApple", "ProviderDetails": { "client_id": "YourAppleServicesId", "team_id": "YourAppleTeamId", "key_id": "YourApplePrivateKeyID", "private_key": "YourApplePrivateKey", "authorize_scopes": "public_profile,email" }, "ProviderType": "SignInWithApple", "AttributeMapping": { "email": "email" } } } }
YAML
UserPoolIdentityProvider: Type: AWS::Cognito::UserPoolIdentityProvider Properties: UserPoolId: !Ref UserPool ProviderName: "SignInWithApple" ProviderDetails: client_id: "YourSign" team_id: "YourAppleTeamId", key_id: "YourApplePrivateKeyID", private_key: "YourApplePrivateKey", authorize_scopes: "public_profile,email" ProviderType: "Facebook" AttributeMapping: email: "email"
新しい OIDC ID プロバイダの作成
次の例では、参照されたユーザープールに OIDC ID プロバイダ「YourOIDCProviderName」を作成します。
JSON
{ "UserPoolIdentityProvider": { "Type": "AWS::Cognito::UserPoolIdentityProvider", "Properties": { "UserPoolId": { "Ref": "UserPool" }, "ProviderName": "YourOIDCProviderName", "ProviderDetails": { "client_id": "YourOIDCClientId", "client_secret": "YourOIDCClientSecret", "attributes_request_method": "GET", "oidc_issuer": "YourOIDCIssuerURL", "authorize_scopes": "email profile openid" }, "ProviderType": "OIDC", "AttributeMapping": { "email": "email" }, "IdpIdentifiers": [ "IdpIdentifier" ] } } }
YAML
UserPoolIdentityProvider: Type: AWS::Cognito::UserPoolIdentityProvider Properties: UserPoolId: !Ref UserPool ProviderName: "YourOIDCProviderName" ProviderDetails: client_id: "YourOIDCClientId" client_secret: "YourOIDCClientSecret" attributes_request_method: "GET" oidc_issuer: "YourOIDCIssuerURL" authorize_scopes: "email profile openid" ProviderType: "OIDC" AttributeMapping: email: "email" IdpIdentifiers: - "IdpIdentifier"
新しい SAML ID プロバイダの作成
次の例では、参照されたユーザープールに SAML ID プロバイダ「YourProviderName」を作成します。
JSON
{ "UserPoolIdentityProvider": { "Type": "AWS::Cognito::UserPoolIdentityProvider", "Properties": { "UserPoolId": {"Ref": "UserPool"}, "ProviderName": "YourProviderName", "ProviderDetails": { "MetadataURL": "YourMetadataURL" }, "ProviderType": "SAML", "AttributeMapping": { "email": "Attribute" }, "IdpIdentifiers": [ "IdpIdentifier" ] } } }
YAML
UserPoolIdentityProvider: Type: AWS::Cognito::UserPoolIdentityProvider Properties: UserPoolId: !Ref UserPool ProviderName: "YourProviderName" ProviderDetails: MetadataURL: "YourMetadataURL" ProviderType: "SAML" AttributeMapping: email: "Attribute" IdpIdentifiers: - "IdpIdentifier"