CognitoIdentityPool
Reference doc for the `sst.aws.CognitoIdentityPool` component.
The CognitoIdentityPool
component lets you add a Amazon Cognito identity pool to your app.
Create the identity pool
Configure permissions for authenticated users
Constructor
Parameters
-
name
string
-
args?
CognitoIdentityPoolArgs
-
opts?
ComponentResourceOptions
CognitoIdentityPoolArgs
permissions?
Type Input
<
Object
>
-
authenticated?
Input
<
Object
[]
>
-
unauthenticated?
Input
<
Object
[]
>
The permissions to attach to the authenticated and unauthenticated roles. This allows the authenticated and unauthenticated users to access other AWS resources.
permissions.authenticated?
Type Input
<
Object
[]
>
Attaches the given list of permissions to the authenticated users.
permissions.authenticated[].actions
Type string
[]
The IAM actions that can be performed.
permissions.authenticated[].resources
Type Input
<
string
>
[]
The resourcess specified using the IAM ARN format.
permissions.unauthenticated?
Type Input
<
Object
[]
>
Attaches the given list of permissions to the unauthenticated users.
permissions.unauthenticated[].actions
Type string
[]
The IAM actions that can be performed.
permissions.unauthenticated[].resources
Type Input
<
string
>
[]
The resourcess specified using the IAM ARN format.
transform?
Type Object
Transform how this component creates its underlying resources.
transform.authenticatedRole?
Type RoleArgs
|
(
args
:
RoleArgs
,
opts
:
ComponentResourceOptions
,
name
:
string
)
=>
void
Transform the authenticated IAM role resource.
transform.identityPool?
Type IdentityPoolArgs
|
(
args
:
IdentityPoolArgs
,
opts
:
ComponentResourceOptions
,
name
:
string
)
=>
void
Transform the Cognito identity pool resource.
transform.unauthenticatedRole?
Type RoleArgs
|
(
args
:
RoleArgs
,
opts
:
ComponentResourceOptions
,
name
:
string
)
=>
void
Transform the unauthenticated IAM role resource.
userPools?
Type Input
<
Input
<
Object
>
[]
>
Configure Cognito User Pools as identity providers to your identity pool.
userPools[].client
Type Input
<
string
>
The Cognito User Pool client ID.
userPools[].userPool
Type Input
<
string
>
The Cognito user pool ID.
Properties
id
Type Output
<
string
>
The Cognito identity pool ID.
nodes
Type Object
The underlying resources this component creates.
nodes.authenticatedRole
Type Role
The authenticated IAM role.
nodes.identityPool
Type IdentityPool
The Amazon Cognito identity pool.
nodes.unauthenticatedRole
Type Role
The unauthenticated IAM role.
SDK
Use the SDK in your runtime to interact with your infrastructure.
Links
This is accessible through the Resource
object in the SDK.
-
id
string
The Cognito identity pool ID.
Methods
static get
Parameters
The name of the component.name
string
The ID of the existing Identity Pool.identityPoolID
Input
<
string
>
-
opts?
ComponentResourceOptions
Returns CognitoIdentityPool
Reference an existing Identity Pool with the given ID. This is useful when you create a Identity Pool in one stage and want to share it in another. It avoids having to create a new Identity Pool in the other stage.
Imagine you create a Identity Pool in the dev
stage. And in your personal stage frank
,
instead of creating a new pool, you want to share the same pool from dev
.
Here us-east-1:02facf30-e2f3-49ec-9e79-c55187415cf8
is the ID of the Identity Pool created in the dev
stage.
You can find this by outputting the Identity Pool ID in the dev
stage.