Skip to content

aws-cdk/aws-cognito-identitypool-alpha: IdentityPool.fromIdentityPool* static methods do not support Fn.importValue #28184

@uyrussell21

Description

@uyrussell21

Describe the bug

Using Fn.importValue method from aws-cdk-lib as input for IdentityPool.fromIdentityPoolArn or IdentityPool.fromIdentityPoolId will error out:

Error: Invalid Identity Pool Id: Identity Pool Ids must follow the format <region>:<id>

Expected Behavior

I expected for Fn.importValue to be a supported argument for fromIdentityPoolArn or fromIdentityPoolId static methods

Current Behavior

Using Fn.importValue('outputName') as ARN or Id arg throws out:

Error: Invalid Identity Pool Id: Identity Pool Ids must follow the format <region>:<id>

Reproduction Steps

// StackWithIdPool
import * as cognito_identitypool_alpha from "@aws-cdk/aws-cognito-identitypool-alpha";

const existingIdentityPool = new cognito_identitypool_alpha.IdentityPool(
  this,
  "IdentityPool",
  {
    identityPoolName: "some-id-pool",
    allowUnauthenticatedIdentities: true,
  }
);

new cdk.CfnOutput(this, "ExistingIdentityPoolArn", {
  value: existingIdentityPool.identityPoolArn,
  exportName: "existingIdentityPoolArn",
});
// AnotherStack

cognito_identitypool_alpha.IdentityPool.fromIdentityPoolArn(
  scope,
  'ExistingIdentityPool',
  Fn.importValue('existingIdentityPoolArn'),
);

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.110.1-1

Framework Version

No response

Node.js Version

18.13.0

OS

Windows 10

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions