Book Image

AWS Tools for PowerShell 6

By : Ramesh Waghmare
Book Image

AWS Tools for PowerShell 6

By: Ramesh Waghmare

Overview of this book

AWS Tools for PowerShell 6 shows you exactly how to automate all the aspects of AWS. You can take advantage of the amazing power of the cloud, yet add powerful scripts and mechanisms to perform common tasks faster than ever before. This book expands on the Amazon documentation with real-world, useful examples and production-ready scripts to automate all the aspects of your new cloud platform. It will cover topics such as managing Windows with PowerShell, setting up security services, administering database services, and deploying and managing networking. You will also explore advanced topics such as PowerShell authoring techniques, and configuring and managing storage and content delivery. By the end of this book, you will be able to use Amazon Web Services to automate and manage Windows servers. You will also have gained a good understanding of automating the AWS infrastructure using simple coding.
Table of Contents (17 chapters)

Custom monitoring for an EC2 instance

For custom metrics for memory, swap, and disk usage, you can make use of the AWS supplied script published on http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html. This script will let you push the data for custom dimensions to CloudWatch, and then you create the alarm on those custom metrics. For Amazon Linux, you need to perform the following steps. For your platform, refer to the link shared. AWS provides these scripts as a sample and there is no support provided if there are any issues with the script.

#sudo yum install perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https -y
#curl http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip -O
#unzip CloudWatchMonitoringScripts-1.2.1.zip
#cd aws-scripts-mon

To test the execution, you run the following command:

# ./mon-put-instance-data...