-
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
EdgeFunction: Does not respect custom qualifier #27361
Comments
@sachitsac You could set context variable, @aws-cdk/core:bootstrapQualifier, on Stage/App containing the stack with EdgeLambda or in cdk.json(if it is for entire app). Which is where synthesizer looks for value(if not provided), before falling back to default value. (I am not from cdk team) |
Thanks @rv2673 I think you are right I'm passing it at the stack level. I'll try passing it at the app level. Might even resolve an issue I was having with the certificate construct where it wasn't respecting permission boundary. Thanks |
|
Closed as this is resolved by @rv2673 comment. No action needed. |
@sachitsac I do think your suggestion for lambda stack to inherit the synthesizer from the containing stack still has merit, though maybe less prio. The context setting only works for qualifier customization, not for other customizations to the synthesizer. |
Describe the bug
I am trying to use the experimental EdgeFunction construct. But it fails due to usage of a custom qualifier. Here's some information:
So in my custom construct ( L3 pattern ) that deploys the react app to S3, i am trying to add an edge function like this:
Default Synthesiser with qualifier
Edge auth function
Distribution config
Expected Behavior
Upon synthesis, the edge function stack should respect the custom qualifier name provided to the stack. Given that i am initialising the edge function from within my cloudfront stack, ( kinda like nested stack ), i should be able to use to inherit the custom qualifier.
Current Behavior
Its not respecting the custom qualifier provided upon stack initialisation.
Reproduction Steps
There will be an error trying to create the edge lambda function in the us-east-1 as its not using the custom qualifier passed to the parent Main stack.
Possible Solution
Two things i can think of:
I believe for the sake of simplicity, the first option should be the default as in most circumstances but the third offers most flexibility as we could possibly bootstrap different regions with different qualifiers.
Additional Information/Context
No response
CDK CLI Version
2.95.1
Framework Version
2.95.1
Node.js Version
18
OS
macos 14.0
Language
Typescript
Language Version
5
Other information
No response
The text was updated successfully, but these errors were encountered: