5. Cloudify - Premium with AWS

Cloudify has plugins for connecting to several major cloud service providers. In this tutorial, we will make Cloudify deploy a simple blueprint with the Amazon Web Services (AWS). Under the hood, Cloudify invokes Boto, the AWS Python SDK providing API to interact with AWS services like Lambda functions, RDS and IAM.

In this tutorial, we will use a Docker image of the premium version of the Cloudify Manager to deploy a Hello World server on an AWS EC2 t.micro machine.

Table of Contents:


Prerequisites

Note: This tutorial is tested with Cloudify 5.0.0

Warm Up

  • Open a terminal and start the Docker container with the premium edition of the Cloudify Manager. The first time, this command will download the Docker container. Depending on your bandwidth, this may require a few minutes to complete.
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/premium-cloudify-manager-aio:latest
  • You can connect to the premium version of Cloudify Manager through the browser interface on localhost:80. Default credentials are admin-admin. To activate the premium version of the Cloudify Manager, insert your license.
Login page
License page
Activated License page

AWS Configuration

  • Install the AWS and AWSSDK Cloudify plugins. The plugins contains the definition of AWS nodes:

    1. To install the AWS plugin, go to “Cloudify Catalog” on the left side menu.
    2. Go in the “Plugins Catalog” widget, select the AWS plugin and click the install button on the right side.
    3. To install the AWSSDK plugin, go to “System Resources” on the left side menu.
    4. In the “Plugins” widget, click Upload and upload the wagon and yaml files you find in the Cloudify Github repository.

    Note: AWSSDK is an outdated plugin we use only to run this old example.


  • Create the AWS secrets providing the credentials of your AWS account:

    1. Go to system Resources on the left side menu.
    2. Scroll down to the Secret Store Management widget.
    3. Create the “aws_access_key_id” and “aws_secret_access_key” secrets providing your AWS credentials.


    secrets

Deploy

  • Running the example

    1. Go to “Local Blueprints” menu and click the Upload button.

    2. Insert “https://github.com/cloudify-cosmo/cloudify-hello-world-example/archive/master.zip” in the blueprint URL field.

    3. In the blueprint YAML file select “aws.yaml”.

    4. Click upload.

      Note: you may have to wait for one minute and a half and then see an An unexpected error has occurred: ESOCKETTIMEDOUT error. Unfortunately, this behaviour happens even though the blueprint was successfully uploaded. After the error, wait for another thirty seconds for the new blueprint to appear in the list of all blueprints.

    5. In the blueprints table, click on the name of the blueprint.

    6. Click on the Create Deployment button.

    7. Type the name of the blueprint in the deployment name field.

    8. Type the region (e.g, “eu-central-1") in the aws_region_name field.

    9. Click Deploy.

    10. Scroll down to the deployments table, click the hamburger icon on the right and select Install and then Execute. The install workflow will take a few minutes to complete.

  • Check the website

    1. In the “Deployment Nodes” widget, select the ip node and check for the details. There you should find the public IP address of the webserver.

    ip

    1. Paste the IP address in the browser and check that the server is up and answering with a Hello World page.

    ip

Uninstall

  • Tear down the deployment

    1. Go to the “Deployments” tab.
    2. Click on the hamburger icon and choose Uninstall then Execute. This will take a few minutes to complete
  • To remove the docker with the Cloudify Manager, run

sudo docker rm -f cfy_manager_local

cfy_manager_local

Conclusion

In this tutorial, we used the premium edition of the Cloudify Manager to deploy a simple web server on AWS. In next tutorials, we will start using the premium edition to develop and deploy more complex cloud applications on AWS.

Last modified: 26 December 2019