Open ChapterSevenSeeds opened 9 months ago
Hey @ChapterSevenSeeds, thank you for reaching. This is currently not supported on Amplify CLI and a feature request is currently open here: https://github.com/aws-amplify/amplify-cli/issues/4939 While the file watcher solution suggested could be a viable solution but it can be inconsistent and unreliable in behaviour. marking this as feature request.
Amplify CLI Version
12.10.0
Question
I am trying to use CloudFormation to automate the deployment of Lambda@Edge with a CloudFront distribution. I have a Lambda function which I created with
amplify add function
. I also added S3 and CloudFront hosting withamplify add hosting
. I added versioning to my function template, and I am outputting the qualified ARN:However, in order for the CloudFront template to be able to use this output, I need to change the stack deployment order so that the Lambda function gets deployed before the CloudFront distribution. And, in order to do this, I figured the easiest way would be to use this new
QualifiedARN
output as a parameter in the hosting template. But, in order to add this parameter, I need to modify the root stack template after it is built but before it is uploaded to CloudFormation. I explored adding a project-wide override, but I don't think that will let me do what I need it to. I did also try using a file system watcher to wait for the root template build output to be overwritten, at which point a script would go and add the new parameter, but that didn't seem to work either.In essence, inside the root stack template, I need my hosting resource to look like this:
Is this something that can be done?