Skip to content

Resource: awsCognitoIdentityPoolProviderPrincipalTag

Provides an AWS Cognito Identity Principal Mapping.

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: "user pool",
  }
);
const awsCognitoUserPoolClientExample =
  new aws.cognitoUserPoolClient.CognitoUserPoolClient(this, "example_1", {
    name: "client",
    supportedIdentityProviders: '${compact([\n    "COGNITO",\n  ])}',
    userPoolId: awsCognitoUserPoolExample.id,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCognitoUserPoolClientExample.overrideLogicalId("example");
const awsCognitoIdentityPoolExample =
  new aws.cognitoIdentityPool.CognitoIdentityPool(this, "example_2", {
    allowUnauthenticatedIdentities: false,
    cognitoIdentityProviders: [
      {
        clientId: awsCognitoUserPoolClientExample.id,
        providerName: awsCognitoUserPoolExample.endpoint,
        serverSideTokenCheck: false,
      },
    ],
    identityPoolName: "identity pool",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCognitoIdentityPoolExample.overrideLogicalId("example");
const awsCognitoIdentityPoolProviderPrincipalTagExample =
  new aws.cognitoIdentityPoolProviderPrincipalTag.CognitoIdentityPoolProviderPrincipalTag(
    this,
    "example_3",
    {
      identityPoolId: awsCognitoIdentityPoolExample.id,
      identityProviderName: awsCognitoUserPoolExample.endpoint,
      principalTags: {
        test: "value",
      },
      useDefaults: false,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCognitoIdentityPoolProviderPrincipalTagExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • identityPoolId (Required) - An identity pool ID.
  • identityProviderName (Required) - The name of the identity provider.
  • principalTags: (Optional: []) - String to string map of variables.
  • useDefaults: (Optional: true) use default (username and clientID) attribute mappings.

Attributes Reference

No additional attributes are exported.

Import

Cognito Identity Pool Roles Attachment can be imported using the Identity Pool ID and provider name, e.g.,

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