botsin.space Mastodon bot migration update to https://mastodon.kevinhooke.com/ – part 2: @zorkbot

Several months back I updated on my progress on moving a number of my personal projects from botsin.space mastodon server to my own https://mastodon.kevinhooke.com instance.

Over the weekend I made some minor updates to reconfigure a series of AWS Lambdas that allow you to play Zork via Mastodon. It’s up again: if you @ the bot at https://mastodon.kevinhooke.com/@zorkbot with the single word ‘play’ you can start a new game. The Lambda runs every 10 minutes., so at worst case You game state should be saved and reloaded on each interaction with the bot, so you can play over a period of time.

AWS Lightsail default ssh userid

To ssh into AWS ec2 instances the default user id is usually ‘ec2-user’ (see my ec2 ssh checklist here).

Lightsail vps instances appear to use different default userids, depending on the OS. For example, for an Ubuntu Lightsail instance the default ssh userid is ‘ubuntu’:

ssh -i path-to-your-ssh-pen-file ubuntu@your-instance-ip

ssh into a running EC2 instance being used for an AWS Beanstalk deployment

The EB cli provides an ‘eb ssh env-name’ command to provide ssh access into a running EC2 instance. If the environment wasn’t setup to enable ssh, you’ll see this:

> eb ssh test
ERROR: This environment is not set up for SSH. Use "eb ssh --setup" to set up SSH for the environment.

After running ‘eb ssh –setup’ you’ll be prompted to confirm the environment name, and then select a previously configured SSH keypair to use to provide auth when logging on to the instance.

If an EC2 instance is already running in the env, this setup step configures new EC2 instances to enable ssh, and then conducts a rolling update to take down any previously started EC2 instances and replace them with new instances.

Deploying a Docker container to AWS Elastic Beanstalk

In my previous post, I looked at using the EB cli to deploy a Spring Boot app to Beanstalk. If you have an app that you have packaged in a Docker container, you can prepare this for deployment to Beanstalk using the EB cli command:

$ eb init -p docker application-name

This is described in the docs here.

This command inits the app for deployment, creating a default .elasticbeanstalk/config.yml file that looks like this:

branch-defaults:
default:
environment: null
group_suffix: null
global:
application_name: beanstalk-docker-with-mounted-volume
branch: null
default_ec2_keyname: null
default_platform: Docker
default_region: us-west-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: null
repository: null
sc: null
workspace_type: Application

Next create a Beanstalk environment for deploying your app:

$ eb create environment-name

This will take a few minutes on your first deploy as it provisions everything required for running your app on Beanstalk, including an Auto Scaling Group and an EC2 instance.