-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathserverless.yml
More file actions
69 lines (64 loc) · 1.42 KB
/
serverless.yml
File metadata and controls
69 lines (64 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
service: test-elb-load-balancing
provider:
name: aws
region: us-east-1
runtime: nodejs14.x
deploymentBucket:
name: testbucket
functions:
hello1:
handler: handler.hello1
events:
- alb:
listenerArn: !Ref HTTPListener
priority: 1
conditions:
path: /hello1
hello2:
handler: handler.hello2
events:
- alb:
listenerArn: !Ref HTTPListener
priority: 2
conditions:
path: /hello2
resources:
Resources:
LoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Name: lb-test-1
Subnets:
- !Ref Subnet
HTTPListener:
Type: AWS::ElasticLoadBalancingV2::Listener
Properties:
DefaultActions:
- Type: redirect
RedirectConfig:
Protocol: HTTPS
Port: 443
Host: "#{host}"
LoadBalancerArn: !Ref LoadBalancer
Protocol: HTTP
Subnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref VPC
CidrBlock: 12.2.1.0/24
AvailabilityZone: !Select
- 0
- Fn::GetAZs: !Ref "AWS::Region"
VPC:
Type: AWS::EC2::VPC
Properties:
EnableDnsSupport: "true"
EnableDnsHostnames: "true"
CidrBlock: 12.2.1.0/24
plugins:
- serverless-deployment-bucket
- serverless-localstack
custom:
localstack:
stages:
- local