class IdentityPool (construct)
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Cognito.IdentityPool.Alpha.IdentityPool |
Go | github.com/aws/aws-cdk-go/awscdkcognitoidentitypoolalpha/v2#IdentityPool |
Java | software.amazon.awscdk.services.cognito.identitypool.alpha.IdentityPool |
Python | aws_cdk.aws_cognito_identitypool_alpha.IdentityPool |
TypeScript (source) | @aws-cdk/aws-cognito-identitypool-alpha ยป IdentityPool |
Implements
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 | Whether 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)
Whether 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 | Node | The tree node. |
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:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
unauthenticatedRole
Type:
IRole
Default Role for unauthenticated users.
Methods
Name | Description |
---|---|
add | Add Role Mappings to the Identity Pool. |
add | Add a User Pool to the Identity Pool and configure the 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
Add Role Mappings to the Identity Pool.
UserPoolAuthentication(userPool)
addpublic addUserPoolAuthentication(userPool: IUserPoolAuthenticationProvider): void
Parameters
- userPool
IUser
Pool Authentication Provider
Add a User Pool to the Identity Pool and configure the 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.