cumulonimbus

0.31.0 • Public • Published

Cumulonimbus

Build Status Coverage Status npm version Code Climate Dependency Status

Cumulonimbus is a Node.js library for creating AWS CloudFormation templates programmatically.

Resource Support

  • AWS::EC2::DHCPOptions
  • AWS::EC2::EIP
  • AWS::EC2::EIPAssociation
  • AWS::EC2::Instance
  • AWS::EC2::InternetGateway
  • AWS::EC2::PlacementGroup
  • AWS::EC2::Route
  • AWS::EC2::RouteTable
  • AWS::EC2::SecurityGroup
  • AWS::EC2::Subnet
  • AWS::EC2::SubnetRouteTableAssociation
  • AWS::EC2::VPC
  • AWS::EC2::VPCDHCPOptionsAssociation
  • AWS::EC2::VPCGatewayAttachment
  • AWS::EC2::VPCPeeringConnection
  • AWS::EC2::VPNGateway
  • AWS::IAM::AccessKey
  • AWS::IAM::Group
  • AWS::IAM::InstanceProfile
  • AWS::IAM::ManagedPolicy
  • AWS::IAM::Policy
  • AWS::IAM::Role
  • AWS::IAM::User
  • AWS::IAM::UserToGroupAddition
  • AWS::RDS::DBCluster
  • AWS::Redshift::Cluster
  • AWS::Redshift::ClusterSecurityGroup
  • AWS::Redshift::ClusterSubnetGroup
  • AWS::S3::Bucket
  • AWS::S3::BucketPolicy
  • AWS::SNS::Topic
  • AWS::SNS::TopicPolicy
  • AWS::SQS::Queue
  • AWS::SQS::QueuePolicy

Usage

var cn = require('cumulonimbus');
 
var template = new cn.Template();
var vpc = new cn.Ec2.Vpc("VPC");
vpc.enableDnsSupport(true);
vpc.enableDnsHostnames(true);
vpc.setCidrBlock("10.0.0.0/16");
vpc.setInstanceTenancy("dedicated");
vpc.addTag("Name", "VPC");
 
var publicSubnet = new cn.Ec2.Subnet("PublicSubnet");
publicSubnet.setCidrBlock("10.0.0.0/24");
publicSubnet.setVpcId(vpc);
 
template.addResource(vpc);
template.addResource(publicSubnet);
template.validate(function(err) {
  if (err === undefined) {
    console.log(JSON.stringify(template.toJson(), null, 4));
  }
});

Running the JavaScript file above yields the following output:

{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "VPC": {
            "Type": "AWS::EC2::VPC",
            "Properties": {
                "EnableDnsSupport": true,
                "EnableDnsHostnames": true,
                "CidrBlock": "10.0.0.0/16",
                "InstanceTenancy": "dedicated",
                "Tags": {
                    "Name": "VPC"
                }
            }
        },
        "PublicSubnet": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "CidrBlock": "10.0.0.0/24",
                "VpcId": {
                    "Ref": "VPC"
                }
            }
        }
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i cumulonimbus

Weekly Downloads

0

Version

0.31.0

License

MIT

Last publish

Collaborators

  • seize-the-dave