A Single instance Open edX Server in AWS.
The VM will be deployed in a public subnet of your default VPC.
- Register for Ubuntu 20.04 offical image on AWS Marketplace
- Install Pulumi
- Configure Pulumi for AWS
- Configure Pulumi for Python
- Create a virtualenv
- pip install -r requirements.txt
First, create a stack, using pulumi stack init
.
$ pulumi stack init dev
Next, generate an OpenSSH keypair for use with your server - as per the AWS Requirements
$ ssh-keygen -t rsa -f rsa -b 4096 -m PEM
This will output two files, rsa
and rsa.pub
, in the current directory. Be sure not to commit these files!
We then need to configure our stack so that the public key is used by our EC2 instance, and the private key used for subsequent SCP and SSH steps that will configure our server after it is stood up.
$ cat rsa.pub | pulumi config set publicKey --
$ cat rsa | pulumi config set privateKey --secret --
If your key is protected by a passphrase, add that too:
$ pulumi config set privateKeyPassphrase --secret [yourPassphraseHere]
Notice that we've used --secret
for both privateKey
and privateKeyPassphrase
. This ensures their are
stored in encrypted form in the Pulumi secrets system.
Also set your desired AWS region:
$ pulumi config set aws:region eu-west-2
From there, you can run pulumi up
and all resources will be provisioned and configured.
The installation script for Open edX can take up to 2 hours. In the meantime you can still connect to your instance.
To view the host name and IP address of the instance via pulumi stack output
Current stack outputs (2):
OUTPUT VALUE
public_dns your-instance-dns-name
public_ip your-instance-ip-address
You can use the ssh key to connect to your instance:
$ ssh -i rsa ubuntu@$(pulumi stack output public_ip)
If you are using Windows Subsystem for Linux (WSL) you will need to:
- Copy the private into .pem:
cp rsa rsa.pem
- Change permissions on
rsa.pem
.
To clean up resources, run pulumi destroy and answer the confirmation question at the prompt.