All hands-on labs

Premium Hands-on labbeginnerAWS

Building an SSM module and IAM role in Terraform

Learn how to build an AWS Systems Manager (SSM) module and an IAM role. The IAM Role gets assumed by the SSM service, allowing it to interact with EC2 instances using the permissions defined in the attached IAM policy.

  • 9 guided tasks
  • Terminal in the browser

Scenario

This lab is part of the Terraform on AWS course. It continues the Building the SSM module lesson, where you write the SSM module that you'll deploy here. The same project also holds the VPC module from the Getting started - building the VPC module, Building Subnets, Route Tables, and NAT Gateway, and LAB: Testing deployment of our VPC lessons. If you completed those lessons in your own terminal, open that project directory and skip ahead to the Configure your AWS CLI task.

You can also see the course project code on GitHub. The repository holds the finished project, so it also includes the modules from later lessons.

In this lab, you'll deploy a Terraform project that builds a VPC network and an SSM module. The SSM module creates an IAM Role that the SSM service assumes, and it turns on Default Host Management Configuration in the region so that SSM can interact with EC2 instances. You'll verify the setting with the AWS CLI and then destroy everything with Terraform.

What you will learn

  • Write a Terraform project with a VPC module and an SSM module.
  • Create the IAM Role that AWS Systems Manager assumes to manage EC2 instances.
  • Deploy the configuration with terraform init, plan, and apply.
  • Verify the SSM service setting with the AWS CLI and remove the resources with terraform destroy.
Hands-on lab

Building an SSM module and IAM role in Terraform

Included in Cybr Premium.