[Help w SST StaticSite] We have a lambda@Edge rout...
# help
[Help w SST StaticSite] We have a lambda@Edge router that processes an
file in the root of the StaticSite Bucket. The issue right now is that StaticSite puts the file deploys into bucket keys/directories like
so how can we let the edge function know which is the current? (without having to rebuild our lambda functions)
The CF distribution is pointed to a specific folder, I wonder if you can get that value
All the edge function has access to is the incoming CF request
I’m curious what it looks like with these base folders…. like would it be
It would be /contact from cloud formation's perspective
so if you fetch redirects through the cloudfront url you shouldn't have to know about the underlying s3 structure
hmmm….. right…. and my edge function is going to get the file itself via s3 SDK
Can I pass in the folder name as a custom header key/value ?
cause you guys have to rebuild the CDN anyway each StaticSite code update/deploy ?
@thdxr? This kinda goes hand in hand with another small beef we have. we’re not huge fans of the current StaticSite workflow where ANY frontend code only change results in a 6+min CFN update as it needs to update the CF Distro each time. Is there, can we, have an option to disable atomic deploys? Instead in favor of just doing an
aws s3 sync --delete
on the root bucket?
This is probably more of @Frank area since he's spent more time with StaticSite
🙏 @Frank 😛 I think we’re going to try and get our stuff to work by optionally passing the folder in as a CF custom header…. then if you guys make automic deploy optionallly…. we’ll put the two together so that automic only happens in prod….. keeping our dev/feat deploys snappy quick
yeah good point, there's less need for atomic deploys on dev branches
Question: How can we get the dynamic folder name from the StaticSite object in order to pass it into a CF custom header
isn't it going to be slow to download the redirect file from s3 on every request?
double cached
we’ve been using this for a few years now
@thdxr is there a way for us to point our fork of SST until you guys officially add this feature? Last time I tried this it wasn’t working cause I think SST src needs to be built and published?
currently trying to hack at the
to see if we can read this value off the nodes… but having no luck as its somehow behind a