How to access DB credentials from AWS Secrets Manager using Python | Python App with Secrets Manager

preview_player
Показать описание
This video demonstrates
1. Create AWS Secrets Manager
2. Store RDS credentials in AWS Secrets Manager
3. Write Python code to access database details from secrets manager and connect to mysql database.
=========================================================

Password: Agilent123#
===============================================================================================
yum -y install python-pip

pip install mysql-connector

==============================================================================================
create table employees(
id INT NOT NULL,
name VARCHAR(100) NOT NULL
);

================================================================================================

user="admin",
passwd="admin123",
database="test"
)

sql = "INSERT INTO employees (id, name) VALUES (%s, %s)"
val = (1, "Dhruv")

==================================================================================================
pip install boto3
==================================================================================================
Note: Manally inserted one more key in "secret Manager" via aws console
key(database) == value
==================================================================================================

import boto3
import json

SecretId= 'test/sample'
)

host=secretDict['host'],
user=secretDict['username'],
passwd=secretDict['password'],
database=secretDict['database']
)

sql = "INSERT INTO employees (id, name) VALUES (%s, %s)"
val = (2, "Hari")

============================================================

@technologycrunch
#aws
#awstraining
#awstrainingvideos
#secretsmanager
#rds
Рекомендации по теме
visit shbcf.ru