CloudFormation is AWS service used to describe infrastructure elements as a code (a set of yaml or json configuration files). This allows for automated and repeatable provisioning process of the BigBlueButton server to an EC2 instance.
In this step we will use CloudFormation templates from big-blue-button-cloudformation-cfhl repository to create the required infrastructure to run the software using Amazon Web Services platform.
Before proceeding further, make sure that you are logged in to the AWS Web Console
Choose your closest region below, and click on appropriate link to initiate CloudFormation stack.
Region | Region name | Launch url |
---|---|---|
ap-southeast-2 |
Asia Pacific (Sydney) | |
us-east-1 |
US East (N. Virginia) | |
eu-central-1 |
EU (Frankfurt) | |
us-west-2 |
US West (Oregon) | |
ca-central-1 |
Canada (Central) |
If you can't find your desired region below, you can check templates origin page
You will be taken to a page to input desired parameters to your CloudFormation stack, where you'll use your hosted zone created in previous stack, as in the screenshot below:
You can leave most of the default values untouched - you'll need to supply values for following:
-
AdminEmail - used for SSL certificate domain verification, as well as default login to big blue button web portal (Greenlight)
-
DomainName - zoneName generated for you in previous step. If you are using your own domain/Route53 zone, you probably want to set this to something like
online.example.com
-
Route53Zone - same like previous parameter. If you are using your own zone, should be like
example.com
If you followed through the step1, just same the full zone nameworkshop-XXXX.programming-tools-meetup.cloud
you obtained in previous step. -
TerminationProtection - set this to False, for easier cleanup of resources after the workshop.
Click 'Next' buttons, until you reach checkboxes I acknowledge that AWS CloudFormation might create IAM resources with custom names and I acknowledge that AWS CloudFormation might require the following capability: CAPABILITY_AUTO_EXPAND
Check them to give permissions to CloudFormation service to create IAM (Identity Access Management) resources on your behalf.
Clicking "Create Stack" button will initiate infrastructure provisioning process on AWS infrastructure for you.
Shortly after stack creation has started you should be able to see EC2 instance (virtual server in simpler terms) in your EC2 Web Console
Wait until you can see the server is up and running - InstanceState column should show running like on the page below:
Once the server is running, you can use script below to
- discover instance id programmatically through the use of Aws Cli
- Log in to your instance secure shell using AWS SSM service
#!/bin/bash
# use aws cli to obtain instanceid i-xxxxx
instance_id=$(aws ec2 describe-instances --filters \
"Name=instance-state-name,Values=running" \
"Name=tag:Name,Values=BigBlueButton-Server" \
--query 'Reservations[].Instances[].InstanceId' --output text)
echo "Connecting to $instance_id"
aws ssm start-session --target "${instance_id}"
Note - If this command gets stuck, retry in new terminal window. As there are changes to the network configuration during the instance boot procedure, there is slight window where SSM may connect initially, but not respond.
Once you have logged into the server, you can tail the server setup log, by executing following command
$ tail -f /var/log/cloud-init-output.log
Depending in which state the server setup is currently, you may see different output, but the message marking end of the boot and installation sequence should look like below. Server configuration should be complete within 10-20 minutes of clicking the 'create stack' button.
Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~16.04.1 running 'modules:final' at Wed, 13 May 2020 02:20:32 +0000. Up 57.33 seconds.
ci-info: no authorized SSH keys fingerprints found for user ubuntu.
Cloud-init v. 19.4-33-gbb4131a2-0ubuntu1~16.04.1 finished at Wed, 13 May 2020 02:32:33 +0000. Datasource DataSourceEc2Local. Up 778.35 seconds
As a final step, you'll need credentials to login to your Web user interface. As the server configuration stores the values for default user, password, as well as login url - you can execute script below in your bash shell to obtain these parameters
CONFIG_PATH=/bigbluebutton/config
BBBPASS=$(aws ssm get-parameter --name ${CONFIG_PATH}/admin_password --query Parameter.Value --output text --with-decryption)
BBBUSER=$(aws ssm get-parameter --name ${CONFIG_PATH}/admin_user --query Parameter.Value --output text)
BBBSERVER=$(aws ssm get-parameter --name ${CONFIG_PATH}/server_url --query Parameter.Value --output text)
echo "Login with ${BBBUSER}:${BBBPASS} at ${BBBSERVER}/b/signin"
Output should look somewhat like
Login with admin@programming-tools-meetup.cloud:XXXXXXXXX at https://workshop-XXXXX.programming-tools-meetup.cloud/b/signin
Copy and paste https url into your browser to be greeted with Greenlight (BBB UI) Login page, where you can input username:password credentials obtained in previous command
Go to Step3 - Configure BigBlueButton using the command line