This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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