Open larrettgee opened 6 months ago
Hello, in the latest version of the code, we upgraded NodeJs versions. So the question is how to upgrade to the latest code version, with minimal impact on production?
I can think of the following approaches, but I haven't tested any of them yet to give you an authoritative recommendation:
I can add some info about your second point. I tried to to change the stack name, and then ran cdk deploy..
CDK detected it needed a new deploy, but the deploy failed with:
Invalid request provided: AWS::CloudFront::ResponseHeadersPolicy: Another response headers policy with the same name already exists within the aws account.
It seems to be because the policy name needs to be unique, and it is always set to responseHeadersPolicyName: 'ImageResponsePolicy',
@JanC89 did a quick fix to make it work https://github.com/aws-samples/image-optimization/commit/6b4d7dd1872e0ae682e8e1de1634b1c270b5e2b5
@achrafsouk thanks for the input! I believe I'll take your second recommended approach. I am not well versed in AWS, so don't want to accidentally burn myself. Do you mind if I ask a few questions?
Thank you so much, I really appreciate it!
Thanks so much! In the original guide, I used the option cdk deploy -c S3_IMAGE_BUCKET_NAME=’YOUR_S3_BUCKET_NAME’
Is it a valid option to have the new deploy link to the same bucket & skip the step on moving images?
the new deploy has to point to the same bucket holding the original images. Its the bucket from which the Lambda will fetch images for processing. The bucket I was talking about was the bucket created by the solution that holds the generated images. Copying images from this bucket is optional, but highly recommended to avoid having your Lambda to generate all image variants again.
Got it, thanks. When I ran the cdk deploy
command, I received the same ImgTransformationStack.ImageDeliveryDomain
that I previously had. When I look at my distributions I only see 1. I also am not able to query the ListConflictingAliases
endpoint after trying several method.
EDIT: I redeployed and fixed the lambda function error, but still have the same alias. Maybe I can just leave it as is?
Ah! because you have probably used the same application name in the cdk project. It means that you have in reality followed the first option for migration, which is upgrading the existing stack, and i am glad it worked without any challenges.
I modified several things, changed the code to add the quality option and also put two distributions together in the same cloudfront, with an alias, one for transforming images and the other for CDN.
These changes... will they reset?
Reset following what?
I recently recieved an email titled "AWS Lambda end of support for Node.js 16" mentioning that I have two impacted functions from my step-by-step deployment of this repository. Specifically they are
ImgTransformationStack-imageoptimization
andImgTransformationStack-LogRetention
when I look at them on the Health Dashboard.Do you have a recommended plan of action for upgrading these to ensure support is maintained and the code continues to function as expected? Thanks!