serverless-alb-manager

1.0.3 • Public • Published

ALB Manager Serverless Plugin

CircleCI npm version license

This plugin adds an HTTP ALB to your serverless project instead of an API Gateway for HTTP functions.

About Schoology

Schoology Logo

Schoology, one of the fastest growing education technology companies, brings together the best K-12 learning management system with assessment management to improve student performance, foster collaboration, and personalize learning. Millions of students, faculty and administrators from over 60,000 K-12 schools worldwide use Schoology to advance what is possible in education.

We help solve the most important challenges in education in an environment that’s fun, collaborative and innovative. We are looking for smart, creative individuals who are passionate about education and aren't afraid to show it.

Learn more at https://www.schoology.com/careers.

Requirements

Tested with:

  • Node.js >= v8.10
  • Serverless Framework >= v1.45

Installation

  1. Using yarn:

    yarn add --dev serverless-alb-manager
    
  2. Add the plugin to your serverless.yml file:

    plugins:
      - serverless-alb-manager
  3. Add the plugin configuration to your serverless.yml file, for example:

      serverless-alb-manager:
        vpcId: vpc-1234
        subnetIds:
          - subnet-2345
          - subnet-3456
        tags:
          foo: fooValue
          bar: barValue
        certificateArn: "arn:aws:acm:us-east-1:4567:certificate/abcd-5678"
        domainName: alb.example.com
    Parameter Name Required Description
    vpcId ✔️ The VPC in which the ALB should be created.
    subnetIds ✔️ An array of subnet IDs to associate with the ALB. These subnets should belong to the configured vpcId.
    tags ✔️ A map of tags for the ALB.
    certificateArn ✔️ The AWS ACM certificate ARN to use for the HTTP listener.
    domainName ✔️ The domain name that will be used to access the ALB. This should be valid for the given certificateArn.
  4. Add alb event listeners to your serverless functions. The listenerArn will automatically be populated with the ALB listener created by this plugin. For example:

    functions:
      foo:
        handler: src/handler.foo
        events:
          alb:
              # libraryArn is automatically populated 
              priority: 1
              conditions:
                path: '/foo'
                method: GET
       bar:
        handler: src/handler.bar
        events:
          alb:
              # libraryArn is automatically populated 
              priority: 2
              conditions:
                path: '/bar'
                method: GET
     

Resource Created By This Plugin

Type Description
Security Group
  • ingress 443 from 0.0.0.0/0
  • egress * to 0.0.0.0/0
  • configurable VPC
Application Load Balancer
  • ipv4
  • configurable subnet
  • configurable tags
ALB Listener
  • default action HTTP 403 with JSON body { "error": "Forbidden" }
  • configurable ACM certificate ARN
Route53 DNS Record
  • Alias pointing to ALB
  • Configurable domain name

Package Sidebar

Install

npm i serverless-alb-manager

Weekly Downloads

1

Version

1.0.3

License

MIT

Unpacked Size

21.9 kB

Total Files

9

Last publish

Collaborators

  • timschoology