-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
executable file
·86 lines (73 loc) · 2.16 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: poja-compute-only - Computation and API
Globals:
Function:
CodeUri: .
Runtime: java21
Tracing: Active
Architectures:
- arm64
EventInvokeConfig:
MaximumRetryAttempts: 0
AutoPublishAlias: live
SnapStart:
ApplyOn: PublishedVersions
VpcConfig:
SecurityGroupIds:
- !Sub '{{resolve:ssm:/poja/sg/id}}'
SubnetIds:
- !Sub '{{resolve:ssm:/poja/subnet/private1/id}}'
- !Sub '{{resolve:ssm:/poja/subnet/private2/id}}'
Environment:
Variables:
ENV: !Ref Env
AWS_S3_BUCKET: !Sub '{{resolve:ssm:/poja-compute-only/${Env}/s3/bucket-name}}'
AWS_SES_SOURCE: [email protected]
Parameters:
Env:
Type: String
Resources:
FrontalServerlessRestApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
BinaryMediaTypes:
- "*~1*"
FrontalFunction:
Type: AWS::Serverless::Function
Properties:
Handler: com.company.base.ApiEventHandler::handleRequest
MemorySize: 2048
Timeout: 30
Role: !Sub '{{resolve:ssm:/poja-compute-only/${Env}/execution/role-arn}}'
Events:
ApiCall:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
RestApiId:
Ref: FrontalServerlessRestApi
ApplicationResourceGroup:
Type: AWS::ResourceGroups::Group
Properties:
Name:
Fn::Sub: ApplicationInsights-SAM-${AWS::StackName}
ResourceQuery:
Type: CLOUDFORMATION_STACK_1_0
ApplicationInsightsMonitoring:
Type: AWS::ApplicationInsights::Application
Properties:
ResourceGroupName: !Ref ApplicationResourceGroup
AutoConfigurationEnabled: 'true'
ApiUrlSSM:
Type: AWS::SSM::Parameter
Properties:
Name: !Join [ '', [ /poja-compute-only/, !Ref Env, /api/url ] ]
Type: String
Value: !Sub "https://${FrontalServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod"
Outputs:
ApiUrl:
Description: API Gateway endpoint URL
Value: !GetAtt ApiUrlSSM.Value