-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Gateway: CDK fails to attach a cognito user pool authorizer to the construct #29535
Comments
Hi I won't be able to reproduce this from the provided reproduction steps. Are you able to provide more details about your code with least required properties so I can reproduce this in my environment? |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Some simple replication code:
This should give the same error as above. It seems like this is running into a similar issue as #7377 because adding |
Closing in favor of #7377 Feel free to reopen if there's any concern. |
|
@pahud - I've run into the same issue where I've added a RestApi and a CognitoUserPoolsAuthorizer in the same stack, but haven't used the authorizer yet, and don't intend to in this stack. I get the Authorizer must be attached to a RestApi error and adding It would be nice to have the option of including restApiId as a prop when creating the authorizer, ie:
|
Describe the bug
After defining a Cognito HalAuthorizer in openapi yaml (security Schema and endpoint) and attempting to correlate that with a CognitoUserPoolAuthorizer created in an API Gateway construct, the follow error results:
Expected Behavior
The Authorizer should be attached to the REST API and the CDK deployment should succeed.
Current Behavior
CDK fails to attach the Cognito Authorizer and the Rest API creation is inconsistent.
Reproduction Steps
See #7377, which is related to the same issue but mention a case where separate stacks are used.
Possible Solution
The bug seems to be in CognitoUserPoolsAuthorizer object and related to the following lines:
Additional Information/Context
No response
CDK CLI Version
2.130.0 (build bd6e5ee)
Framework Version
Python 3.11.2
Node.js Version
N/A
OS
MacOS
Language
Python 3.11.2
Language Version
Python 3.11.2
Other information
No response
The text was updated successfully, but these errors were encountered: