Tuesday, 31 October 2017

Single EC2 Instance Part 6 - IAM Role

We need to create an IAM role for the backup server (which is an EC2 instance itself) to run as. This IAM role should have enough permissions to read / backup the client's EC2 instance, and to create / restore an EC2 instance. We will create 2 policies first, for these permissions, then assign the 2 policies to the IAM role.

Let's get to work...

"Services", "IAM".
"Policies", "Create policy".
Click "Select" for "Create Your Own Policy".
We are going to create a policy that has enough permissions to do backups.
Policy name: (can be anything. A descriptive name like "CPM_backup_only_policy" is recommended.)
Description: (can be anything.)
Policy Document: (contents of this file. The contents are from this site.)
Click "Validate Policy".
The text "This policy is valid." should be displayed at the top. If not, check for possible syntax errors in the "Policy Document".
Click "Create Policy".
The policy for backup up is done.
We now move on to creating the policy for recovery / restore process.
Click "Create policy".
Click "Select" for "Create Your Own Policy".
We are going to create a policy that has enough permissions to do recovery.
Policy name: (can be anything. A descriptive name like "CPM_recover_only_policy" is recommended.)
Description: (can be anything.)
Policy Document: (contents of this file. The contents are from this site.)
Click "Validate Policy".
The text "This policy is valid." should be displayed at the top. If not, check for possible syntax errors in the "Policy Document".
Click "Create Policy".
Policies for backup and recovery are created.
Next is the IAM role.
Click "Roles", "Create role".
Click "EC2", "Allows EC2 instances to call AWS services in your behalf."
Click "Next: Permissions".
Use the search box to find the 2 policies that we have previously created.
Tick both policies, click "Next: Review".
Role name: (can be anything, but a descriptive name is recommended. "CPM_Role" is the name used in this demo.)
Click "Create role".
IAM role for backup server created.

Next: Creating the backup server...

Part 7 - The Backup Server

Single EC2 Instance - Table of Contents