Amazon RDS
Learn how to provision databases in instances running in Amazon RDS

Overview

Amazon Relational Database Service (Amazon RDS) is the AWS was of providing relational databases in the cloud. Amazon RDS is available for several engines including Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server. At this time, Humanitec provides out of the box support for PostgreSQL, MySQL and MariaDB types with SQL Server coming soon.

Adding your AWS Account

You can add your AWS Account in the Organization Settings.
UI
CLI
API
  1. 1.
    Click on the Accounts tab.
  2. 2.
    Select Amazon Web Servies.
  3. 3.
    You will be asked to provide an Account Name (a memorable name that will be displayed for this account).
  4. 4.
    Enter your AWS Access Keys.
  5. 5.
    Click on Authorize.
Steps 1 & 2 of adding your AWS account
Steps 3-5 of adding your AWS account
Our CLI is currently in closed beta. Please contact us if you want to learn more.
Accounts can be added via the Create Resource Account endpoint.

Creating a resource definition for a Amazon RDS managed instance

You can easily connect Humanitec to an Amazon RDS managed database instance. The following paragraph explains how.
If you are experimenting with Humanitec and Amazon RDS, we recommend that you start with a public RDS instance as this is the easiest to debug. Whether an Amazon RDS instance is public depends on whether the VPC it is in is itself publicly accessible.
UI
CLI
API
  1. 2.
    Click on the Show all resources button. An overlay with all available resource categories and types will be presented to you.
  2. 3.
    Below Data storages click on the type of database you want to create. This will open an overlay.
  3. 4.
    Choose an ID that you will use to identify the resource definition in Humanitec later.
  4. 5.
    Select a driver, here - mariadb. Based on your resource driver, a form will be shown with the required driver parameters which will be passed to the driver on every resource creation.
  5. 6.
    Below Credentials make sure your AWS account is selected.
  6. 7.
    Fill out the connection parameters that Humanitec will use to create/delete databases in the instance. You can find them in the RDS section of the AWS Console.
    • Host is called "Endpoint" in the console.
    • Username and Password are the user and password you created when you set up the RDS instance or a user with privileges to create users and databases in the instance that you subsequently created.
  7. 8.
    Click on Create.
Steps 1 - 3 of creating a resource definition for an AWS managed instance
Steps 4-8 of creating a resource definition for an AWS managed instance
Our CLI is currently in closed beta. Please contact us if you want to learn more.
Dynamic resource definitions can be created via the Create Dynamic Resource endpoint.

Define Matching

Next, you can configure matching criteria for your database. This enables you to define specific environments or applications to be deployed to this resource.
UI
CLI
API
By clicking on your database in the list of resources, the Matching row will expand and allow you to add or remove matching criteria. Each database resource can be matched to specific Environment Types, App IDs, Environment IDs or Resource IDs. Empty fields are automatically resolved to match all values of the given category.
Define Matching
Based on this Resource Definition, during the deployment on any of the matching environments, an Active Resource will be provisioned if required.
Our CLI is currently in closed beta. Please contact us if you want to learn more.
Matching criteria can be created via the Create new Matching Criteria endpoint.

Creating a resource definition for a private Amazon RDS managed instance

The most common configuration for an Amazon RDS instance is for it not to be publicly accessible. This is achieved by placing it in a private VPC. The RDS instance will only be accessible to AWS resources running in that VPC or in VPCs that are peered to it.
In order to administer a private RDS database, it is common to set up a bastion host or jump server. Humanitec can be configured to use such a server to connect to a private RDS instance.

Configuring the bastion host

If you do not already have a bastion host set up to administer your Amazon RDS instance, you can follow this guide provided by AWS: How can I connect to a private Amazon RDS DB instance from a local machine using an Amazon EC2 instance as a bastion host?
Once the bastion host is set up, it will need to be configured to allows connections from Humanitec. This is done by adding the Humanitec public key into the .ssh/authorized_keys file on the bastion host.
Last modified 2mo ago