deploy a cloudformation template and wait for every resource to be created

Usage no npm install needed!

<script type="module">
  import cfWaitDeploy from '';


CloudFormation Wait Deploy

npm downloads maintained GitHub issues GitHub license

This node module enables you to deploy a cloudformation template and to wait for every resource to be created.

It returns a promise which resolves when the stack's status indicates all resources are deplyed or indicates a deployment error. In case of error, the promise is rejected.

You can install it via npm using npm install --save-dev cf-wait-deploy

You can also install it globally (see global documentation bellow) via npm npm i -g cf-wait-deploy

This module can be used for automated testing and integration.



function CloudFormationDeploy(cloudformation, verbose = false, refreshRate = 500);
  • cloudformation : an instanciated CloufFormation object from the AWS SDK
  • verbose : boolean to indicate verbose mode (see below)
  • refreshRate : refresh rate in milliseconds for pull CloudFormation events

Usage Example

You can also use await waitDeploy(deployParams)

const AWS = require("aws-sdk");

const CloudFormation = new AWS.CloudFormation({ region: "eu-west-1" });

const waitDeploy = require("cf-wait-deploy")(CloudFormation);
const deployParams = require("./deploy-params.js");

waitDeploy(deployParams).then(() =>
  console.log("All resources have been created")

with a deploy-params.js file as follow (this is an example) :

module.exports = {
  StackName: "myStackName",
  TemplateBody: JSON.stringify({
    ssmParameterExample: {
      Type: "AWS::SSM::Parameter",
      Properties: {
        Name: `example-ssm`,
        Type: "String",
        Value: "this an example resource to deploy"

Verbose mode

When activated, verbose mode is powered by the excellent table node module and outputs results like so :

  • In case of success : success deploy
  • In case of faillure (plus a raised exception) : fail deploy

Global usage

You can use this a a global module as well. If installed globally, you can run :

cf-wait-deploy --stack-name exampleStackName --region eu-central-1 --tempalte-file ./tempalte.json

Available options are :

  • --region : (Mandatory) the region you want to deploy to
  • --stack-name : (Mandatory) you stack name
  • --template-file : (at least on of template-file, template-body or template-url is mandatory) the path to a .json file or .js file exporting your template as an object
  • --template-url : url of your template
  • --template-body : body template in form of stringified JSON
  • --verbose : false will disable verbose mode (which is enabled by default in command line)
  • --refresh-rate : the refresh rate for pulling CloudFormation events
  • --role-arn : the role you want to use while deploying your stack
  • --parameters : stringified JSON to pass CF parameters
  • --capabilities : (CAPABILITY_IAM | CAPABILITY_NAMED_IAM) the capability you want to use to deploy your stage

If you need any other parameter, please open an issue.