Giter Site home page Giter Site logo

aws-samples / cookiecutter-aws-sam-pipeline Goto Github PK

View Code? Open in Web Editor NEW
110.0 19.0 48.0 656 KB

This project is a a cookiecutter template to create a generic CI/CD pipeline for Serverless App based on Serverless Application Model (SAM).

License: MIT No Attribution

Python 97.95% Makefile 2.05%

cookiecutter-aws-sam-pipeline's Introduction

Cookiecutter Pipeline for SAM based Serverless App

Important

This project is now deprecated. We recommend you use AWS SAM CLI Pipeline feature instead.

A cookiecutter template to create a generic 3-environment Pipeline for your Serverless App based on Serverless Application Model (SAM).

SAM Generic CI/CD Pipeline

Requirements

Usage

Generate a Pipeline template to your current project directory: sam init --location gh:aws-samples/cookiecutter-aws-sam-pipeline

After generated you should have the following files:

├── Pipeline-Instructions.md <-- Information how to create this Pipeline
├── buildspec.yaml           <-- Sample CodeBuild spec with instructions on how to update it (in case you don't have one)
└── pipeline.yaml            <-- Cloudformation template that will generate this 3-environment pipeline

Credits

License

This project is licensed under the terms of the Open Source BSD-3 License

cookiecutter-aws-sam-pipeline's People

Contributors

dependabot[bot] avatar heitorlessa avatar sliedig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookiecutter-aws-sam-pipeline's Issues

[Feat] Fix and enable Travis

Travis isn't currently working due to permission issues with cookiecutter in their environment.

After some discovery any version above Python 3.4 will fail no matter what we do, so this issue is to:

  • Enable tests for Python 2.7 and 3.4 only
  • Test cookiecutter baking project generation
  • Lint tests against pipeline generated

Picture missing in Pipeline-Instrcutions.md

Pipeline-Instrcutions.md refers to a picture, which is not created when doing sam init.

How to reproduce:

➜ sam init --location gh:aws-samples/cookiecutter-aws-sam-pipeline
[+] Initializing project structure...
project_name [Name of the project]: t
Select source_code_repo:
1 - CodeCommit
2 - Github
Choose from 1, 2 [1]: 2
 [INFO]: Copying buildspec.yaml to current directory...
 [INFO]: Copying pipeline.yaml to current directory...
 [INFO]: Copying Pipeline-Instructions.md to current directory...
 [INFO]: Cleaning up leftovers...
 [SUCCESS]: Project initialized successfully!
[*] Project initialization is now complete

➜ tree
.
├── Pipeline-Instructions.md
├── buildspec.yaml
└── pipeline.yaml

Please describe IAM Policy requirements in the readme

Please describe IAM Policy requirements in the readme.

I enabled the following managed policies:

  • AWSCodeCommitFullAccess
  • AWSLambdaFullAccess
  • IAMFullAccess
  • CloudFrontFullAccess
  • AWSCodePipelineFullAccess
  • AWSCodeBuildAdminAccess

plus the following manually-created policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1449904348000",
      "Effect": "Allow",
      "Action": [
        "cloudformation:CreateStack",
        "cloudformation:CreateChangeSet",
        "cloudformation:ListStacks",
        "cloudformation:UpdateStack",
        "cloudformation:DescribeStacks",
        "cloudformation:DescribeStackResource",
        "cloudformation:DescribeStackEvents",
        "cloudformation:ValidateTemplate",
        "cloudformation:DescribeChangeSet",
        "cloudformation:ExecuteChangeSet",
        "cloudformation:GetTemplateSummary"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

CodeBuild step failing

Trying to use this cookiecutter but the Build step is failing

build:
    commands:
      # Use Build phase to build your artifacts (compile, package, etc.)
      # - echo "[Build phase]"
      # We package the SAM template and create `packaged.yaml` file that will be used in our pipeline for deployment
      ## Here we separate Build from Deployment and segregate permissions for different steps
      - echo "Starting SAM packaging `date` in `pwd`"
      - aws cloudformation package --template-file template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file packaged.yaml
<snip>
[Container] 2018/11/28 04:05:00 Entering phase BUILD
[Container] 2018/11/28 04:05:00 Running command echo "Starting SAM packaging `date` in `pwd`"
Starting SAM packaging Wed Nov 28 04:05:00 UTC 2018 in /codebuild/output/src257800201/src
 [Container] 2018/11/28 04:05:00 Running command aws cloudformation package --template-file template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file packaged.yaml
 Invalid template path template.yaml
 [Container] 2018/11/28 04:05:05 Command did not exit successfully aws cloudformation package --template-file template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file packaged.yaml exit status 255
[Container] 2018/11/28 04:05:05 Phase complete: BUILD Success: false
[Container] 2018/11/28 04:05:05 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: aws cloudformation package --template-file template.yaml --s3-bucket $BUILD_OUTPUT_BUCKET --output-template-file packaged.yaml. Reason: exit status 255
<snip>

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.