Provides a Cognito User Identity Provider resource.
resource "aws_cognito_user_pool" "example" {
name = "example-pool"
auto_verified_attributes = ["email"]
}
resource "aws_cognito_identity_provider" "example_provider" {
user_pool_id = aws_cognito_user_pool.example.id
provider_name = "Google"
provider_type = "Google"
provider_details = {
authorize_scopes = "email"
client_id = "your client_id"
client_secret = "your client_secret"
}
attribute_mapping = {
email = "email"
username = "sub"
}
}
This resource supports the following arguments:
user_pool_id
(Required) - The user pool idprovider_name
(Required) - The provider nameprovider_type
(Required) - The provider type. See AWS API for valid valuesattribute_mapping
(Optional) - The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentationidp_identifiers
(Optional) - The list of identity providers.provider_details
(Optional) - The map of identity details, such as access tokenThis resource exports no additional attributes.
In Terraform v1.5.0 and later, use an import
block to import aws_cognito_identity_provider
resources using their User Pool ID and Provider Name. For example:
import {
to = aws_cognito_identity_provider.example
id = "us-west-2_abc123:CorpAD"
}
Using terraform import
, import aws_cognito_identity_provider
resources using their User Pool ID and Provider Name. For example:
% terraform import aws_cognito_identity_provider.example us-west-2_abc123:CorpAD