Amazon RDS tutorials and sample code
The AWS documentation includes several tutorials that guide you through common Amazon RDS use cases. Many of these tutorials show you how to use Amazon RDS with other AWS services. In addition, you can access sample code in GitHub.
Note
You can find more tutorials at the AWS Database Blog
Topics
Tutorials in this guide
The following tutorials in this guide show you how to perform common tasks with Amazon RDS:
-
Tutorial: Create a VPC for use with a DB instance (IPv4 only)
Learn how to include a DB instance in a virtual private cloud (VPC) based on the Amazon VPC service. In this case, the VPC shares data with a web server that is running on an Amazon EC2 instance in the same VPC.
-
Tutorial: Create a VPC for use with a DB instance (dual-stack mode)
Learn how to include a DB instance in a virtual private cloud (VPC) based on the Amazon VPC service. In this case, the VPC shares data with an Amazon EC2 instance in the same VPC. In this tutorial, you create the VPC for this scenario that works with a database running in dual-stack mode.
-
Tutorial: Create a web server and an Amazon RDS DB instance
Learn how to install an Apache web server with PHP and create a MySQL database. The web server runs on an Amazon EC2 instance using Amazon Linux, and the MySQL database is a MySQL DB instance. Both the Amazon EC2 instance and the DB instance run in an Amazon VPC.
-
Tutorial: Restore an Amazon RDS DB instance from a DB snapshot
Learn how to restore a DB instance from a DB snapshot.
-
Tutorial: Using a Lambda function to access an Amazon RDS database
Learn how to create a Lambda function from the RDS console to access a database through a proxy, create a table, add a few records, and retrieve the records from the table. You also learn how to invoke the Lambda function and verify the query results.
-
Tutorial: Specify which DB instances to stop by using tags
Learn how to use tags to specify which DB instances to stop.
-
Tutorial: Log DB instance state changes using Amazon EventBridge
Learn how to log a DB instance state change using Amazon EventBridge and AWS Lambda.
-
Tutorial: Creating an Amazon CloudWatch alarm for Multi-AZ DB cluster replica lag for Amazon RDS
Learn how to create a CloudWatch alarm that sends an Amazon SNS message when replica lag for a Multi-AZ DB cluster has exceeded a threshold. An alarm watches the
ReplicaLag
metric over a time period that you specify. The action is a notification sent to an Amazon SNS topic or Amazon EC2 Auto Scaling policy.
Tutorials in other AWS guides
The following tutorials in other AWS guides show you how to perform common tasks with Amazon RDS:
-
Tutorial: Rotating a Secret for an AWS Database in the AWS Secrets Manager User Guide
Learn how to create a secret for an AWS database and configure the secret to rotate on a schedule. You trigger one rotation manually, and then confirm that the new version of the secret continues to provide access.
-
Tutorials and samples in the AWS Elastic Beanstalk Developer Guide
Learn how to deploy applications that use Amazon RDS databases with AWS Elastic Beanstalk.
-
Using Data from an Amazon RDS Database to Create an Amazon ML Datasource in the Amazon Machine Learning Developer Guide
Learn how to create an Amazon Machine Learning (Amazon ML) datasource object from data stored in a MySQL DB instance.
-
Manually Enabling Access to an Amazon RDS Instance in a VPC in the Amazon QuickSight User Guide
Learn how to enable Amazon QuickSight access to an Amazon RDS DB instance in a VPC.
AWS workshop and lab content portal for Amazon RDS PostgreSQL
The following collection of workshops and other hands-on content helps you to gain an understanding of the Amazon RDS PostgreSQL features and capabilities:
-
Learn how to create the DB instance.
-
Performance Monitoring with RDS Tools
Learn how to use AWS and SQL tools(Cloudwatch, Enhanced Monitoring, Slow Query Logs, Performance Insights, PostgreSQL Catalog Views) to understand performance issues and identify ways to improve performance of your database.
AWS workshop and lab content portal for Amazon RDS MySQL
The following collection of workshops and other hands-on content helps you to gain an understanding of the Amazon RDS MySQL features and capabilities:
-
Learn how to create the DB instance.
-
Learn how to monitor and tune your DB instance using Performance insights.
Tutorials and sample code in GitHub
The following tutorials and sample code in GitHub show you how to perform common tasks with Amazon RDS:
-
Creating the Amazon Relational Database Service item tracker
Learn how to create an application that tracks and reports on work items. This application uses Amazon RDS, Amazon Simple Email Service, Elastic Beanstalk, and SDK for Java 2.x.
Using this service with an AWS SDK
AWS software development kits (SDKs) are available for many popular programming languages. Each SDK provides an API, code examples, and documentation that make it easier for developers to build applications in their preferred language.
SDK documentation | Code examples |
---|---|
For examples specific to this service, see Code examples for Amazon RDS using AWS SDKs.
Example availability
Can't find what you need? Request a code example by using the Provide feedback link at the bottom of this page.