-
Notifications
You must be signed in to change notification settings - Fork 1
/
AuroraServerlessTemplate.yaml
61 lines (57 loc) · 1.52 KB
/
AuroraServerlessTemplate.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Outputs:
databaseArn:
Description: 'the db arn'
Value:
!Join
- ':'
- - 'arn:aws:rds'
- !Ref AWS::Region
- !Ref AWS::AccountId
- 'cluster'
- !Ref db
dbClusterIdentifier:
Description: 'the dbClusterIdentifier'
Value: !Ref db
secretArn:
Description: 'the secrets arn'
Value: !Ref dbSecret
Resources:
db:
Type: 'AWS::RDS::DBCluster'
Properties:
DatabaseName: 'testdb04oct19235803'
Engine: 'aurora'
EngineMode: 'serverless'
EngineVersion: '5.6.10a'
MasterUserPassword:
!Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref dbSecret
- ':SecretString:password}}'
MasterUsername:
!Join
- ''
- - '{{resolve:secretsmanager:'
- !Ref dbSecret
- ':SecretString:username}}'
ScalingConfiguration:
AutoPause: 'true'
MaxCapacity: 4
MinCapacity: 1
SecondsUntilAutoPause: 900
dbSecret:
Type: 'AWS::SecretsManager::Secret'
Properties:
Description: 'RDS database auto-generated user password'
GenerateSecretString:
ExcludeCharacters: '"@/\'
GenerateStringKey: 'password'
PasswordLength: 30
SecretStringTemplate: '{"username": "admin"}'
Name: 'testdb04oct19235803-AuroraUserSecret'
Tags:
- Key: 'test'
Value: 'test testdb04oct19235803'
Transform: 'AWS::Serverless-2016-10-31'