Skip to content

Latest commit

 

History

History
88 lines (55 loc) · 8.7 KB

amazon-ec2.md

File metadata and controls

88 lines (55 loc) · 8.7 KB

Amazon EC2

Introduction

The template provided on this page provides an easy way to deploy a Gaia hub directly to Amazon EC2. You can use this template to deploy your own Gaia hub to your Amazon Web Services (AWS) account. Amazon EC2 is an affordable and convenient cloud computing provider. The template provides a one-click deploy for Amazon EC2 with either S3 or EBS as a storage provider.

Prerequisites

This procedure uses Amazon CloudFormation to configure an EC2 cloud compute provider to run the Gaia hub service with an S3 or EBS provider for file storage. You should have access to an AWS account either through your personal account or through a corporate account. This account should have permissions to create resources.

Additionally, you must also own a domain name and be able to update the DNS records associated with that domain name.

Setup steps

Step 1 - Create Stack

Use a link in the table to launch the CloudFormation template in the AWS region that you wish to deploy a Gaia hub.

Step 2 - Setup stack using template

You need to configure the template with the appropriate values for your hub and domain it runs on.

Select Template is ready and Amazon S3 URL and enter the following Amazon S3 URL:

https://s3-external-1.amazonaws.com/cf-templates-vzldibfi2mw8-us-east-1/2022160J6G-cloudformation.yaml

If you prefer you can instead select Template is ready and Upload a template file to upload the template file cloudformation.yaml.

The latest cloudformation.yaml file can be downloaded here. On most browsers you can right-click on that page and click on Save page as to download the file. Alternatively, you can copy/paste the text into a text file called cloudformation.yaml.

Then click Next.

Step 3 - Specify stack details

Specify the stack details and then click Next:

Field Value Notes
Stack name a unique name in your AWS account e.g.: my_gaia_hub
DomainName your-domain
EmailAddress your email address
GaiaBucketName S3 bucket name The template combines this name with the stack name to create a unique S3 bucket. The template ignores this field if GaiaStorageType is set to disk.
GaiaStorageType s3 or disk Select the GaiaStorageType of which to use as a backend for the Gaia Hub. Selecting s3 causes the template to create an S3 bucket based on the name given in the previous field. Selecting disk causes the template to attach a separate EBS volume to the EC2 instance for Hub storage.
InstanceType t2.micro Select the instance type you want. Default value is t2.micro.
KeyName In the KeyName drop-down, select an EC2 KeyPair to enable SSH access to the EC2 instance. You should download the .pem keyfile for this pair from the EC2 console. For more information see the EC2 key pair documentation
SSHLocation 0.0.0.0/0 Leave the SSHLocation field with the default value of 0.0.0.0/0 to enable SSH access from any IP address. If you wish to restrict SSH access to the EC2 instance to a certain IP, you can update this field.
SubnetId subnetid Select a public subnet
VpcId vpcid

Step 4 - Configure stack options

Configure any stack options that fit your desired setup and click Next. All these fields are optional.

Step 5 - Review

Review the configuration of your Gaia hub, select the checkbox to acknowledge that AWS may create IAM resources with custom names and click on Create stack.

Step 6 - Retrieve the public IP of your Gaia hub

Your stack can take several minutes to launch. You can monitor the Events tab of your hub to review the current progress of the launch. When the launch is complete, the Outputs tab displays information about the hub. Select the PublicIP and copy it to configure your domain name.

Create an A DNS record pointing to the given IP in your domain.

Wait a few minutes for the DNS record to propagate, and your should be able to access your Gaia hub with SSH.

Accessing your Gaia hub with SSH

To SSH into your Gaia hub EC2 host directly, you must have the keyfile used in container creation. Access the host with the following command in your terminal:

ssh -i <your keyfile.pem> admin@<public_ip_address>

:::tip If you can only access SSH with the IP but not with the DNS name and you wish to do so, you can optionally activate it by following these steps:

Open your [AWS Console](https://console.aws.amazon.com)
Click on `Service` -> VPC
Open Your VPCs
Select your VPC connected to your Gaia Hub
Click `Actions` -> `Edit DNS Hostnames` -> Change `DNS hostnames` to `Enable`

:::

Graphical representation of the cloudformation template