WorkHub
The Schedule jobs for Amazon RDS PostgreSQL template helps you to automate Amazon RDS PostgreSQL and Aurora PostgreSQL database workloads. It uses three fundamental AWS services:
AWS Lambda – to run the tasks (e.g., to execute SQL queries)
AWS Secrets Manager – to securely store and fetch your database credentials
Amazon CloudWatch Events – to call the tasks at regular intervals (e.g., hourly or daily)
So, after you have installed it, your tasks will run automatically, when you wish, without your having to sit down and manually do them.
Handwork is okay when there is only one or two things. But as things continue to increase, it is hard to manage everything. This template:
Saves time - need not log in and run queries each time
Eliminates mistakes – no possibility of forgetting or typing incorrectly
Protects your information – credentials are not hardcoded; they are encrypted
On time every time – CloudWatch Events makes sure your job never runs behind
It also keeps track of what was done and when so that you can clearly view everything.
This is best for:
Developers of application software using PostgreSQL
Database administrators who conduct routine tasks such as cleanup, backup, or maintenance.
DevOps developers who want to automate systems
Any individual looking to get their PostgreSQL database smoother without their intervention
You must repeat the same SQL actions again
You require a secure means of storing database passwords
You would prefer that the system did it for you without the necessity to log in or recall
The following are the elements that render this template operational:
Amazon CloudWatch Events - This is similar to a timer. It lets you set when the task will run, every hour, every day, once a week, etc.
AWS Lambda - This is where the work is done. The Lambda function runs your SQL query.
AWS Secrets Manager - This stores your database username and password securely. Lambda only captures them right before it executes the job, so credentials are not exposed.
Amazon RDS / Aurora PostgreSQL- This is your own database on which your SQL job runs.
IAM Role for Lambda - This allows your Lambda function to access Secrets Manager and connect to the database.
Security Groups - These dictate what resources can communicate with your database.
Amazon CloudTrail - Tracks and logs when tasks were run. Useful for determining what happened and when.
Amazon S3 (optional) - You can store query results or logs here.
Amazon SNS (optional) - Can send notifications in case of a failed action, so you receive immediate notification.
AWS Config - Ensure the installation meets with the the best security practices.
Your SQL Queries - These are your actual tasks you wish to do, for example, clean old data, backup, or verify something in the database.
Database Connection Handler - Helps the Lambda function to connect to the database using credentials stored in Secrets Manager.
Cloudairy makes visually planning AWS workflows easy. Here's how to start using this template:
Log in to your Cloudairy account.
Proceed to the Templates tab.
Search for "Schedule Jobs for Amazon RDS for PostgreSQL."
Click on the template to see how it's built.
Click Open to add it to your workspace.
Begin tailoring to suit your own tasks and database.
Once you have loaded the template, then follow:
Add database details – Add details of your RDS or Aurora PostgreSQL database.
Schedule your task – Select how often you wish the task to run.
SQL – Insert your query into the Lambda function.
Set permissions – Grant Lambda read access to Secrets Manager and the database.
Test the installation – Attempt to run it once and check if it is working.
Track jobs – Use CloudTrail and CloudWatch Logs to track if jobs are successful.
(Optional) – Include S3 to store results or SNS to send out alerts.
The Schedule jobs for Amazon RDS PostgreSQL template is a simple and effective way of automating batch jobs in Amazon RDS PostgreSQL or Aurora PostgreSQL. It uses AWS Lambda to run the jobs, Secrets Manager to safely store passwords, and CloudWatch Events to schedule them. No more typing in a login, typing in queries manually, or store passwords into your code. It's all done for you once you've set it up, on schedule, safely, and reliably. If you prefer to work less on routine tasks and more on creating and refining your apps, the Schedule jobs for Amazon RDS PostgreSQL template is a suitable starting point.
Find templates tailored to your specific needs. Whether you’re designing diagrams, planning projects, or brainstorming ideas, explore related templates to streamline your workflow and inspire creativity
Unlock AI-driven design and teamwork. Start your free trial today
Unlock AI-driven design and teamwork. Start your free trial today