Skip to content

Resource: awsCognitoIdentityProvider

Provides a Cognito User Identity Provider resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsCognitoUserPoolExample = new aws.cognitoUserPool.CognitoUserPool(
  this,
  "example",
  {
    autoVerifiedAttributes: ["email"],
    name: "example-pool",
  }
);
new aws.cognitoIdentityProvider.CognitoIdentityProvider(
  this,
  "example_provider",
  {
    attributeMapping: {
      email: "email",
      username: "sub",
    },
    providerDetails: {
      authorize_scopes: "email",
      client_id: "your client_id",
      client_secret: "your client_secret",
    },
    providerName: "Google",
    providerType: "Google",
    userPoolId: awsCognitoUserPoolExample.id,
  }
);

Argument Reference

The following arguments are supported:

  • userPoolId (Required) - The user pool id
  • providerName (Required) - The provider name
  • providerType (Required) - The provider type. See AWS API for valid values
  • attributeMapping (Optional) - The map of attribute mapping of user pool attributes. AttributeMapping in AWS API documentation
  • idpIdentifiers (Optional) - The list of identity providers.
  • providerDetails (Optional) - The map of identity details, such as access token

Attributes Reference

No additional attributes are exported.

Import

awsCognitoIdentityProvider resources can be imported using their User Pool ID and Provider Name, e.g.,

$ terraform import aws_cognito_identity_provider.example us-west-2_abc123:CorpAD