1.0.1 • Published 7 years ago

cfn-stack-event-stream v1.0.1

Weekly downloads
1,898
License
ISC
Repository
-
Last release
7 years ago

A readable stream of CloudFormation stack events.

Usage

var AWS = require('aws-sdk');
var EventStream = require('cfn-stack-event-stream');

var cfn = new AWS.CloudFormation({region: 'us-east-1'});

cfn.createStack({
    StackName: 'my-stack',
    TemplateBody: template
}, function(err) {
    if (err) throw err;
    EventStream(cfn, 'my-stack')
        .on('data', function (e) {
            console.log(e.ResourceStatus, e.ResourceType, e.ResourceStatusReason);
        })
        .on('end', function() {
            cfn.describeStacks({StackName: 'my-stack'}, function(err, data) {
                if (err) throw err;
                console.log('Result: ' + data.Stacks[0].StackStatus);
            });
        });
});

API

EventStream(cfn, stackName, options)

Returns an object-mode readable stream which emits StackEvent objects as returned by describeStackEvents

Required parameters:

  • cfn: An AWS::CloudFormation instance.
  • stackName: The name or ARN of the stack. Note that if you are reading events for a stack that is deleted or in the process of being deleted, you need to pass the full ARN rather than the stackName.

Options:

  • lastEventId: The EventId of a StackEvent. StackEvents emitted by the resulting stream are guaranteed not to include this event or any preceding events.
1.0.1

7 years ago

1.0.0

7 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

12 years ago

0.0.1

12 years ago

0.0.0

12 years ago