Amazon RDS on AWS
Partner Solution Deployment Guide
June 2023
Sudhir Gupta, AWS Databases & Analytics team, and Battulga Purevragchaa, AWS ISV Workload Migration program
Troy Lindsay, Andrew Gargan, Vinod Shukla, and Dave May, AWS Integration & Automation team
Refer to the GitHub repository to view source files, report bugs, submit feature ideas, and post feedback about this Partner Solution. To comment on the documentation, refer to Feedback. |
This Partner Solution was created by Amazon Web Services (AWS). Partner Solutions are automated reference deployments that help people deploy popular technologies on AWS according to AWS best practices. If you’re unfamiliar with AWS Partner Solutions, refer to the AWS Partner Solution General Information Guide.
Overview
This guide covers the information you need to deploy Amazon Relational Database Service (Amazon RDS) in the AWS Cloud.
The solution deploys a Amazon RDS cluster in a private subnet with an Amazon RDS read replica in one Availability Zone and a write replica in another zone. Native replication mechanisms available with the database engine keep the read replica in sync with the source database. The deployment also includes access to Amazon CloudWatch metrics and logs, event notifications, and data encryption.
Costs and licenses
There is no cost to use this Partner Solution, but you will be billed for any AWS services or resources that this Partner Solution deploys. For more information, refer to the AWS Partner Solution General Information Guide.
Architecture
Deploying this Partner Solution with default parameters builds the following Amazon RDS environment in the AWS Cloud.
As shown in Figure 1, this solution sets up the following:
-
A highly available architecture that spans two Availability Zones.*
-
A virtual private cloud (VPC) configured with public and private subnets, according to AWS best practices, to provide you with your own virtual network on AWS.*
-
In the public subnets:
-
Managed NAT gateways to allow outbound internet access for resources in the private subnets.*
-
An optional Linux bastion host in an Auto Scaling group to allow inbound SSH (Secure Shell) access to Amazon Elastic Compute Cloud (Amazon EC2) instances in public and private subnets.*
-
-
In the private subnets:
-
An Amazon RDS cluster that includes a write replica in one Availability Zone and a read replica in the other.
-
-
Amazon CloudWatch metrics for monitoring the database instance and CloudWatch logs for storing database logs.
-
An Amazon Simple Notification Service (Amazon SNS) topic for sending CloudWatch alarm and Amazon RDS event notifications.
-
AWS Key Management Service (AWS KMS) for encrypting the data stored in the database instance.
* The template that deploys this Partner Solution into an existing VPC skips the components marked by asterisks and prompts you for your existing VPC configuration.
Deployment options
This Partner Solution provides the following deployment options:
-
Deploy Amazon RDS for PostgreSQL into a new VPC. This option builds a new AWS environment that consists of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys Amazon RDS for PostgreSQL into this new VPC.
-
Deploy Amazon RDS for PostgreSQL into an existing VPC. This option provisions Amazon RDS for PostgreSQL in your existing AWS infrastructure.
-
Deploy Amazon RDS for MySQL into a new VPC. This option builds a new AWS environment that consists of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys Amazon RDS for MySQL into this new VPC.
-
Deploy Amazon RDS for MySQL into an existing VPC. This option provisions Amazon RDS for MySQL in your existing AWS infrastructure.
-
Deploy Amazon RDS for Microsoft SQL Server into a new VPC. This option builds a new AWS environment that consists of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys Amazon RDS for Microsoft SQL into this new VPC.
-
Deploy Amazon RDS for Microsoft SQL Server into an existing VPC. This option provisions Amazon RDS for Microsoft SQL in your existing AWS infrastructure.
-
Deploy Amazon RDS for MariaDB into a new VPC. This option builds a new AWS environment that consists of the VPC, subnets, NAT gateways, security groups, bastion hosts, and other infrastructure components. It then deploys Amazon RDS for MariaDB into this new VPC.
-
Deploy Amazon RDS for MariaDB into an existing VPC. This option provisions Amazon RDS for MariaDB in your existing AWS infrastructure.
This Partner Solution provides separate templates for these options. It also lets you configure Classless Inter-Domain Routing (CIDR) blocks, instance types, and Amazon RDS settings.
Predeployment steps
-
Identify an email distribution list to use for notifications.
-
Identify the database engine versions that your applications support and select the optimal choice to deploy.
Deployment steps
-
Sign in to your AWS account, and launch this Partner Solution, as described under Deployment options. The AWS CloudFormation console opens with a prepopulated template.
-
Choose the correct AWS Region, and then choose Next.
-
On the Create stack page, keep the default setting for the template URL, and then choose Next.
-
On the Specify stack details page, change the stack name if needed. Review the parameters for the template. Provide values for the parameters that require input. For all other parameters, review the default settings and customize them as necessary. When you finish reviewing and customizing the parameters, choose Next.
Unless you’re customizing the Partner Solution templates or are instructed otherwise in this guide’s Predeployment section, don’t change the default settings for the following parameters: QSS3BucketName
,QSS3BucketRegion
, andQSS3KeyPrefix
. Changing the values of these parameters will modify code references that point to the Amazon Simple Storage Service (Amazon S3) bucket name and key prefix. For more information, refer to the AWS Partner Solutions Contributor’s Guide. -
On the Configure stack options page, you can specify tags (key-value pairs) for resources in your stack and set advanced options. When you finish, choose Next.
-
On the Review page, review and confirm the template settings. Under Capabilities, select all of the check boxes to acknowledge that the template creates AWS Identity and Access Management (IAM) resources that might require the ability to automatically expand macros.
-
Choose Create stack. The stack takes about 30 minutes to deploy.
-
Monitor the stack’s status, and when the status is CREATE_COMPLETE, the Amazon RDS deployment is ready.
-
To view the created resources, choose the Outputs tab.
Postdeployment steps
The following optional test procedure assumes that you have a bastion host with TCP forwarding enabled. |
-
Download the latest version of the database client and install it on the workstation that will connect to the database cluster.
-
From the AWS CloudFormation console, on the Outputs tab for
BastionStack
, note the value forEIP1
, as shown in Figure 2.Figure 2. IP address for Linux bastion host -
From the AWS CloudFormation console, on the Outputs tab for
RDSStack
, note the values ofDBName
,DBUsername
,RDSEndpointAddress
, andRDSEndpointPort
as shown in Figure 3.Figure 3. {service-short-name} stack outputs -
Launch {database-client} on your workstation, enter a new password, and choose OK to continue.
Figure 4. Set the password for {database-client}In {database-client}, to create a new server connection, right-click Servers to open the context menu, and then choose Register > Server….
Figure 5. Register a new server connection in {database-client} -
To connect to your database, choose the General tab, and provide a descriptive name.
Figure 6. General settings for {database-client} server connection setup -
Choose the Connection tab and provide the following values, as shown in Figure 7:
You can find most of the required values on the Outputs tab of the RDSStack
, as shown in Figure 3.-
In the Host name/address field, enter the value for
<RDSEndpointAddress>
. -
In the Maintenance database field, enter the value for
<DBName>
. -
In the Username field, enter the value for
<DBUsername>
. -
In the Password field, enter the value of
<DBPassword>
, which you entered during stack creation.Figure 7. Connection settings for the Amazon RDS database cluster
-
-
Choose the SSH Tunnel tab and provide the following values, as shown in Figure 8:
-
Enable the Use SSH tunneling toggle switch.
-
In the Tunnel host field, enter
<EIP1>
from the Outputs tab of theBastionStack
, as shown in Figure 2. -
In the Username field, enter
ec2-user
. -
In the Authentication field, select
Identity file
. -
In the Identity file field, select your Amazon EC2 key pair private key file, such as
keypair.pem
.Figure 8. SSH tunnel settings for the Amazon RDS database cluster
-
-
Choose Save to store the connection information and connect to your new Amazon RDS instance.
After connecting successfully, you can access the {database-client} dashboard, as shown in Figure 9.
Figure 9. Confirmation that the Amazon RDS database cluster is accepting connections
Troubleshooting
For troubleshooting common Partner Solution issues, refer to the AWS Partner Solution General Information Guide and Troubleshooting CloudFormation.
Customer responsibility
After you deploy a Partner Solution, confirm that your resources and services are updated and configured—including any required patches—to meet your security and other needs. For more information, refer to the Shared Responsibility Model.
Feedback
To submit feature ideas and report bugs, use the Issues section of the GitHub repository for this Partner Solution. To submit code, refer to the Partner Solution Contributor’s Guide. To submit feedback on this deployment guide, use the following GitHub links:
Notices
This document is provided for informational purposes only. It represents current AWS product offerings and practices as of the date of issue of this document, which are subject to change without notice. Customers are responsible for making their own independent assessment of the information in this document and any use of AWS products or services, each of which is provided "as is" without warranty of any kind, whether expressed or implied. This document does not create any warranties, representations, contractual commitments, conditions, or assurances from AWS, its affiliates, suppliers, or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS agreements, and this document is not part of, nor does it modify, any agreement between AWS and its customers.
The software included with this paper is licensed under the Apache License, version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at https://aws.amazon.com/apache2.0/ or in the accompanying "license" file. This code is distributed on an "as is" basis, without warranties or conditions of any kind, either expressed or implied. Refer to the License for specific language governing permissions and limitations.