Skip to content

Commit a73ae04

Browse files
pgray-hiroCharlieC3
authored andcommitted
Reworked EC2 tutorial, cleaned up admin article, and updated overview for storage hubs
1 parent d7c976e commit a73ae04

18 files changed

+201
-118
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# OS or Editor folders
22
.DS_Store
33
node_modules
4+
.vscode
45

56
# Jekyllg
67
_site
20.2 KB
Loading
28.9 KB
Loading
69.8 KB
Loading
19.5 KB
Loading
21.9 KB
Loading
107 KB
Loading
22.1 KB
Loading
Loading
25.6 KB
Loading
8.34 KB
Loading
49.3 KB
Loading

public/images/ec2-instances.png

365 KB
Loading

public/images/freenom-my-domains.png

37.5 KB
Loading

src/common/navigation.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ sections:
9898
- path: /storage-hubs
9999
pages:
100100
- path: /overview
101-
- path: /gaia-admin
102101
sections:
103102
- title: Tutorials
104103
usePageTitles: true
+142-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,154 @@
11
---
2-
title: Deploy on Amazon EC2
2+
title: Deploying Gaia Hub on Amazon EC2
33
description: Use a template to deploy a Gaia hub on Amazon EC2
44
---
55

66
## Introduction
77

88
The template provided on this page provides an easy way to deploy a Gaia hub directly to Amazon EC2. You can use this
9-
template to deploy your own Gaia hub to your Amazon Web Services account. Amazon EC2 is an affordable and convenient
10-
cloud computing provider. This template uses Amazon EC2 instance together with an S3 provider for file storage.
9+
template to deploy your own Gaia hub to your Amazon Web Services (AWS) account. Amazon EC2 is an affordable and
10+
convenient cloud computing provider. The template provides a one-click deploy for Amazon EC2 with an S3 provider for
11+
file storage.
1112

12-
## Template
13+
## Prerequisites
14+
15+
This procedure uses Amazon CloudFormation to configure an EC2 cloud compute provider to run the Gaia hub service with
16+
an S3 provider for file storage. You should have access to an AWS account either through your personal account or
17+
through a corporate account. This account should have permissions to create resources.
18+
19+
Additionally, you must also own a domain name and be able to update the DNS records associated with that domain name.
20+
The procedure on this page uses a free domain created on [freenom][], generically the procedure used
21+
is similar on other domain name providers.
22+
23+
## Launching the template
24+
25+
Use a link in the table to launch the CloudFormation template in the AWS region that you wish to deploy a Gaia hub.
1326

