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

class IdentityPoolRoleAttachment (construct) ๐Ÿ”น

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

Implements IConstruct, IDependable, IResource, IIdentityPoolRoleAttachment

Defines an Identity Pool Role Attachment.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cognito_identitypool_alpha from '@aws-cdk/aws-cognito-identitypool-alpha';
import { aws_iam as iam } from 'aws-cdk-lib';

declare const identityPool: cognito_identitypool_alpha.IdentityPool;
declare const identityPoolProviderUrl: cognito_identitypool_alpha.IdentityPoolProviderUrl;
declare const role: iam.Role;
const identityPoolRoleAttachment = new cognito_identitypool_alpha.IdentityPoolRoleAttachment(this, 'MyIdentityPoolRoleAttachment', {
  identityPool: identityPool,

  // the properties below are optional
  authenticatedRole: role,
  roleMappings: [{
    providerUrl: identityPoolProviderUrl,

    // the properties below are optional
    mappingKey: 'mappingKey',
    resolveAmbiguousRoles: false,
    rules: [{
      claim: 'claim',
      claimValue: 'claimValue',
      mappedRole: role,

      // the properties below are optional
      matchType: cognito_identitypool_alpha.RoleMappingMatchType.EQUALS,
    }],
    useToken: false,
  }],
  unauthenticatedRole: role,
});

Initializer

new IdentityPoolRoleAttachment(scope: Construct, id: string, props: IdentityPoolRoleAttachmentProps)

Parameters

  • scope Construct
  • id string
  • props IdentityPoolRoleAttachmentProps

Construct Props

NameTypeDescription
identityPool๐Ÿ”นIIdentityPoolId of the Attachments Underlying Identity Pool.
authenticatedRole?๐Ÿ”นIRoleDefault Authenticated (User) Role.
roleMappings?๐Ÿ”นIdentityPoolRoleMapping[]Rules for mapping roles to users.
unauthenticatedRole?๐Ÿ”นIRoleDefault Unauthenticated (Guest) Role.

identityPool๐Ÿ”น

Type: IIdentityPool

Id of the Attachments Underlying Identity Pool.


authenticatedRole?๐Ÿ”น

Type: IRole (optional, default: No default authenticated role will be added)

Default Authenticated (User) Role.


roleMappings?๐Ÿ”น

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

Rules for mapping roles to users.


unauthenticatedRole?๐Ÿ”น

Type: IRole (optional, default: No default unauthenticated role will be added)

Default Unauthenticated (Guest) Role.

Properties

NameTypeDescription
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
identityPoolId๐Ÿ”นstringId of the underlying identity pool.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.

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.


identityPoolId๐Ÿ”น

Type: string

Id of the underlying identity pool.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
toString()๐Ÿ”นReturns a string representation of this construct.

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.