Skip to content

How to setup a MySQL DB in AWS with access via Lambda Function.

Notifications You must be signed in to change notification settings

MrSteve2/AWS_Lambda_MySQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS_Lambda_MySQL

How to setup a MySQL DB in AWS with access via Lambda Function.

  1. First use the following to create a AWS RDS MySQL DB
aws rds create-db-instance \
    --db-instance-identifier MySQLForLambdaTest \
    --db-instance-class db.t2.micro \
    --engine MySQL \
    --allocated-storage 5 \
    --no-publicly-accessible \
    --db-name ExampleDB \
    --master-username username \
    --master-user-password password \
    --backup-retention-period 3 
aws lambda create-function \
--region us-east-1 \
--function-name   CreateTableAddRecordsAndRead  \
--zip-file fileb://./app.zip \
--role arn:aws:iam::382526372780:role/lambda-vpc-execution-role \
--handler app.handler \
--runtime python3.6 \
--profile adminuser
  • TODO - Modify app.py to get DBInstand ARN progromatically

  • TODO - determine how best to tell when DB instance is stood up

  • TODO - Create db instance using boto3

  • TODO - Create Lamdba function using boto3

  • TODO - Automate updating lambda function on commit/code changes

  • TODO - figure out how to use Security Groups, may not be needed for lambda the way I am using --vpc-config SubnetIds=comma-separated-subnet-ids,SecurityGroupIds=default-vpc-security-group-id \

About

How to setup a MySQL DB in AWS with access via Lambda Function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages