Giter Club home page Giter Club logo

serverless-cloudformation-changesets's Introduction

serverless-cloudformation-changesets

serverless

Serverless framework plugin to create CloudFormation ChangeSets.

Installation

Install the plugin from npm

$ npm install --save serverless-cloudformation-changesets

Add the plugin to your serverless.yml file:

plugins:
  - serverless-cloudformation-changesets

Usage

CLI options

Add --changeset option to the sls deployment command, e.g.:

$ sls deploy --changeset --stage dev --region us-east-1

--changeset by default uses a timestamp for ChangeSet name, otherwise you can provide optional --changeset value:

$ sls deploy --changeset your-changeset-name --stage dev --region us-east-1

YAML settings

custom:
  cf-changesets:
    changeSetName: whatever # optional
    requireChangeSet: boolean # optional defaults to false

requireChangeSet - if true, ChangeSets will be created without providing --changeset option to the sls deploy command.

Notice

If CloudFormation Stack doesn't exist and custom provider.deploymentBucket was specified, this plugin will create a new stack without template, resources. The stack will be in the REVIEW_IN_PROGRESS state.

serverless-cloudformation-changesets's People

Contributors

awarzon avatar hauboldj avatar modmac avatar shortjared 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

Watchers

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

serverless-cloudformation-changesets's Issues

feature suggestion: option to create a deployment IAM user

Great plugin... I find myself using it in nearly all of my sls projects now.

One thing I frequently do when using this plugin is to create an IAM user in the Resources section of my serverless.yml that has the minimally required permissions in order to run sls deploys in a CI/CD environment that strictly create a change set. This makes it easy then to create API keys for that user and have CI/CD use those creds to deploy cfn changesets automatically.

Would having an optional flag/config in this plugin that would automatically add that user and permissions to the cloudformation template make sense? This would remove having to copy/paste the same IAM user/permissions around, and this plugin can have a nice way of asserting the permissions it needs to create the changesets.

If this doesnt feel too niche or specific / out-of-scope, then I could start a PR.

One line change creates a full changeset

Not sure if this is an issue from serverless or this plugin but a one line change in a function shouldn't create a changeset with all resources and all functions.

Plugin does not handle situation when there is no change

It would be good if you check in s3 first if the object exists.

> sls deploy --changeset --stage dev

Serverless: Packaging service...
Serverless: Service files not changed. Skipping deployment...
Serverless: Creating CloudFormation ChangeSet [...]...

  Serverless Error ---------------------------------------

  S3 error: Unable to get the object https://s3.amazonaws.com/...

Is similar to cloudformation changeset

Hi, I have a question, with this plug in can I do something like this,

aws cloudformation create-change-set
    --stack-name TargetStack --change-set-name ImportChangeSet
    --change-set-type IMPORT
    --resources-to-import "[{\"ResourceType\":\"AWS::DynamoDB::Table\",\"LogicalResourceId\":\"GamesTable\",\"ResourceIdentifier\":{\"TableName\":\"Games\"}}]"
    --template-body file://templateToImport.json

Or this work different from that cloudformation command?

What I'm trying to do is to split a couple of resources from a serverless stack and put them into a new stack but without deleting the current resource.

dependency vulnerabilities

Looks like there are some dependencies vulnerabilities. Is there any approach that i can take to fix them. Wondering if there is any plan for fix.

└─┬ [email protected]
└─┬ [email protected]
└─┬ @serverless/[email protected]
└─┬ @serverless/[email protected]
└── [email protected]

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Server-Side Request Forgery │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.21.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ serverless-cloudformation-changesets [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ serverless-cloudformation-changesets > serverless > │
│ │ @serverless/components > @serverless/platform-client > axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1594
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Server-Side Request Forgery │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.21.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ serverless-cloudformation-changesets [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ serverless-cloudformation-changesets > serverless > │
│ │ @serverless/enterprise-plugin > @serverless/platform-client │
│ │ > axios │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1594
└───────────────┴──────────────────────────────────────────────────────────────┘

Serverless itself is a dependency?

Looking at my node_modules tree, and package.json of serverless-cloudformation-changesets, I noticed that serverless is a (non-dev) dependency. I think this was probably intended to be a peer-dependency? It seems it is needlessly injecting serverless framework as a subdependency in my node_modules tree, when I already have one.

See also output from npm ls serverless:

$ npm ls serverless
[email protected] /Users/ronkorving/Projects/myproject
├── [email protected]
└─┬ [email protected]
  └── [email protected]

Missing required key 'Value' in params.Tags[0]

Hi, I'm trying to run the serverless deploy command without any flag and getting this error:
Missing required key 'Value' in params.Tags[0]
with the following custom block:

custom:
  inputBucket: input-bucket-111223344 # Change to unique name
  outputBucket: output-bucket-bucket26111990 # Change to unique name
  cf-changesets:
    requireChangeSet: true # optional defaults to false

After a short look in the plugin code I found the following variable:

  let stackTags = {
    STAGE: plugin.options.stage
  }

looks like it is required to be sent from the CLI argument for stage

in my case, I'm using yaml file definitions, (for stage too).
how can I deal with it?

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.