6 June 2019

Automate infrastructure provisioning with AWS CloudFormation and Buddy

Automate infrastructure provisioning with AWS CloudFormation and Buddy

AWS CloudFormation allows developers to manage infrastructure resources in Amazon Cloud Services across all regions and accounts with a single text file. The new CloudFormation action in Buddy lets you easily deploy, update and remove CF stacks. For example, you can create a pipeline that will perform the following for every pull request:

  1. Provision infrastructure in your AWS account with a CF template file
  2. Deploy your application to the server
  3. Start the application
  4. Run integration tests
  5. Clean up the CF stack once everything is over
Pipeline example
Pipeline example

Configuring AWS CloudFormation

The action can be found in the AWS section of Buddy’s action roster:

AWS actions
AWS actions

If you haven’t used Amazon actions before, you will be asked for access and secret keys to your AWS account. Make sure the IAM user who is adding the integration is allowed to access the resources that you want to provision with CloudFormation.

Adding an AWS integration
Adding an AWS integration

With the integration added, you can now configure the action details. The most important are:

  • stack name
  • method to run (create / update / deploy / delete)
  • path to the template file (must be uploaded to the repository)
CloudFormation confirguration
CloudFormation confirguration

Once you select the template and proceed, a new view will appear. There you can modify the AWS CLI commands generated by the previous step, add new ones, and fill in any other missing parameters.

Default run commands
Default run commands

From now on, Buddy will automatically provision your AWS infrastructure for integration tests on every pipeline execution. Of course, this is just an example - it is you who decide how and where to use it.

Coming up

In the nearest future we are going to add dedicated integrations for Ansible and Terraform. Stay tuned for more info!