0

Can you have a CICD pipeline using AWS codepipeline for a nodejs app without using any EC2 instance for codebuild?

You would just have a code repo -> codebuild -> buildspec file -> Deploy to staging (S3) ?

My question is NOT about deploying a lambda function serverlessly but instead, building and deploying a nodejs app without provisioning any spot instances (Ec2), is that doable?

One benefit of this serverless approach to building our nodejs app is:

  1. Faster developer feedback if tests fail
  2. No long startup times since an EC2 can have a variable startup time of 1 - 3mins

Has anyone achieved this kinda serverless pipeline for building a nodejs app, again NOT building a lambda function but rather building a nodejs app.

pelican
  • 5,846
  • 9
  • 43
  • 67
  • I don't understand - you can't deploy Node.js app to S3. Maybe you just want to build app and upload built artifacts to S3? – Michał Z. Apr 11 '18 at 18:42
  • Sorry on wrong language use there; yes, I would like to just build the app and upload the artifacts to S3 WITHOUT PROVISIONING ANY EC2 machines – pelican Apr 11 '18 at 18:48

1 Answers1

0

If you want to upload build artifacts to S3 - there are 2 ways to achieve that using CodePipeline:

  1. Add step with Invoke Lambda

    or (and I think easier):

  2. Upload built app files to S3 from CodeBuild

For 2nd case you can just add command like this to your buildspec.yml:

aws s3 sync --delete <PATH TO BUILT APP FILES> s3://<DESTINATION BUCKET NAME>

That will replace whole bucket content with your built app files.

Community
  • 1
  • 1
Michał Z.
  • 1,322
  • 1
  • 10
  • 17