i've made few lambda functions return html - , exposed them through gateway function sets content-type text/html - can browse them. works great.
however - want them work me using current ambient amazon session. if expose them public - work, work everyone. if turn on iam , browse there, want authentication token.
is there way achieve want?
a few things need happen.
- the api gateway method needs have auth set aws_iam.
- make sure have appropriate role selected in configuration settings lambda function.
- the role needs have trust relationship associated user.
- make sure iam keys user (which should have appropriate lambda privileges) in appropriate place on machine.
alternates:
- you try using cognito in trust relationship prevent hard-coding keys in machine.
- also if yourself, keeping auth set none in api gateway , generating api key work. please not use if going deploy application anywhere. decompile code , key. should purely quick prototyping.