Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Last active June 25, 2019 17:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
service: example
# Note: I write these examples using the latest version of Serverless. I pin the example
# to that version so that I know it will work for you even if you find it a year later.
# Likely, you can remove this line and use the example with any recent version of
# Serverless. Give it a shot if you're using a different version.
# frameworkVersion: '=1.34.1'
custom:
defaultRegion: us-west-2
region: ${opt:region, self:custom.defaultRegion}
stage: ${opt:stage, env:USER}
prune:
automatic: true
number: 5
lane: ${file(lane.yml):${self:custom.stage}}
prefix: ${opt:prefix, self:custom.lane.prefix}
plugins:
- serverless-prune-plugin
provider:
name: aws
runtime: nodejs8.10
stackTags: # NOTE: STAGE is automatically added by SLS
SLS_SVC_NAME: ${self:service}
region: ${self:custom.region}
stage: ${self:custom.stage}
functions:
albEventConsumer:
handler: src/handlers/health.check
events:
- alb:
listenerArn:
ref: Listener
priority: 1
conditions:
path: /v2/check
resources:
Resources:
TargetGroup:
Type: AWS::ElasticLoadBalancingV2::TargetGroup
Properties:
TargetType: lambda
Listener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- Order: 1
TargetGroupArn:
Ref: TargetGroup
Type: forward
LoadBalancerArn: arn:aws:elasticloadbalancing:us-west-2:<...>
Port: 80
Protocol: HTTP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment