Terraform blueprints that deploy RDS and Delphix assets into AWS and configures them to work together.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
phase_1
phase_2
phase_3
sample_plans
.example.docker
.example.env
.gitignore
LICENSE
README.md

README.md

delphix-terraform-blueprints-rds

Terraform blueprints that deploy RDS and Delphix assets into AWS and configures them to work together.

Table of Contents

  1. Description
  2. Prerequisites
  3. Installation
  4. Usage
  5. Links
  6. Workflow
  7. Reporting Issues
  8. License

Description

The purpose of this project is to demonstrate how Delphix can ingest and leverage data from Amazon RDS. This repository contains Terraform blueprints that will create all of the objects and data needed to complete the demonstration.

This is repo is actually a set of three terraform blueprints that build sequentially on top of eachother, due to dependencies. The sequence of automation is as follows:

Phase 1 - Build the networking, security rules, servers and RDS instance.

Phase 2 - Configure DMS & Delphix, Start the DMS replication task.

Phase 3 - Create the Virtual Database copy of the RDS data source.

Prerequisites

These instructions assume the reader has a basic knowledge of Terraform and a working understanding of AWS. Pre-requisites:

  1. Access to Delphix 5.2 AMI in AWS obtained from here (requires licensed account)
  2. Access to the delphix-rds-demo-target AMI in AWS created from here
  3. Appropriate permissions to create, manage, and destroy the corresponding assets in AWS.
  • VPC
  • Subnet
  • Route
  • Internet Gateway
  • Security Group
  • AMI (Read Access)
  • EC Instance
  • DMS Replication Instance
  • DMS Replication Subnet
  • DMS Replication Task
  • DMS Endpoint
  • RDS Database Instance
  • RDS Database Subnet Group
  1. An AWS Key Pair for the region you will deploy into (us-west-2, by default)

Installation

Via Docker (the easiest)

  • Clone this repository
  • Navigate into the cloned directory
  • Copy the .example.docker to .environment.env

Without Docker (the second easiest)

  • Clone this repository
  • Navigate into the cloned directory
  • Copy the .example.env to .environment.env
  • Install Terraform 11.7 or above from here to /usr/local/bin/terraform
  • Install the terraform-provider-delphix from here into the phase_2 and the phase_3 subdirectories of the cloned repo
git clone https://github.com/delphix/delphix-terraform-blueprints-rds
cd delphix-terraform-blueprints-rds
cp .example.docker .environment.env
#or#
cp .example.env .environment.env

Usage

Configuring

  1. Edit the .environment.env file in the root directory of the cloned repo The following variables should be set before proceeding, you can proceed with the defaults on the remaining:
  • TF_VAR_access_key - Your AWS Access Key
  • TF_VAR_secret_key - Your AWS Secret Key
  • TF_VAR_aws_region - The AWS region where you will run this demo (if you change this, you will need to change TF_VAR_database_azs)
  • TF_VAR_key_name - The name of your AWS key pair, this is region specific
  • TF_VAR_rds_db_password - 8-30 character password of your choosing
  • TF_VAR_delphixdb_password - 8-30 character password of your choosing
  • TF_VAR_delphix_admin_password - password of your choosing
  1. Copy your AWS Key file (<something>.pem) into the cloned repo folder

Building

Via Docker

  1. (Optional) Pull the cloudsurgeon/rds_demo docker image
  2. Initialize the current working directory, via the docker container
  3. Run the demonstration. This process will take ~20-25 minutes to complete.
docker pull cloudsurgeon/rds_demo
docker run --env-file .environment.env -i -t -v $(pwd):/app/ -w /app/ cloudsurgeon/rds_demo init
docker run --env-file .environment.env -i -t -v $(pwd):/app/ -w /app/ cloudsurgeon/rds_demo apply -auto-approve

Without Docker

  1. source the .example.env file, i.e. source .environment.env
  2. change to the phase_1 subdirectory in your terminal
  3. Run terraform init to initialize Terraform in the directory
  4. Run terraform apply --auto-approve to apply the Terraform plan to build out the assets for Phase 1. This process will take 15-20 minutes to complete.
  5. Change to the phase_2 subdirectory in your terminal cd ../phase_2
  6. Run terraform init to initialize Terraform in the directory
  7. Run terraform apply --auto-approve to apply the Terraform plan to build out the assets for Phase 2. This process will take ~5-10 minutes to complete.
  8. Change to the phase_3 subdirectory in your terminal cd ../phase_3
  9. Run terraform init to initialize Terraform in the directory
  10. Run terraform apply --auto-approve to apply the Terraform plan to build out the assets for Phase 3.

Destroying

Via Docker

  1. Destroy the demonstration. This process will take ~20 minutes to complete.
docker run --env-file .environment.env -i -t -v $(pwd):/app/ -w /app/ cloudsurgeon/rds_demo destroy -auto-approve

Without Docker

  1. Stop the DMS replication task in the AWS console
  2. In your terminal, navigate to the root project directory.
  3. source the .example.env file, i.e. source .example.env
  4. change to the phase_3 subdirectory
  5. Run terraform destroy to destroy the phase_3 assets.
  6. change to the phase_2 subdirectory
  7. Run terraform destroy to destroy the phase_2 assets. This process will take ~5-10 minutes to complete.
  8. Once complete, change to the phase_1 subdirectory of the cloned repo
  9. Run terraform destroy to destroy the phase_1 assets. This process will take ~15 minutes to complete.

Links

Workflow

  1. Fork the project.
  2. Make your bug fix or new feature.
  3. Add tests for your code.
  4. Send a pull request.

Contributions must be signed as User Name <user@email.com>. Make sure to set up Git with user name and email address. Bug fixes should branch from the current stable branch. New feature should be based on the master branch.

Reporting Issues

Issues should be reported in the repo's issue tab.

License

This is code is licensed under the Apache License 2.0. Full license is available here.