Python SAM Lambda module for periodically checking Aurora Database Engine Updates documentation site for new version releases and notify via SES if updates are found.
This sample code is made available under a modified MIT license. See the LICENSE file.
AWS Lambda Invocation (Usually Free https://aws.amazon.com/free/)
Amazon SES (Usually Free https://aws.amazon.com/free/)
Minimal Amazon S3 Usage
awscli - https://aws.amazon.com/cli/
configure AWS credentials for target account
aws configure
Verified Amazon SES Sender email
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html
If you verify an email, you can send from/to that address.
To send to other addresses, you need to move SES out of sandbox mode:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html
Docker (optional for building the lambda python package with updated https://pypi.python.org/ third-party libraries)
Run build.sh to build a new lambda deployment package. This requires Docker, as it builds the package in an Amazon Linux container.
sh build.sh
Update the values in deploy.sh for your AWS account details.
CONFIG_BUCKET: S3 Bucket to use for storing configuration file
CONFIG_FILE: Configuration file name
BUCKET: Bucket for -
- Keeping previous Aurora Engine updates doc page (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) sha1 fingerprints.
And then run deploy.sh
sh deploy.sh
- Create a lambda function (python 3.6 runtime)
- Create a lambda IAM execution role with ses:, s3:, organizations:DescribeAccount:
- Upload zip to console from lambda.zip produced by running 'build.sh'.
- Update ENV Variables in Lambda console
CONFIG_BUCKET: S3 Bucket to use for storing configuration file
CONFIG_FILE: Configuration file name
BUCKET: Bucket for storing previous SHA1 fingerprints for comparison. - Create a trigger (CloudWatch Event)
Once the lambda is created, find it in the AWS Lambda console.
You can create the following test event to test a fake previous site (test11.htm, test20.htm) against the current Aurora Doc for simulating new Aurora update release event.
Any other event content is ignored and defaults into checking against the real site.
{
"test": "True"
}
https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-test-function.html
Edit the contents of src/config.yaml
# SES settings
ses_region: "us-east-1"
ses_from: "changeme@domain.com" # Sender
ses_send: "changeme@domain.com" # Recipient list separated by comma
# Log Configuration File.
log_config: "log_config.yaml"
# Email template for sending blocked IP found notification.
email_template: "check-aurora-update\n\n
New Aurora Engine update released: \n
{0}{1}\n\n"