sst / ion

❍ — a new engine for SST
https://ion.sst.dev
MIT License
1.09k stars 126 forks source link

Using `transform` on a StaticSite causes `AccessDenied` errors #442

Open brandonbaraban opened 1 month ago

brandonbaraban commented 1 month ago

I added the following to the configuration of my StaticSite so that old files would be deleted when new builds are uploaded (by default, old files that were not included in new builds were still there, allowing users to navigate directly to pages we intended to remove).

export const web = new sst.aws.StaticSite("YourSite", {
  path: "packages/web-directory",
  transform: {
    assets: {
      transform: {
        bucket: {
          forceDestroy: true
        }
      }
    }
  });

After adding this transform, navigating to the website just returns AccessDenied, which I'm assuming is because other options are being overridden, maybe with bucket permissions or cors? I don't think this is the expected behavior. Removing the transform fixes the issue.

Any help here is greatly appreciated!

EDIT: It turns out this is not how you solve the problem with deleting old files when new builds are uploaded, since new deployments don't delete the bucket, but this seems to be an issue for people nonetheless

hamedmam commented 1 month ago

transform seems to have stopped working globally, I am facing similar an issue where DynamoDB table name can't be updated using transform