Closed sachitsac closed 1 year ago
@sachitsac If you want to only customize qualifier, and only use single qualifier per Stage(or App if you don't have stages).
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
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
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