Automate infrastructure provisioning with AWS CloudFormation and Buddy

June 6, 2019

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 examplePipeline example

Configuring AWS CloudFormation

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

AWS actionsAWS 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 integrationAdding 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 confirgurationCloudFormation 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 commandsDefault 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!

Share:

Alexander Kus

Alexander Kus

Customer Success Manager

A story-teller and conversation-lover, Alexander decided to invest his skills to help his friends at Buddy transform the cold language of patch notes into exciting narratives. Also: an avid gamer, hip-hop DJ, Liverpool FC fan, absentminded husband, and the father of two.