This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install -y wget | |
wget https://s3.amazonaws.com/amazoncloudwatch-agent/assets/amazon-cloudwatch-agent.gpg -qP /tmp/cwagent | |
# Key value check | |
key_value=$(gpg --import /tmp/cwagent/amazon-cloudwatch-agent.gpg |& grep -Po '(3B789C72)') | |
if [ "$key_value" = "3B789C72" ]; then | |
echo "Good key value, proceeding." | |
# Public key fingerprint check | |
key_fingerprint=$(gpg --fingerprint $key_value |& grep -Po '(9376 16F3 450B 7D80 6CBD 9725 D581 6730 3B78 9C72)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws ec2 describe-instances --filters "Name=instance-state-name, Values=running" --query 'Reservations[*].Instances[*].{ID:InstanceId,Name:Tags[?Key==`Name`]|[*].Value,Type:InstanceType,Status:State.Name}' --output json |