-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
69 lines (68 loc) · 2.33 KB
/
template.yml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Performance Metrics
Globals:
Function:
Timeout: 300
CodeUri: ./
Runtime: java11
MemorySize: 128
Environment:
Variables:
kmsKeyId: ""
Resources:
#
PerformanceApi:
Type: AWS::Serverless::Api
Properties:
Name: !Sub "${AWS::StackName} Performance API"
Description: Server API
StageName: test
DefinitionBody:
'Fn::Transform':
Name: 'AWS::Include'
Parameters:
Location: ./api/apigw.yml
#
PerformanceFunction:
Type: AWS::Serverless::Function
Properties:
Handler: ap.Greeter
AutoPublishAlias: live
DeploymentPreference:
Type: AllAtOnce # Or Canary10Percent5Minutes, Linear10PercentEvery1Minute, ...
ProvisionedConcurrencyConfig:
ProvisionedConcurrentExecutions: 3
Events:
ApiEvent:
Type: Api
Properties:
RestApiId: !Ref PerformanceApi
Path: /
Method: get
# PerformanceScalableTarget:
# Type: AWS::ApplicationAutoScaling::ScalableTarget
# Properties:
# MaxCapacity: 100
# MinCapacity: 5
# ResourceId: !Sub function:${PerformanceFunction}:live # You need to specify an alis or version here
# RoleARN: !Sub arn:aws:iam::${AWS::AccountId}:role/aws-service-role/lambda.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_LambdaConcurrency
# ScalableDimension: lambda:function:ProvisionedConcurrency
# ServiceNamespace: lambda
# DependsOn: PerformanceFunctionAliaslive # This is your function logical ID + "Alias" + what you use for AutoPublishAlias
# PersonCreateScalingPolicy:
# Type: AWS::ApplicationAutoScaling::ScalingPolicy
# Properties:
# PolicyName: utilization
# PolicyType: TargetTrackingScaling
# ScalingTargetId: !Ref PerformanceScalableTarget
# TargetTrackingScalingPolicyConfiguration:
# TargetValue: 0.70 # Any value between 0.1 and 0.9 can be used here
# PredefinedMetricSpecification:
# PredefinedMetricType: LambdaProvisionedConcurrencyUtilization
#
Outputs:
PerformanceApi:
Description: "API Gateway endpoint URL for Issuing Microservice"
Value: !Sub "https://${PerformanceApi}.execute-api.${AWS::Region}.amazonaws.com/test"