Code Monkey home page Code Monkey logo

aws-cloudformation's Introduction

Serverless Components


AWS CloudFormation Component ⎯⎯⎯ Easily Deploy AWS Cloudformation templates using Serverless Components, and pass their outputs to other Serverless Components.

 

  1. Install
  2. Initialize
  3. Configure
  4. Deploy
  5. Remove

 

1. Install

npm install -g serverless

After installation, make sure you connect your AWS account by setting a provider in the org setting page on the Serverless Dashboard.

2. Initialize

The easiest way to get started with by initializing the aws-cloudformation-starter template. You can do that by running the following command:

serverless init aws-cloudformation-starter
cd aws-cloudformation-starter

3. Configure

You can configure your component & CloudFormation stack by editing the serverless.yml file in the root of the initialized template:

name: aws-cloudformation-starter
component: aws-cloudformation

inputs:
  name: my-stack
  template:
    AWSTemplateFormatVersion: '2010-09-09'
    Description: Example stack 1
    Resources:
      LogGroup:
        Type: AWS::Logs::LogGroup
        Properties:
          LogGroupName: /log/group/one
          RetentionInDays: 14
    Outputs:
      LogGroupArn:
        Value:
          Fn::GetAtt:
            - LogGroup
            - Arn

Inputs can contain the following properties:

  • name [required]. the name of the stack
  • template [required], the template to deploy.
  • capabilities, possible values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, and CAPABILITY_AUTO_EXPAND.
  • enableTerminationProtection, possible values are true and false. Default is false.
  • role, role arn for the role which CloudFormation assumes to create the stack.

See Request Parameters for more info about capabilities, enableTerminationProtection, and role.

4. Deploy

You can deploy your stack with the following command:

serverless deploy

Once that is done, you'll see your stack outputs in the CLI, which you could then reference in another component.

5. Remove

To remove your entire stack, just run:

serverless remove

aws-cloudformation's People

Contributors

eahefnawy avatar laardee avatar skierkowski avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aws-cloudformation's Issues

Example in README doesn't work

Tried following the readme and ran into:


  error:
  Error: Invalid inputs; template and stackName are required.
    at AwsCloudFormation.default (/Users/austen/.serverless/components/registry/npm/@serverless/[email protected]/node_modules/@serverless/aws-cloudformation/serverless.js:39:13)
    at defaultFunction (/Users/austen/.serverless/components/registry/npm/@serverless/[email protected]/node_modules/@serverless/core/src/Component.js:36:27)
    at fn (/usr/local/lib/node_modules/serverless/node_modules/@serverless/template/utils.js:276:47)

  6s › myStack › Error: Invalid inputs; template and stackName are required.

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.