amazon lambda permissions for browser -


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.

  1. the api gateway method needs have auth set aws_iam.
  2. make sure have appropriate role selected in configuration settings lambda function.
  3. the role needs have trust relationship associated user.
  4. make sure iam keys user (which should have appropriate lambda privileges) in appropriate place on machine.

alternates:

  1. you try using cognito in trust relationship prevent hard-coding keys in machine.
  2. 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.