Git Product home page Git Product logo

vpc's Introduction

cfn-modules: AWS VPC

AWS VPC using two or three availability zones with public and private subnets, VPC endpoints for DynamoDB and S3, Flow Logs, and NAT gateways.

Install

Install Node.js and npm first!

npm i @cfn-modules/vpc

Usage

---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'cfn-modules example'
Resources:
  Vpc:
    Type: 'AWS::CloudFormation::Stack'
    Properties:
      Parameters:
        AlertingModule: '' # optional
        ClassB: 0 # optional
        NumberOfAvailabilityZones: 3 # optional
        S3Endpoint: true # optional
        XRayEndpoint: false # optional
        LambdaEndpoint: false # optional
        DynamoDBEndpoint: true # optional
        FlowLog: 'reject-only' # optional
        FlowLogRetentionInDays: 14 # optional
        NatGateways: true # optional
      TemplateURL: './node_modules/@cfn-modules/vpc/module.yml'

Examples

Related modules

none

Standalone usage

You might want to use this module without embedding it as a nested stack because you want to share the VPC stack with many other CloudFormation stacks.

npm i @cfn-modules/vpc
aws cloudformation package --template-file ./node_modules/@cfn-modules/vpc/module.yml --s3-bucket $BucketName --output-template-file packaged.yml
aws cloudformation deploy --template-file packaged.yml --stack-name vpc --capabilities CAPABILITY_IAM

Once the stack is created, you can use the stack name (in this case vpc) as the value for the VpcModule parameter in other cfn-modules. If this template has been embedded in a parent template where the default have been overridden, it is important to re-export the outputs of the stack so they can be used in oher stand-alone stacks:

StackName:
    Value: !GetAtt Vpc.Outputs.StackName
    Export:
      Name: !Sub '${AWS::StackName}'

This will mean you can refer to the VpcModule in other configurations.

Parameters

Name Description Default Required? Allowed values
AlertingModule Stack name of alerting module false
ClassB Class B of VPC (10.XXX.0.0/16) 0 no [0-255]
NumberOfAvailabilityZones How many availability zones should be used? 3 no [2-3]
S3Endpoint Add S3 endpoint to VPC? true no [true, false]
DynamoDBEndpoint Add DynamoDB endpoint to VPC? true no [true, false]
FlowLog Enable VPC Flow Logs? reject-only no [true, reject-only, false]
FlowLogRetentionInDays Specifies the number of days you want to retain log events 14 no [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653]
NatGateways Add Nat Gateway per private Subnet? true no [true, false]
XRayEndpoint Add X-Ray endpoint to VPC? false no [true, false]
LambdaEndpoint Add Lambda endpoint to VPC? false no [true, false]

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.