HomeTutorsContact
AWS - Amazon Web Services
AWS Session Manager Tutorial
Anton Putra
March 25, 2021
1 min

Prerequisites

  • AWS account (AWS Free Tier Sign Up)
  • AWS CLI (Installation guide)

Sections

  • Demo
  • Create IAM Role and EC2 Instance
  • Create CloudWatch Log Group
  • Install AWS Session Manager Plugin
  • Create IAM Policy and IAM user
  • SSH to EC2 Instance
  • Port Forward from EC2 to localhost

Create IAM Role and EC2 Instance

  • Create SSMFullAccess IAM role and attach AmazonSSMFullAccess managed policy to it
  • Create EC2 instance and attach SSMFullAccess instance profile
  • Verify that EC2 instance was registered in AWS Session Manager console

Create CloudWatch Log Group

  • Create ssm-session CloudWatch log group
  • Update Session Manager settings to use ssm-session log group

Install AWS Session Manager Plugin.

  • Follow instructions for your OS here

Create IAM Policy and IAM user

  • Create UserStartSessionPolicy IAM Policy with the following content. Replace <region> and <account-id>.
  • Create SSMAccess IAM group and attach UserStartSessionPolicy policy

  • Create developer user and put it to SSMAccess group

  • Run aws configure to create default profile

SSH to EC2 Instance

  • To ssh to the EC2 instance use the following command, replace <ec2-instace-id>
  • Update EC2 tag labels

  • Install nginx on EC2 instance

Port Forward from EC2 to localhost

  • To port forward from EC2 instance to localhost use the following command, replace <ec2-instace-id>

Clean Up

  • Delete developer IAM user
  • Delete SSMAccess IAM group
  • Delete UserStartSessionPolicy IAM policy
  • Delete ssm-session CloudWatch log group
  • Delete ssm Security Group

Tags

#nginx#docker#ssl

Anton Putra

DevOps Engineer

Big Data | DevOps engineer with hands-on experience in building large, scalable batch and real-time applications with Apache Spark, Hive, Flink on top of Kubernetes; designing and developing CI/CD pipelines.

Expertise

Kubernetes
Terraform
AWS
GCP

Social Media

youtubefacebooklinkedinwebsite

Related Posts

Amazon S3 Object Lambda
Introduction to Amazon S3 Object Lambda
April 04, 2021
1 min
© 2021, All Rights Reserved.

Quick Links

About UsContact Us

Social Media