0
0
AWScloud~30 mins

Using profiles for multiple accounts in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Using profiles for multiple accounts
📖 Scenario: You work as a cloud engineer managing resources across two AWS accounts: a development account and a production account. To switch between these accounts easily, you want to set up AWS CLI profiles.
🎯 Goal: Set up AWS CLI configuration with two profiles named dev and prod for the development and production accounts respectively.
📋 What You'll Learn
Create a basic AWS CLI config file with a default profile
Add a profile named dev with specific region and output format
Add a profile named prod with different region and output format
Verify the profiles are correctly configured in the AWS CLI config file
💡 Why This Matters
🌍 Real World
Managing multiple AWS accounts is common in companies to separate development, testing, and production environments. Profiles help switch contexts easily.
💼 Career
Cloud engineers and DevOps professionals often configure and use multiple AWS profiles to manage resources securely and efficiently across accounts.
Progress0 / 4 steps
1
Create the default AWS CLI config section
Create a file named ~/.aws/config and add the default profile section with region = us-east-1 and output = json.
AWS
Need a hint?

The default profile is used when no other profile is specified. It must have region and output keys.

2
Add the development profile
Add a profile section named [profile dev] with region = us-west-2 and output = text to the ~/.aws/config file.
AWS
Need a hint?

Profile sections start with [profile profilename]. Use the exact profile name dev.

3
Add the production profile
Add a profile section named [profile prod] with region = eu-central-1 and output = table to the ~/.aws/config file.
AWS
Need a hint?

Use the exact profile name prod and set the region and output as specified.

4
Verify the AWS CLI profiles
Ensure the ~/.aws/config file contains the [default], [profile dev], and [profile prod] sections with their respective region and output settings.
AWS
Need a hint?

Check that all three profiles exist with correct settings in the config file.