Giter Club home page Giter Club logo

posh-awscfn's Introduction

# posh-awscfn

CloudFormation is a facility in Amazon Web Services (AWS) that allows you to describe the architecture and configuration of resources on the AWS platform. This is done using CloudFormation (CFN) Templates which declare the resources and their interdependencies in a JSON document.

This PowerShell module provides a set of cmdlets and supporting tools that allow you to describe and generate CFN Templates using the semantics and features of the PowerShell scripting language.

One of the most useful set of tools in this module allows you to write CloudFormation templates in a domain-specific vocabulary (DSV) which provides intellisense and strong-typing when describing your template definition. Here's a quick example:

Template -Description "Sample CloudFormation Template" {

  ## Optional template parameter
  Parameter DBPassword String -NoEcho `
    -MinLength 1 -MaxLength 41 -AllowedPattern "[a-zA-Z0-9]+" `
    -Description "The database admin account password" `
    -ConstraintDescription "must contain only alphanumeric characters."

  ## Strongly-typed Resource definition
  Res-RDS-DBInstance MasterDB -DeletionPolicy Snapshot `
    -Engine MySQL -DBName MyDB -AllocatedStorage 5 `
    -DBInstanceClass db.m1.large -MasterUsername dbuser {
      Property MasterUserPassword (Fn-Ref DBPassword)
    }
}

And here is the CloudFormation JSON Template it generates:

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "Sample CloudFormation Template",
  "Parameters": {
    "DBPassword": {
      "Type": "String",
      "Description": "The database admin account password",
      "ConstraintDescription": "must contain only alphanumeric characters.",
      "NoEcho": "True",
      "AllowedPattern": "[a-zA-Z0-9]+",
      "MinLength": "1",
      "MaxLength": "41"
    }
  },
  "Resources": {
    "MasterDB": {
      "Type": "AWS::RDS::DBInstance",
      "DeletionPolicy": "Snapshot",
      "Properties": {
        "AllocatedStorage": "5",
        "DBInstanceClass": "db.m1.large",
        "DBName": "MyDB",
        "Engine": "MySQL",
        "MasterUsername": "dbuser",
        "MasterUserPassword": {
          "Ref": "DBPassword"
        }
      }
    }
  }
}

You can find another sample here.

Getting Started

Check out the Getting Started wiki page to get started.

posh-awscfn's People

Watchers

 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.