Home

Using AWS Systems Manager

Project Overview

Today I completed a comprehensive project focused on AWS Systems Manager, which is a collection of capabilities for centralizing operational data and automating tasks across AWS resources. Systems Manager can configure and manage EC2 instances, on-premises servers, virtual machines, and other AWS resources at scale. I achieved all the objectives, which included verifying configurations and permissions, running tasks on multiple servers, updating application settings or configurations, and accessing the command line on an instance.

Task 1: Generating Inventory Lists for Managed Instances

I started by using Fleet Manager, a capability of Systems Manager, to collect operating system information, application information, and metadata from my EC2 instances. This feature allows me to query metadata to quickly understand which instances are running the software and configurations required by software policy and which instances need updating.

Here's exactly what I did:

After completing these steps, a banner with the message "Setup inventory request succeeded" appeared on the Fleet Manager page. The Inventory capability of Systems Manager began regularly inventorying the instance for the selected properties.

This tab listed all applications installed on the instance. I took some time to review the installed applications and explore other options in the Inventory type dropdown list.

I successfully created a Systems Manager inventory association for my instance. Using Inventory, I was able to review and validate software configurations on my instances without needing to connect to each instance via SSH, which was quite convenient.

Task 2: Installing a Custom Application using Run Command

For this task, I installed a custom web application (Widget Manufacturing Dashboard) using Run Command, another capability of Systems Manager.

The process involved Systems Manager installing an application on an EC2 instance within a VPC using Run Command. The command ran an "install script" and installed the following: Apache web server, PHP, AWS SDK, and the web application. Once everything was installed, it also started the web server.

Here's how I did it:

The Managed Instance had the Systems Manager agent installed. The agent had registered the instance to the service, which allowed it to be selected for Run Command. I also realized it's possible to identify target instances using tags, which allows running a single command on a whole fleet of matching instances.

This section displayed the CLI command that initiates Run Command. I could potentially copy this command and use it in the future within a script rather than having to use the AWS Management Console.

A banner with the Command ID appeared, indicating that it was successfully sent on the Command ID page.

To validate the custom application installation:

The Widget Manufacturing Dashboard that I installed appeared, confirming I had successfully used Run Command through Systems Manager to install a custom application onto my instance without needing to remotely access the instance via SSH.

Task 3: Using Parameter Store to Manage Application Settings

Parameter Store, another capability of Systems Manager, provides secure, hierarchical storage for configuration data management and secrets management. It can store data such as passwords, database strings, and license codes as parameter values, either as plain text or encrypted data. These values can then be referenced using the unique name specified when creating the parameter.

For this task, I used Parameter Store to store a parameter that activated a feature in my application:

A banner with the message "Create parameter request succeeded" appeared at the top of the page.

I noticed the parameter can be specified as a hierarchical path, such as /dashboard/<option>.

The application running on my EC2 instance automatically checks for this parameter. When it finds this existing parameter, additional features are displayed.

I observed that three charts were now displayed. The application was checking Parameter Store to determine whether the additional chart (which is still in beta) should be displayed. I learned it's common to configure applications to display "dark features" that are installed but not yet activated.

It is common to configure applications to display "dark features" that are installed but not yet activated.

I also had the option to delete the parameter and refresh the browser tab with the application, which would make the third chart disappear again.

Task 4: Using Session Manager to Access Instances

With Session Manager, another capability of Systems Manager, I could manage my EC2 instances through an interactive one-step browser-based shell or through the AWS CLI. Session Manager provides secure and auditable instance management without needing to open inbound ports, maintain bastion hosts, or manage SSH keys. It also helps comply with corporate policies requiring controlled access to instances, strict security practices, and fully auditable logs with instance access details while still providing end users with one-step cross-platform access to EC2 instances.

When using Session Manager with Microsoft Windows, it provides access to a PowerShell console on the instance.

For this task, I accessed the EC2 instance through Session Manager:

A new session tab opened in my browser.

ls /var/www/html

The output listed the application files that were installed on the instance.

# Get region AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone` export AWS_DEFAULT_REGION=${AZ::-1} # List information about EC2 instances aws ec2 describe-instances

The output listed the EC2 instance details for the Managed Instance in JSON format.

This task demonstrates how you can use Session Manager to log in to an instance without using SSH. You can also verify this capability by confirming that the SSH port is closed for the instance's security group.

I learned that access to Session Manager can be restricted through IAM policies, and AWS CloudTrail logs Session Manager usage. These options provide better security and auditing than traditional SSH access.

Conclusion

I successfully completed all the tasks using AWS Systems Manager, including:

This hands-on experience gave me a solid understanding of how AWS Systems Manager can be used to manage AWS resources efficiently and securely.

Related Topics