Socket
Socket
Sign inDemoInstall

@atombrenner/cfn-stack

Package Overview
Dependencies
3
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @atombrenner/cfn-stack

Manage Cloudformation Stacks with Typescript


Version published
Maintainers
1
Created

Readme

Source

@atombrenner/cfn-stack

Manage CloudFormation Stacks with Typescript

Installation

npm i -D @atombrenner/cfn-stack

Usage

import { Stack } from '@atombrenner/cfn-stack'
import * as fs from 'fs'

async function main() {
  const stack = new Stack({ name: 'cfn-stack-test', region: 'eu-west-1', profile: 'atombrenner' })
  const template = fs.readFileSync('./cloudformation.yaml', { encoding: 'utf-8' })

  // create or update stack and wait for completion log events
  const params: Record<string, string> = { Env: 'stage' }
  await stack.createOrUpdate(template, params)

  // access stack outputs
  const outputs: Record<string, string> = await stack.getOutputs()
  console.log('Outputs: ' + JSON.stringify(outputs))
}

main().catch((err) => {
  console.error(err.message)
  process.exit(1) // exit the process with an error code
})

Example Output

16:27:28 Updating stack "cfn-stack-test"
========
16:27:28 CREATE_COMPLETE AWS::CloudFormation::Stack "cfn-stack-test"
16:27:30 UPDATE_IN_PROGRESS AWS::CloudFormation::Stack "cfn-stack-test"
         User Initiated
16:27:34 UPDATE_IN_PROGRESS AWS::IAM::Role "SomeRole"
         Requested update requires the creation of a new physical resource; hence creating one.
16:27:35 UPDATE_IN_PROGRESS AWS::IAM::Role "SomeRole"
         Resource creation Initiated
16:27:53 UPDATE_COMPLETE AWS::IAM::Role "SomeRole"
16:27:55 UPDATE_COMPLETE_CLEANUP_IN_PROGRESS AWS::CloudFormation::Stack "cfn-stack-test"
16:27:56 DELETE_IN_PROGRESS AWS::IAM::Role "SomeRole"
16:27:58 DELETE_COMPLETE AWS::IAM::Role "SomeRole"
16:27:59 UPDATE_COMPLETE AWS::CloudFormation::Stack "cfn-stack-test"
========

FAQs

Last updated on 28 Dec 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc