-
Notifications
You must be signed in to change notification settings - Fork 8
/
Amazon-RDS-Idle-DB-Instances_cfn.yml
58 lines (46 loc) · 1.43 KB
/
Amazon-RDS-Idle-DB-Instances_cfn.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
AWSTemplateFormatVersion: "2010-09-09"
Description: "Create 1 RDS Instance and 1 SNS to using in Custodian examples"
Parameters:
ResourceName:
Type: String
Description: "Name that will be using in resources"
Default: FinOps-C7N-Amazon-RDS-Idle-DB-Instances
Email2Notify:
Type: String
Description: "Email to notify"
SecurityGroupsID:
Type: List<AWS::EC2::SecurityGroup::Id>
Description: "Your Security Groups"
SubnetID:
Type: List<AWS::EC2::Subnet::Id>
Description: "Your Subnets"
Resources:
RDSInstance:
Type: AWS::RDS::DBInstance
Properties:
AllocatedStorage: 20
StorageType: gp2
DBInstanceClass: db.t3.small
DBInstanceIdentifier: !Ref ResourceName
Engine: mysql
MasterUsername: finopsc7ndbuser
MasterUserPassword: finopsc7ndbpass
DBSubnetGroupName: !Ref RDSInstanceSubnetGroup
VPCSecurityGroups: !Ref SecurityGroupsID
RDSInstanceSubnetGroup:
Type: "AWS::RDS::DBSubnetGroup"
Properties:
DBSubnetGroupDescription: "SubnetGroup created to testing C7N policies"
SubnetIds: !Ref SubnetID
NotificationTopic:
Type: AWS::SNS::Topic
Properties:
DisplayName: !Ref ResourceName
Subscription:
- Endpoint: !Ref Email2Notify
Protocol: email
TopicName: !Ref ResourceName
Outputs:
NotificationARN:
Description: SNS ARN to use in your C7N policy
Value: !Ref NotificationTopic