@aws-cdk_aws-cognito-identitypool-alpha.IdentityPool

class IdentityPool (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Cognito.IdentityPool.Alpha.IdentityPool
Gogithub.com/aws/aws-cdk-go/awscdkcognitoidentitypoolalpha/v2#IdentityPool
Javasoftware.amazon.awscdk.services.cognito.identitypool.alpha.IdentityPool
Pythonaws_cdk.aws_cognito_identitypool_alpha.IdentityPool
TypeScript (source)@aws-cdk/aws-cognito-identitypool-alpha ยป IdentityPool

Implements IConstruct, IDependable, IResource, IIdentityPool

Define a Cognito Identity Pool.

Example

declare const openIdConnectProvider: iam.OpenIdConnectProvider;
new IdentityPool(this, 'myidentitypool', {
  identityPoolName: 'myidentitypool',
  authenticationProviders: {
    google: {
      clientId: '12345678012.apps.googleusercontent.com',
    },
    openIdConnectProviders: [openIdConnectProvider],
    customProvider: 'my-custom-provider.example.com',
  },
});

Initializer

new IdentityPool(scope: Construct, id: string, props?: IdentityPoolProps)

Parameters

  • scope Construct
  • id string
  • props IdentityPoolProps

Construct Props

NameTypeDescription
allowClassicFlow?๐Ÿ”นbooleanEnables the Basic (Classic) authentication flow.
allowUnauthenticatedIdentities?๐Ÿ”นbooleanWwhether the identity pool supports unauthenticated logins.
authenticatedRole?๐Ÿ”นIRoleThe Default Role to be assumed by Authenticated Users.
authenticationProviders?๐Ÿ”นIdentityPoolAuthenticationProvidersAuthentication providers for using in identity pool.
identityPoolName?๐Ÿ”นstringThe name of the Identity Pool.
roleMappings?๐Ÿ”นIdentityPoolRoleMapping[]Rules for mapping roles to users.
unauthenticatedRole?๐Ÿ”นIRoleThe Default Role to be assumed by Unauthenticated Users.

allowClassicFlow?๐Ÿ”น

Type: boolean (optional, default: Classic Flow not allowed)

Enables the Basic (Classic) authentication flow.


allowUnauthenticatedIdentities?๐Ÿ”น

Type: boolean (optional, default: false)

Wwhether the identity pool supports unauthenticated logins.


authenticatedRole?๐Ÿ”น

Type: IRole (optional, default: A Default Authenticated Role will be added)

The Default Role to be assumed by Authenticated Users.


authenticationProviders?๐Ÿ”น

Type: IdentityPoolAuthenticationProviders (optional, default: No Authentication Providers passed directly to Identity Pool)

Authentication providers for using in identity pool.


identityPoolName?๐Ÿ”น

Type: string (optional, default: automatically generated name by CloudFormation at deploy time)

The name of the Identity Pool.


roleMappings?๐Ÿ”น

Type: IdentityPoolRoleMapping[] (optional, default: no Role Mappings)

Rules for mapping roles to users.


unauthenticatedRole?๐Ÿ”น

Type: IRole (optional, default: A Default Unauthenticated Role will be added)

The Default Role to be assumed by Unauthenticated Users.

Properties

NameTypeDescription
authenticatedRole๐Ÿ”นIRoleDefault role for authenticated users.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
identityPoolArn๐Ÿ”นstringThe ARN of the Identity Pool.
identityPoolId๐Ÿ”นstringThe id of the Identity Pool in the format REGION:GUID.
identityPoolName๐Ÿ”นstringThe name of the Identity Pool.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.
unauthenticatedRole๐Ÿ”นIRoleDefault role for unauthenticated users.

authenticatedRole๐Ÿ”น

Type: IRole

Default role for authenticated users.


env๐Ÿ”น

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


identityPoolArn๐Ÿ”น

Type: string

The ARN of the Identity Pool.


identityPoolId๐Ÿ”น

Type: string

The id of the Identity Pool in the format REGION:GUID.


identityPoolName๐Ÿ”น

Type: string

The name of the Identity Pool.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.


unauthenticatedRole๐Ÿ”น

Type: IRole

Default role for unauthenticated users.

Methods

NameDescription
addRoleMappings(...roleMappings)๐Ÿ”นAdds Role Mappings to Identity Pool.
addUserPoolAuthentication(userPool)๐Ÿ”นAdd a User Pool to the IdentityPool and configure User Pool Client to handle identities.
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromIdentityPoolArn(scope, id, identityPoolArn)๐Ÿ”นImport an existing Identity Pool from its Arn.
static fromIdentityPoolId(scope, id, identityPoolId)๐Ÿ”นImport an existing Identity Pool from its id.

addRoleMappings(...roleMappings)๐Ÿ”น

public addRoleMappings(...roleMappings: IdentityPoolRoleMapping[]): void

Parameters

  • roleMappings IdentityPoolRoleMapping

Adds Role Mappings to Identity Pool.


addUserPoolAuthentication(userPool)๐Ÿ”น

public addUserPoolAuthentication(userPool: IUserPoolAuthenticationProvider): void

Parameters

  • userPool IUserPoolAuthenticationProvider

Add a User Pool to the IdentityPool and configure User Pool Client to handle identities.


applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromIdentityPoolArn(scope, id, identityPoolArn)๐Ÿ”น

public static fromIdentityPoolArn(scope: Construct, id: string, identityPoolArn: string): IIdentityPool

Parameters

  • scope Construct
  • id string
  • identityPoolArn string

Returns

  • IIdentityPool

Import an existing Identity Pool from its Arn.


static fromIdentityPoolId(scope, id, identityPoolId)๐Ÿ”น

public static fromIdentityPoolId(scope: Construct, id: string, identityPoolId: string): IIdentityPool

Parameters

  • scope Construct
  • id string
  • identityPoolId string

Returns

  • IIdentityPool

Import an existing Identity Pool from its id.