I have a GitHub account, and I want to use one of the AWS Support team’s diagnostic scripts with my Amazon Relational Database Service (Amazon RDS) instance. How do I clone the rds-support-tools GitHub repository to my Amazon Elastic Compute Cloud (Amazon EC2) instance that is running Linux? 

Before you begin, be sure that your EC2 instance that is running Linux has access to any RDS instances that you want to use the diagnostic tools on. Also, confirm that your EC2 instance can connect to the internet. When you’re ready, clone the rds-support-tools GitHub repository to your EC2 instance by following these steps:

1.    Sign in to your GitHub account, access the rds-support-tools GitHub page, and then choose Fork in the upper-right corner. This creates a private copy of the repository at https://github.com/username/rds-support-tools, where username is replaced with your GitHub user name.

2.    Install Git on your EC2 instance that is running Linux by connecting to the instance through SSH and then running the following command:

sudo yum install git-all

3.    Configure Git by running the following commands:

% cd $HOME
% pwd
/home/ec2-user                        # $HOME directory
% ls -la
...
% git config --global user.name "github username"
% git config --global user.email "github email account"
% git config --global core.editor "editor preference, e.g. vim"
% cat .gitconfig
[user]
    name = username
    email = emailaddress
[core]
    editor = vi

4.    Create a directory for the Git repository by running the following commands:

% pwd
/home/ec2-user
% export GITHUB_ID=username
% mkdir $GITHUB_ID
% cd $GITHUB_ID
% pwd
/home/ec2-user/username

5.    Clone your private, forked version of the GitHub repository to the directory by using the following commands:

% echo $GITHUB_ID
     username
% git clone https://${GITHUB_ID}:password@github.com/${GITHUB_ID}/rds-support-tools.git

Note: Replace password with your password

6.    Set the alias origin to the private (GITHUB_ID) remote repository URL by using the following commands:

% cd $HOME/$GITHUB_ID/rds-support-tools
% git remote set-url origin https://github.com/${GITHUB_ID}/rds-support-tools.git
% git remote -v
origin https://github.com/username/rds-support-tools.git (fetch)
origin https://github.com/username/rds-support-tools.git (push)

7.    Set the alias upstream to be the public (awslabs) remote repository URL using the following commands:

% pwd
home/ec2-user/username/rds-support-tools
% git remote add upstream https://github.com/awslabs/rds-support-tools.git
% git remote -v
origin https://github.com/username/rds-support-tools.git (fetch)
origin https://github.com/username/rds-support-tools.git (push)
upstream    https://github.com/awslabs/rds-support-tools.git (fetch)
upstream    https://github.com/awslabs/rds-support-tools.git (push)

After you complete these steps, you can get the latest updates from the Amazon Web Services - Labs repository at any time by running the following command on your EC2 instance:

% cd $HOME/$GITHUB_ID/rds-support-tools
% pwd
/home/ec2-user/username/rds-support-tools
% git pull upstream master
From https://github.com/awslabs/rds-support-tools
 * branch          master    -> FETCH_HEAD
 * [new branch]    master    -> upstream/master
Updating a213555..ab85126
Fast-forward
% git status

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-12-15

Updated: 2019-02-08