robertstettner / drone-cloudformation

Drone plugin for creating/updating or deleting AWS CloudFormation stacks and validating AWS CloudFormation templates.
MIT License
5 stars 7 forks source link
cloudformation drone-ci plugins

drone-cloudformation

Build Status Coverage Status

Drone plugin for creating/updating or deleting AWS CloudFormation stacks and validating AWS CloudFormation templates.

Configuration

The following parameters are used to configure the plugin:

Modes

There are four modes that the Drone plugin can be run with:

Drone configuration example

Deployment example below:

pipeline:
  ...
  deploy:
    image: robertstettner/drone-cloudformation
    pull: true
    stackname: my-awesome-stack-${DRONE_BRANCH}
    template: templates/stack.yml
    params:
      Version: ${DRONE_BUILD_NUMBER}
      Environment: ${DRONE_DEPLOY_TO}
    when:
      event: deployment

Deployment example with secrets:

pipeline:
  ...
  deploy:
    image: robertstettner/drone-cloudformation
    pull: true
    stackname: my-awesome-stack-${DRONE_BRANCH}
    template: templates/stack.yml
    secret_params:
      - source: DB_PASSWORD
        target: DbPassword
    params:
      Version: ${DRONE_BUILD_NUMBER}
      Environment: ${DRONE_DEPLOY_TO}
    secrets: [DB_PASSWORD]
    when:
      event: deployment

Deployment example with template file in S3 below:

pipeline:
  ...
  deploy:
    image: robertstettner/drone-cloudformation
    pull: true
    stackname: my-awesome-stack-${DRONE_BRANCH}
    template: s3://mybucket/template.yml
    params:
      Version: ${DRONE_BUILD_NUMBER}
      Environment: ${DRONE_DEPLOY_TO}
    when:
      event: deployment

Deployment of multiple stacks example below:

pipeline:
  ...
  deploy:
    image: robertstettner/drone-cloudformation
    pull: true
    batch:
      - stackname: my-database-stack-${DRONE_BRANCH}
        template: templates/db.yml
        params:
          Environment: ${DRONE_DEPLOY_TO}
      - stackname: my-app-stack-${DRONE_BRANCH}
        template: templates/app.yml
        params:
          Version: ${DRONE_BUILD_NUMBER}
          Environment: ${DRONE_DEPLOY_TO}
    when:
      event: deployment

Template validation example below:

pipeline:
  ...
  validate-template:
    image: robertstettner/drone-cloudformation
    pull: true
    mode: validate
    template: templates/stack.yml

Parallel template validation example below:

pipeline:
  ...
  validate-template:
    image: robertstettner/drone-cloudformation
    pull: true
    parallel: true
    batch:
      - mode: validate
        template: templates/db.yml
      - mode: validate
        template: templates/app.yml

Further reading