AWS Lambda can be easily integrated with Secrets Manager to access sensitive information such as database passwords, API tokens, and other secrets. In this video, we will create AWS Lambda, which will be triggered by the API Gateway. We will create a slack bot api token and store it in the Secrets Manager. Using aws-sdk, we will access that secret and return it to the client. I will show you two ways of granting access to AWS Lambda. First, we will add an additional statement to the IAM Policy that belongs to the role that Lambda uses. The second approach will use a Resource-based policy that can be attached directly to the secret. You can use a secret policy to grant cross-account permissions as an alternative to using identity-based policies with IAM roles.


⏱️TIMESTAMPS⏱️
0:00 Intro
0:39 Create Secret in AWS Secrets Manager
1:18 Create IAM User with Full Access
1:53 Create IAM Role for AWS Lambda
3:11 Create AWS Lambda Function
5:20 Deploy Lambda Using Container Image
6:33 Grant Access for IAM Role
7:58 Create Resource-based Policy for Secret

=========
Source Code
🖥️ - GitHub: https://github.com/antonputra/tutorials/tree/main/lessons/077

#aws   #amazonwebservices 

AWS Lambda Secrets Manager Example: 2 Ways to Grant Access
2.00 GEEK