Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudform

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudform

TypeScript-based imperative way to define AWS CloudFormation templates

  • 0.0.13
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cloudform

TypeScript-based imperative way to define AWS CloudFormation templates

Installation

npm install --save-dev cloudform

Usage

  1. Define your CloudFormation template in a TypeScript file, for example template.ts:
TODO imports

cloudform({
    Description: 'My template',
    Parameters: {
        DeployEnv: new StringParameter({
            Description: 'Deploy environment name',
            AllowedValues: ['dev', 'stage', 'production']
        })
    },
    Mappings: {
        SubnetConfig: {
            VPC: {
                CIDR: '10.0.0.0/16'
            }
        }
    },
    Resources: {
        VPC: new VPC({
            CidrBlock: Fn.FindInMap('SubnetConfig', 'VPC', 'CIDR'),
            EnableDnsHostnames: true,
            Tags: [
                new ResourceTag('Application', Refs.StackName),
                new ResourceTag('Network', 'Public'),
                new ResourceTag('Name', Fn.Join('-', [Refs.StackId, 'VPC']))
            ]
        })
    }
})

See also example/example.ts.

2. Run cloudform path/to/your/template.ts to generate the CloudFormation template as JSON.

It make sense to define it in your npm scripts and run within your build or deployment pipeline, for example:

"scripts": {
  // ...
  "generate-cloudformation-template": "cloudform path/to/your/template > template.aws"
}

API

The types are generated automatically from the AWS-provided schema file, so cloudform supports all the types available in AWS CloudFormation. The general layout is ...

Keywords

FAQs

Package last updated on 23 Nov 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc