- An Identity Pool with "Allow unauthenticated identities"
- An Unauthenticated role, to be assumed by unauthenticated identities.
- A
LambdaRestAPI
with a singleANY
method on root authorized by IAM. - A Policy that allows Unauthenticated to execute that single endpoint.
- CDK:
- Client
- AWS SDK for JavaScript v3:
GetIdCommand
GetCredentialsForIdentityCommand
- Axios and aws4
- AWS SDK for JavaScript v3:
npm install
cdk bootstrap
npm run deploy
npm run client
npm run deploy
instead ofcdk deploy
to run the"postdeploy"
script. This will read the outputs and write them into the .env file.- The client is a demo on how to retrieve the identity and credentials to call the API.