-
Notifications
You must be signed in to change notification settings - Fork 3
/
rotation.yml
52 lines (49 loc) · 1.57 KB
/
rotation.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
---
AWSTemplateFormatVersion: 2010-09-09
Transform:
- "AWS::Serverless-2016-10-31"
Parameters:
App:
Type: String
Description: Your application's name.
Env:
Type: String
Description: The environment name your service, job, or workflow is being deployed to.
Name:
Type: String
Description: The name of the service, job, or workflow being deployed.
Resources:
SecretRotationTemplate:
Type: AWS::Serverless::Application
Properties:
Location:
ApplicationId: arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser
SemanticVersion: 1.1.60
Parameters:
endpoint: !Sub https://secretsmanager.${AWS::Region}.amazonaws.com
functionName: !Sub ${AWS::StackName}-func
vpcSecurityGroupIds: !Ref RotationSecurityGroup
vpcSubnetIds:
Fn::Join:
- ","
- - !Select [
0,
!Split [
",",
{ "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" },
],
]
- !Select [
1,
!Split [
",",
{ "Fn::ImportValue": !Sub "${App}-${Env}-PrivateSubnets" },
],
]
SecretRotationSchedule:
Type: AWS::SecretsManager::RotationSchedule
Properties:
SecretId: !Ref AuroraSecret
RotationLambdaARN: !GetAtt SecretRotationTemplate.Outputs.RotationLambdaARN
RotationRules:
AutomaticallyAfterDays: 30