Coder Social home page Coder Social logo

edwardmlyte / cumulonimbus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from seize-the-dave/cumulonimbus

0.0 0.0 0.0 102 KB

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

License: MIT License

JavaScript 100.00%

cumulonimbus's Introduction

Cumulonimbus

Build Status Coverage Status npm version

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

Resource Support

  • AWS::EC2::DHCPOptions
  • AWS::EC2::EIP
  • AWS::EC2::Instance, except:
  • IamInstanceProfile
  • NetworkInterfaces
  • PlacementGroupName
  • SsmAssociations
  • UserData
  • Volumes
  • AdditionalInfo
  • AWS::EC2::InternetGateway
  • 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

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"
                }
            }
        }
    }
}

cumulonimbus's People

Contributors

seize-the-dave avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.