Code Monkey home page Code Monkey logo

dossiercloudformationruby's Introduction

DossierCloudFormationRuby

The Dossier System is an AWS CloudFormation and AWS Lambda project that publishes Latex documents to Dropbox. The problem that this system solves is:

  1. Neither Latex PDFs or intermediary files are commited to the source repository
  2. The projects are built in a reproducable manner
  3. The Latex PDFs are published to an easily accessible location

(2) is solved by using Docker and (3) is solved by using AWS Lambda to publish the artifacts from building the Latex documents to Dropbox.

The system, pictorially, looks like the following pipeline:

The S3DropboxLambda project is located on GitHub at S3DropboxLambda.

DossierCloudFormationRuby: The CloudFormation Stack

The DossierCloudFormationRuby project deploys the CloudFormation Stack for the Dossier System. This includes the pipelines for both the Latex documentation and S3DropboxLambda deployment. CloudFormation provides a programatic and reproducible approach to generating, connecting, and retiring AWS resources.

Installation

This project has only been tested with Ruby 2.x. Installation is achieved using bundle with the package's Gemfile:

bundle install

Usage

The CloudFormation project is run using Rake tasks. Use the following to print a list of tasks along with a description of each task: rake --tasks. Different commands require task arguments. The following table provides a description of each. The Name is the name of the argument, which is printed in rake --tasks.

Name Description
GitHubConnectionArn The CodeStar GitHub connection ARN. This is used for CodePipeline to connect to the GitHub repo. If this is already set up, you will find the ARN in CodePipeline.
BuildFailurePhoneNum In the event of a build failure, the phone number to send an alert SMS to
StageNum The CloudFormation stack stage, see Multi-Stage CloudFormation Stack Deployment

Multi-Stage CloudFormation Stack Deployment

The CloudFormation stack requires two stages to be deployed. The reason for this because there is a circular dependency between the trigger S3 bucket and the AWS Lambda function:

  • The S3 bucket notification configuration requires the AWS Lambda Function ARN
  • The AWS Lambda function requires the S3 bucket's ARN to grant the bucket permission to invoke it

The stages are deployed via (the third argument is the stage number):

# run on CLI
rake dossier:deploy_stage'[GITHUB_CONNECTION,PHONE_NUM,0]'
rake dossier:deploy_stage'[GITHUB_CONNECTION,PHONE_NUM,1]'

Project Structure

Folder Description
bin Contains the create-dossier-cf-template.rb, which should not be invoked directly; use the rake tasks
lib Library files used by the create-dossier-cf-template.rb script
rakelib Library files used by the Rakefile
sharelib Library files used as a contract between the Rakefile and the create-dossier-cf-template.rb script

dossiercloudformationruby's People

Contributors

errorsandglitches avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.