1427
| Template name | Description | Launch |
1528
| ------------------------ | ------------------------------------------------------------- | -------------------------------------------------------------------- |
16-
| Gaia Hub EC2 (us-west-2) | Deploys a Gaia hub service on EC2 with an S3 storage provider | [![](/images/cloudformation-launch-stack-button.png)][ec2-us-west-2] |
29+
| Gaia Hub EC2 (us-east-1) | Deploys a Gaia hub service on EC2 with an S3 storage provider | [![](/images/cloudformation-launch-stack-button.png)][ec2-us-east-1] |
30+
31+
## Task 1: Configure the CloudFormation template
32+
33+
Before launching your Gaia hub, you must configure the template with the appropriate values for your hub and the domain
34+
it runs on.
35+
36+
1. Launch the template using the **Launch stack** button in the preceding table.
37+
2. Review the **Prepare template** and **Template source** fields to ensure that they are populated.
38+
39+
![CloudFormation specify template](/images/cloudformation-specify-template.png)
40+
41+
3. Click **Next**.
42+
4. Specify configuration details for your Gaia hub:
43+
44+
i. Enter the **Stack name**. This name must be unique within your AWS account.
45+
46+
![CloudFormation stack name](/images/cloudformation-stack-name.png)
47+
48+
ii. Enter the domain name on which the hub should run in the **DomainName** field. You must own this domain name and
49+
be able to update the DNS records associated with it.
50+
51+
![CloudFormation domain name](/images/cloudformation-domain-name.png)
52+
53+
iii. Enter an email address associated with the Gaia hub in the **EmailAddress** field. This should be a valid email
54+
that you have access to.
55+
56+
![CloudFormation email](/images/cloudformation-email.png)
57+
58+
iv. Enter the name of the S3 bucket to create for data storage in the **GaiaBucketName** field. The name will be
59+
combined with the stack name to create a unique S3 bucket.
60+
61+
![CloudFormation bucket name](/images/cloudformation-bucket.png)
62+
63+
v. Select an available **InstanceType** from the drop-down. The default value is `t2.micro`.
64+
65+
vi. In the **KeyName** drop-down, select an [EC2 KeyPair](https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#KeyPairs:)
66+
to enable SSH access to the EC2 instance. You should download the `.pem` keyfile for this pair from the EC2 console.
67+
68+
For more information see the [EC2 key pair documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#prepare-key-pair).
69+
70+
![CloudFormation key name](/images/cloudformation-keyname.png)
71+
72+
vii. Leave the **SSHLocation** field with the default value of `0.0.0.0/0` to enable SSH access from any IP address.
73+
If you wish to restrict SSH access to the EC2 instance to a certain IP, you can update this field.
74+
75+
viii. Select a subnet and virtual private cluster (VPC) from the **SubnetId** and **VpcId** drop-downs to designate
76+
where to deploy the Gaia hub instance.
77+
78+
![CloudFormation subnet and VPC](/images/cloudformation-subnet.png)
79+
80+
5. Click **Next**.
81+
6. Configure stack options for your Gaia hub:
82+
83+
i. Enter any key-value pairs you wish to include as tags for your Gaia hub. These are optional and display-only, they
84+
have no effect on the behavior of the CloudFormation stack.
85+
86+
ii. Select an IAM role for the Gaia hub. This is optional, if you don't specify am IAM role, the container runs
87+
with the same permissions as your AWS account.
88+
89+
7. Click **Next**.
90+
8. Review the configuration of your Gaia hub, and make any changes necessary.
91+
9. At the bottom of the page, select the checkbox to acknowledge that AWS may create IAM resources with custom names.
92+
93+
![CloudFormation IAM resources](/images/cloudformation-iam-resources.png)
94+
95+
10. Click **Create stack** to launch your Gaia hub. The AWS console displays the summary of the stack.
96+
97+
## Task 2: Retrieve the public IP of your Gaia hub
98+
99+
Your stack can take several minutes to launch. You can monitor the **Events** tab of your hub to review the current
100+
progress of the launch. When the launch is complete, the **Outputs** tab displays information about the hub. Select
101+
the **PublicIP** and copy it to configure your domain name.
102+
103+
![CloudFormation outputs](/images/cloudformation-details.png)
104+
105+
## Task 3: Configure a domain name
106+
107+
Connect your domain to the Gaia hub EC2 instance by creating an `A` record for the domain DNS entry, and enter the
108+
public IP from the previous step. In general, this procedure will be similar depending on your hostname provider.
109+
110+
If you are using a free domain from [freenom], use the following procedure:
111+
112+
1. Log in to your freenom account.
113+
2. Under **Services** > **My Domains**, click **Manage Domain** next to the domain corresponding to your Gaia hub.
114+
115+
![My freenom domains](/images/freenom-my-domains.png)
116+
117+
3. Click **Manage Freenom DNS** in the tab bar.
118+
4. In the **Add Records** table, select `A` from the **Type** drop-down, then paste the public IP of your Gaia hub EC2
119+
instance in the **Target** field.
120+
5. Click **Save Changes** to update the DNS record.
121+
122+
-> It can take up to 15 minutes for your DNS record changes to propagate. In a terminal, use the command
123+
`dig A +short <yourdomain.co>` to check if the changes have propagated. If the output of this command is the container
124+
public IP, the changes were successful.
125+
126+
## Accessing your Gaia hub with SSH
127+
128+
To SSH into your Gaia hub EC2 host directly, you must have the keyfile used in container creation. Access the host with
129+
the following command in your terminal:
130+
131+
```bash
132+
ssh -i <your keyfile.pem> admin@<public_ip_address>
133+
```
134+
135+
## Making changes to your Gaia hub
136+
137+
If you want to make changes to your Gaia hub, there are two options. You can delete the entire CloudFormation stack
138+
using the **Delete** button in the CloudFormation dashboard. Once you have deleted the stack, you can re-create one and
139+
modify your DNS to point at the new public IP.
140+
141+
![CloudFormation delete](/images/cloudformation-delete.png)
142+
143+
To modify the instance in place, navigate to the [EC2 instances console][] and type the instance name into the
144+
**Filter instances** field. Select the instance from the search suggestion, then click the instance to select it.
145+
146+
On the **Tags** tab, you can click **Manage tags** to update the relevant key value pairs for the instance. If you make
147+
changes to these tags, click **Save**, then select **Reboot instance** from the **Instance state** drop-down. Changes
148+
to the tags don't take effect until the instance is rebooted.
149+
150+
![EC2 instances](/images/ec2-instances.png)
17151

18-
[ec2-us-west-2]: https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=Gaia&templateURL=https://cf-templates-18jq0t04gve7c-us-west-2.s3-us-west-2.amazonaws.com/2021124ByT-cf.yaml
152+
[ec2-us-east-1]: https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=Gaia&templateURL=https://cf-templates-18jq0t04gve7c-us-east-1.s3.amazonaws.com/cloudformation.yaml
153+
[freenom]: https://freenom.com
154+
[ec2 instances console]: https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#Instances

0 commit comments

Comments
 (0)