AWS_IAM API Gateway Auth in Next.js getStaticProps() withSSRContext() #6960
Labels
API
Related to REST API issues
feature-request
Request a new feature
SSR
Issues related to Server Side Rendering
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?
The text was updated successfully, but these errors were encountered: