(aws_cognito): (The static method cognito.UserPool.from_user_pool_arn does not work inside a Custom Construct) #26299
Labels
@aws-cdk/aws-cognito
Related to Amazon Cognito
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
If you create a user pool as of cognito user pool arn from a ConstructsStack(Stack) everything works fine
But if you execute the previous instrucción inside a Custom Construct send the following error message:
@jsii/kernel.RuntimeError: @jsii/kernel.SerializationError: Passed to parameter scope of static method aws-cdk-lib.aws_cognito.UserPool.fromUserPoolArn: Unable to deserialize value as constructs.Construct
├── 🛑 Failing value is an object
│ {
│ id: 'LHUserPool',
│ existing_user_pool_arn: 'arn:aws:cognito-idp:us-west-2::userpool/****'
│ }
╰── 🔍 Failure reason(s):
╰─ Value does not have the "$jsii.byref" key
Expected Behavior
It shouldn't send any error
Current Behavior
Throws errors if trying to create a UserPool from an arn from a Custom Constructor
Reproduction Steps
2.- Invoke this Construct from a Stack
3.- The following error appears:
jsii.errors.JavaScriptError:
@jsii/kernel.RuntimeError: @jsii/kernel.SerializationError: Passed to parameter scope of static method aws-cdk-lib.aws_cognito.UserPool.fromUserPoolArn: Unable to deserialize value as constructs.Construct
├── 🛑 Failing value is an object
│ {
│ id: 'UserPoolBuilder',
│ existing_user_pool_arn: 'arn:aws:cognito-idp:us-west-2:*:userpool/'
│ }
╰── 🔍 Failure reason(s):
╰─ Value does not have the "$jsii.byref" key
at Kernel._ensureSync (/tmp/tmp21ftd_ny/lib/program.js:10369:27)
at Kernel.sinvoke (/tmp/tmp21ftd_ny/lib/program.js:9790:34)
at KernelHost.processRequest (/tmp/tmp21ftd_ny/lib/program.js:11544:36)
at KernelHost.run (/tmp/tmp21ftd_ny/lib/program.js:11504:22)
at Immediate._onImmediate (/tmp/tmp21ftd_ny/lib/program.js:11505:46)
at process.processImmediate (node:internal/timers:476:21)
The above exception was the direct cause of the following exception:
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.86.0 (build 1130fab)
Framework Version
No response
Node.js Version
Node.js v18.16.0
OS
Linux
Language
Python
Language Version
Python 3.9.16
Other information
No response
The text was updated successfully, but these errors were encountered: