Hello World Walkthrough on AWS

Hello World Walkthrough on AWS

You are here:
< Back

About this tutorial

This tutorial will walk you through deploying your first blueprint, a python webserver that says “Hello World” with a Cloudify logo, on Amazon Web Services (AWS).

Install Cloudify Manager and Upload Plugins

1. Spin up a Cloudify Manager on your local machine. This requires Docker to be installed as well. Copy and paste the below into your terminal and wait for that to finish:

sudo docker run --name cfy_manager_local -d --restart unless-stopped -v /sys/fs/cgroup:/sys/fs/cgroup:ro --tmpfs /run --tmpfs /run/lock --security-opt seccomp:unconfined --cap-add SYS_ADMIN -p 80:80 -p 8000:8000 cloudifyplatform/community:18.10.4

2. SSH into the Docker machine with

docker exec -it cfy_manager_local /bin/bash

3. Install the plugins bundle (this installs 11 plugins, not all of which are necessary for this example). Copy and paste the below into your terminal:

cfy plugins bundle-upload

Create secrets

Secrets are a more secure way to pass inputs such as passwords and keys for your deployments. You can create secrets using the terminal or from Cloudify Console (the UI) – both options are presented below.

Option 1: Using the Terminal

*Replace “[value]” with the actual value for the secret.

cfy secrets create aws_access_key_id --secret-string [value]
cfy secrets create aws_secret_access_key --secret-string [value]

Option 2: Using Cloudify Console (UI)

1. Open your browser to 127.0.0.1 and login with username admin and password admin

2. Click on “System Resources” from the side menu

3. Click the “Create” button in the Secret Store Management widget

4. Add the key and value for each secret individually (using the list above in Option 1), then click “Create”

Deploying the application

Now let’s deploy our application. We will offer both a terminal as well as UI option.

Option 1: Using the Terminal

The below command will deploy the Hello World application on your cloud of choice.

*Replace information inside [] with actual values, without the []

cfy install https://github.com/cloudify-cosmo/cloudify-hello-world-example/archive/master.zip -n aws.yaml -b hello-world-aws -i aws_region_name=[YOUR REGION]

Next, run

cfy deployment outputs [DEPLOYMENT ID]

The Deployment ID will be “hello-world-aws” or similar and the output will look like this:

cfy deployment outputs hello-world-aws
Retrieving outputs for deployment hello-world-aws...
 - "application_endpoint":
     Description: The external endpoint of the application.
     Value: http://IP_ADDRESS_OF_APP:80

Find the “Value” and enter that IP address into your browser and if you see the below image, you did it!

To tear down the deployment, simply run the command below and the application, as well as blueprint, will be deleted.

cfy uninstall [DEPLOYMENT ID]

Option 2: Using Cloudify Console (UI)

1. In the Cloudify UI, navigate to Local Blueprints select Upload.

2. Right-click and copy this link. Paste the URL where it says Blueprint package. Provide a name, such as hello-world-aws, in the field labeled Blueprint name. Select the aws.yaml blueprint from the Blueprint YAML file dropdown and click Upload.

3. After the new blueprint has been created, click the button and enter your Deployment name such as hello-world-aws and any other required inputs. Then click, the Deploy button.

4. Navigate to the Deployments page, find your new deployment, select Install from the menu and then Execute.

5. You can click on the deployment name to see the logs. Once the operation is complete, you will see the following in the logs:

6. Above the logs you will find the Deployment Outputs widget with the IP address of your application. Paste that address into your browser and if you see the below image, you did it!

7. To tear down the deployment, go back to the Deployments page, click on the and choose Uninstall from the menu, then click Execute. When the uninstall workflow is complete, you can also remove the deployment by choosing Delete option from that same menu and clicking Execute.

Last Updated On October 19, 2018