-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
98 lines (89 loc) · 2.67 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
87
88
89
90
91
92
93
94
95
96
97
98
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: sam-app
Globals:
Function:
MemorySize: 1024
# Architectures: ["arm64"]
Handler: bootstrap
Runtime: provided.al2
Timeout: 30
Environment:
Variables:
RUST_BACKTRACE: 1
RUST_LOG: info
Resources:
MyApplication:
Type: AWS::AppConfig::Application
Properties:
Name: "MyTestApplication"
Environment:
Type: AWS::AppConfig::Environment
Properties:
Name: "MyTestEnvironment"
ApplicationId: { Ref: MyApplication }
MyConfigurationProfile:
Type: AWS::AppConfig::ConfigurationProfile
Properties:
ApplicationId: !Ref MyApplication
Name: "MyTestProfile"
LocationUri: "hosted"
MyDeploymentStrategy:
Type: AWS::AppConfig::DeploymentStrategy
Properties:
Name: "MyTestDeploymentStrategy"
Description: "A deployment strategy to deploy the config immediately"
DeploymentDurationInMinutes: 0
FinalBakeTimeInMinutes: 0
GrowthFactor: 100
GrowthType: LINEAR
ReplicateTo: NONE
BasicHostedConfigurationVersion:
Type: AWS::AppConfig::HostedConfigurationVersion
Properties:
ApplicationId: !Ref MyApplication
ConfigurationProfileId: !Ref MyConfigurationProfile
Description: 'A sample hosted configuration version'
ContentType: 'application/json'
Content: |
{
"name": "ExampleApplication",
"id": 1,
"rank": 7
}
AppConfigDeployment:
Type: AWS::AppConfig::Deployment
Properties:
ApplicationId: !Ref MyApplication
ConfigurationProfileId: !Ref MyConfigurationProfile
ConfigurationVersion: !Ref BasicHostedConfigurationVersion
DeploymentStrategyId: !Ref MyDeploymentStrategy
EnvironmentId: !Ref Environment
MyFucntion:
Type: AWS::Serverless::Function
Properties:
CodeUri: build/handler/
Policies:
- AWSLambdaBasicExecutionRole
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- appconfig:StartConfigurationSession
- appconfig:GetLatestConfiguration
Resource:
- '*'
Environment:
Variables:
APP_CONFIG_NAME: MyTestApplication
AWS_APPCONFIG_ENVIRONMENT: MyTestEnvironment
AWS_APPCONFIG_PROFILE: MyTestProfile
AWS_APPCONFIG_EXTENSION_HTTP_PORT: 2772
Layers:
- arn:aws:lambda:eu-central-1:066940009817:layer:AWS-AppConfig-Extension:54
Metadata:
BuildMethod: makefile
Outputs:
MyFucntion:
Value: !Ref MyFucntion
Description: Lambda Function ARN