AWS-TS-NEXTJS - Fix broken image handling, region handling + resource upgrade#1499
Open
slikk66 wants to merge 1 commit intopulumi:masterfrom
Open
AWS-TS-NEXTJS - Fix broken image handling, region handling + resource upgrade#1499slikk66 wants to merge 1 commit intopulumi:masterfrom
slikk66 wants to merge 1 commit intopulumi:masterfrom
Conversation
|
PR is now waiting for a maintainer to run the acceptance tests. |
Contributor
|
/run-example-tests |
|
Please view the results of the PR Build Here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I used
aws-ts-nextjsto try and implement studio.tailwind.com example site and found image handling was broken. Found out that it was passing in bucket ARN rather than bucket name and that was causing lambda to fail with:Turns out that even though it is an ARN, it is not how most ARN work where the region is part of the values of the ARN, where this code realizes it is an ARN, but considers it invalid due to the missing region, here's that part of the code:
which luckily I found here: https://gist.githubusercontent.com/jymboche/2a435eb594a59a769fbbe55848513f60/raw/746bda06f45775af204c9f5e9ae15b18ef591fd4/index.js
Checking the code it seems obvious it wants the NAME not ARN as seen in diff below where it was passing ARN into
BUCKET_NAMEenv var for the function.Next fix is that the code for some reason was using hard coded regions when you could have deployed to another region, and then it would break. So I updated that to pull in from the default provider region and pass to the 2 env vars that the external library apparently needs as input.
Final fix is to update from
BucketObjecttoBucketObjectv2to avoid deprecation warning, and we're already usingBucketv2above.