DEV Community

Isabelle Wagenvoord
Isabelle Wagenvoord

Posted on • Originally published at wagenvoord.dev

Register your Raspberry Pi as a Managed Instance on AWS

Prerequisites

  • Access to a Raspberry Pi
  • An AWS account

Contents

  1. Create a Managed Instance Activation
  2. Install SSM Agent on your Raspberry Pi

Create a Managed Instance Activation

Log into the AWS online console. Navigate to the Systems Manager console by clicking on 'Services' and searching for 'systems manager'. The console should look similar to this:

Systems Manager Console

On the left sidebar, scroll under Instances and Nodes and click on Hybrid Activations. Click Create an Activation.

In the 'Create Activation' page, fill out the following fields:

Instance Limit - The number of Rasberry Pies you want to register using this particular activation.

IAM Role - Use default role

Activation Expiry Date - Any expiration date in the future. If you want to register more devices after the activation has expired, you will need to create a new activation.

Default Instance Name - Raspberry Pi

Create activation page

Click 'Create activation'. When you are redirected to the Activations page, record the Activation Code and Activation ID that is provided to you.

Activation code and activation id

Install SSM Agent

Make sure your Raspberry Pi is up to date:

sudo apt-get update
sudo apt-get upgrade

Install Amazon SSM Agent:

sudo curl https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_arm/amazon-ssm-agent.deb -o amazon-ssm-agent.deb
sudo dpkg -i amazon-ssm-agent.deb
# remove amazon-ssm-agent.deb once package is installed
rm amazon-ssm-agent.deb

Register your Raspberry Pi as a managed instance!

sudo service amazon-ssm-agent stop
sudo amazon-ssm-agent -register -code "activation-code" -id "activation-id" -region "region"

Replace activation-code and activation-id with the activation code and id you recorded earlier. Replace region with a region name, such as us-east-1. Start amazon-ssm-agent again so it can communicate with AWS.

sudo service amazon-ssm-agent start
# You may find yourself stuck in the logs that follow once you 
# run this command. Ctrl + C will get you out of this,
# and won't close your pi's connection to AWS.

Return to the AWS Systems Manager console. In the sidebar, navigate to Managed Instances. You should now see your Raspberry Pi registered as a managed instance!

Raspberry Pi registered as a managed instance in console

Top comments (0)