Launching an Amazon EC2 (Elastic Compute Cloud) instance is a straightforward process. Here are the steps to launch an EC2 instance:
Sign in to the AWS Management Console:
If you do not have an AWS account, go here https://aws.amazon.com/ and create one. If you have an account, log in.
Make Sure Your Have Run The CloudFormation Template First!
Before continuing with EC2, make sure you have completed the Step-by-Step Guide to running Airbridge CloudFormation Template in AWS. The CloudFormation automates resource and security configurations in your AWS Account. Make sure you have run that step before proceeding.
Open the Amazon EC2 Dashboard:
Navigate to the "Services" menu and choose "EC2."
Launch Instance:
Click the "Launch Instance" button.
Choose an Amazon Machine Image (AMI):
Set a name for your instance. Something like
airbridge
AMIs are the templates that define the software configuration of your instance (like the OS, application server, etc.). AWS provides several AMIs, select the
Amazon Linux
AMI.Select the "Architecture".
ARM
orx86
is viable. However, ARM may be slightly less expensive. Airbridge is compatible with either.
Select Instance type
Next, select your instance type. Airbridge is efficient, and can work with minimal resources. For many use cases, an instance with at least 1 GiB of ram will be sufficient. However, if you are performing significant, intensive data operations, you may need to select an instance type with more CPU and Ram. You can always change this instance type later if the need arises.
Creating (or Selecting) SSH Key Pairs.
We suggest creating a new SSH keypair for the Airbridge instance.
Click the “Create Key Pair” button.
In the resulting dialog box, give your key pair a name (e.g.,
MyEC2KeyPair
).Choose the key pair format. We suggest choosing
pem
. This is the traditional format that's compatible with many SSH clients.
Never share your private key. Anyone with access to this key can connect to your EC2 instances associated with the key pair.
If you suspect that your private key has been compromised, you should delete the associated key pair from AWS and create a new one. Remember to also update any EC2 instances to use a new, uncompromised key pair.
Configure Security Group
Security groups act as virtual firewalls to control inbound and outbound traffic.
You can create a new security group or select an existing one.
Ensure that you allow SSH (port 22) if you plan to connect to the instance.
Add Storage
By default, your EC2 instance will have a root volume. We suggest 30 GiB
of storage. However, depending on your use case, you may need more. Airbridge does not persist data to disk for long, so this storage is temporary work space. You can modify the size of the root volume upward as needed.
Select Instance Profile
When you ran the CloudFormation template, a Instance Profile was created for you. Select that Instance Profile in the dropdown menu. For example, the name may be AirbridgeInstanceProfle
.
An instance profile is an IAM (Identity and Access Management) entity in AWS that contains a role to be used with EC2 instances, allowing applications running on the instance to make AWS API requests. Instance profiles are a way to grant permissions to the operations that the application running on the instance requires.
Installing Airbridge via User Data
In AWS, when you launch an EC2 instance, you have the option to include "user data." User data is a feature that allows you to run scripts or configurations at launch time. This will bootstrap your instance with the Airbridge software, OS updates, and AWS tools.
There is one critical input variable needed in this step. It is the name of the S3 Bucket that was generated during when running the CloudFormation template. Before executing the script, an environment variable S3BUCKET
must be set you to your actual Airbridge S3 Bucket name. You can see the reference to this S3 Bucket in the the script command like this S3BUCKET="airbridge-my-unique-name"
:
https://raw.githubusercontent.com/openbridge/airbridge/dev/aws/ec2/airbridge_init.sh | S3BUCKET="airbridge-my-unique-name" sh -
You will need to replace S3BUCKET=airbridge-my-unique-name
with the actual bucket name that was created in the CloudFormation process. This is critical, as this is the location where all of your Airbridge configuration, jobs, and outputs are stored.
Paste This Command Into "User Data"
Below is the command you would use. The only change is using your actual bucket name:
#!/bin/bash
curl -sSL https://raw.githubusercontent.com/openbridge/airbridge/dev/aws/ec2/airbridge_init.sh | S3BUCKET="airbridge-my-unique-name" sh -
It will look like this:
What is in the airbridge_init.sh script? The bootstrap init script is publicly available, so you can see exactly what it is doing when setting up your environment.
Help! I'm not sure the airbridge_init.sh has run.
If the user data script doesn't seem to be working, inside your running instance you can check logs for details. For cloud-init
, logs are typically in /var/log/cloud-init.log
and /var/log/cloud-init-output.log
.
You can always attempt to rerun the script in your EC@ instance terminal:
curl -sSL https://raw.githubusercontent.com/openbridge/airbridge/dev/aws/ec2/airbridge_init.sh | S3BUCKET="airbridge-my-unique-name" sh -
Remember to replace you actual bucket name in the command: S3BUCKET="airbridge-my-unique-name
"
Launch!
One the configuration is completed, you are ready to Launch your Airbridge instance! That is it!