Open deldrid1 opened 4 years ago
@deldrid1, apologies on how long it's taken for you to get a response on this issue. There's been updates to the documentation surrounding Next.js and SSR recently... AND we've just released support today for Next.js v12+ via a new Amplify Hosting compute managed SSR provider. Can you verify if you're still experiencing this issue?
Here's links to the updated guides: Amplify support for Next.js SSR Next.js Tutorial - API with SSR
I just ran into this issue today.
Is your feature request related to a problem? Please describe.
I have an API Gateway setup to use AWS_IAM and require an AWS Signature Version 4 to provide data. I have deployed this using the serverless framework and have lambda's tied into Dynamo DB (using the server side AWS SDK for Javascript) and have tested everything working end to end using a REST Client
I am trying to figure out how to do access this API inside of next.js's
getStaticProps
using the newwithSSRContext()
function as described hereDescribe the solution you'd like
This may be a documentation gap or a personal knowledge gap, but so far I've struck out. I'm new to the AWS ecosystem so if I am just missing something obvious please point it out.
I don't see an API Gateway equivalent of
AWS.DynamoDB.DocumentClient().get()
in theAWS SDK for Node
or inAmplify
that uses environment variablesAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
to create the needed tokens for trusted server authorization.On the client side and on the server side in
getServerSideProps
, my understanding is that AWS AmplifyAuth
classAPI
class uses the IAM credentials to sign our API request with Signature Version 4.Unfortunately, I can't figure out how to provide credentials to the
API
class when there isn't a cognito user in play such as ingetStaticProps
...Describe alternatives you've considered
Any thoughts on how to get this all plumbed up?