Skip to content

scripts to simulate ec2 resources and test cloudwatch alarms#3

Open
0xhitesh-91 wants to merge 1 commit intomvp-rockets:masterfrom
0xhitesh-91:feature/ops-scripts-for-reousrces-simulation-and-alarm-test
Open

scripts to simulate ec2 resources and test cloudwatch alarms#3
0xhitesh-91 wants to merge 1 commit intomvp-rockets:masterfrom
0xhitesh-91:feature/ops-scripts-for-reousrces-simulation-and-alarm-test

Conversation

@0xhitesh-91
Copy link
Copy Markdown

No description provided.

AWS_REGION=${AWS_REGION:-"ap-south-1"} # Default to ap-south-1 if not set

# Check if AWS credentials are provided through environment variables
if [ -z "$AWS_ACCESS_KEY_ID" ] || [ -z "$AWS_SECRET_ACCESS_KEY" ]; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use this variables.
Just check aws sts get-caller-identity if you need. See https://docs.aws.amazon.com/cli/latest/reference/sts/get-caller-identity.html

fi

# Define an array of log groups and their corresponding log streams
log_groups_and_streams=(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source this from the env/.env.<environment> file. Which environment we want to validated should be the first argument for the scripts.
e.g. check_cloudwatch_logs.sh production. Check how we are loding the env files in deploy.sh

echo " --parallel Run the disk load simulation on all instances in parallel."
echo
echo "Example:"
echo " $0 --aws-profile 474888828713_AdministratorAccess --region ap-southeast-1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't hardcode the profiles in the script. We expect the user to set this up before calling the script.
For e.g.
AWS_PROFILE=prj-env simulate_volume_load.sh qa

}

# Default values
AWS_PROFILE=""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as simulate_volume_load.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants