class IdentityPool (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Cognito.IdentityPool.IdentityPool |
Java | software.amazon.awscdk.services.cognito.identitypool.IdentityPool |
Python | aws_cdk.aws_cognito_identitypool.IdentityPool |
TypeScript (source) | @aws-cdk/aws-cognito-identitypool ยป IdentityPool |
Implements
IConstruct
, IConstruct
, IDependable
, IResource
, IIdentity
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
Identity
Pool Props
Construct Props
Name | Type | Description |
---|---|---|
allow | boolean | Enables the Basic (Classic) authentication flow. |
allow | boolean | Wwhether the identity pool supports unauthenticated logins. |
authenticated | IRole | The Default Role to be assumed by Authenticated Users. |
authentication | Identity | Authentication providers for using in identity pool. |
identity | string | The name of the Identity Pool. |
role | Identity [] | Rules for mapping roles to users. |
unauthenticated | IRole | The 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:
Identity
(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:
Identity
[]
(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
Name | Type | Description |
---|---|---|
authenticated | IRole | Default role for authenticated users. |
env | Resource | The environment this resource belongs to. |
identity | string | The ARN of the Identity Pool. |
identity | string | The id of the Identity Pool in the format REGION:GUID. |
identity | string | The name of the Identity Pool. |
node | Construct | The construct tree node associated with this construct. |
stack | Stack | The stack in which this resource is defined. |
unauthenticated | IRole | Default role for unauthenticated users. |
authenticatedRole
Type:
IRole
Default role for authenticated users.
env
Type:
Resource
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:
Construct
The construct tree node associated with this construct.
stack
Type:
Stack
The stack in which this resource is defined.
unauthenticatedRole
Type:
IRole
Default role for unauthenticated users.
Methods
Name | Description |
---|---|
add | Adds Role Mappings to Identity Pool. |
add | Add a User Pool to the IdentityPool and configure User Pool Client to handle identities. |
apply | Apply the given removal policy to this resource. |
to | Returns a string representation of this construct. |
static from | Import an existing Identity Pool from its Arn. |
static from | Import an existing Identity Pool from its id. |
RoleMappings(...roleMappings)
addpublic addRoleMappings(...roleMappings: IdentityPoolRoleMapping[]): void
Parameters
- roleMappings
Identity
Pool Role Mapping
Adds Role Mappings to Identity Pool.
UserPoolAuthentication(userPool)
addpublic addUserPoolAuthentication(userPool: IUserPoolAuthenticationProvider): void
Parameters
- userPool
IUser
Pool Authentication Provider
Add a User Pool to the IdentityPool and configure User Pool Client to handle identities.
RemovalPolicy(policy)
applypublic applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
Removal
Policy
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
).
String()
topublic toString(): string
Returns
string
Returns a string representation of this construct.
IdentityPoolArn(scope, id, identityPoolArn)
static frompublic static fromIdentityPoolArn(scope: Construct, id: string, identityPoolArn: string): IIdentityPool
Parameters
- scope
Construct
- id
string
- identityPoolArn
string
Returns
Import an existing Identity Pool from its Arn.
IdentityPoolId(scope, id, identityPoolId)
static frompublic static fromIdentityPoolId(scope: Construct, id: string, identityPoolId: string): IIdentityPool
Parameters
- scope
Construct
- id
string
- identityPoolId
string
Returns
Import an existing Identity Pool from its id.