How to initiate Session Manager session using CLI

Tonight I want to connect to an EC2 instance that resides in a private subnet. I currently don’t have a bastion host I can use as an intermediary to jump to this instance. Well, as you might have guessed from this post’s title, the AWS Session Manager is something that might be helpful in this case. So, join me in this journey to configure and set up the Session Manager, using AWS CLI only....

July 5, 2024 · 4 min · 767 words · kenno

How to attach instance profile on EC2 with AWS CLI

This is a quick note to remind me on how to attach or associate an instance profile (IAM role) to an EC2 instance using AWS CLI. There is a bonus section at the end to show how to replace one IAM role with another one directly. In this example, I already have a running EC2 instance i-0357ecc1111111111 running. I want to attach a new instance profile called SSMInstanceProfile to this instance....

March 5, 2024 · 3 min · 436 words · kenno