TIL: EventBridge start/stop aurora automation
When you stop Amazon RDS instances (including Aurora), they are automatically started after 7 days. In the aws doc, you will find this notice.
# For EC2
Create policy
1{
2 "Version": "2012-10-17",
3 "Statement": [
4 {
5 "Sid": "VisualEditor0",
6 "Effect": "Allow",
7 "Action": [
8 "ec2:StartInstances",
9 "ec2:StopInstances"
10 ],
11 "Resource": "*"
12 }
13 ]
14}
name: eventbridge_automation_ec2_policy
# For Aurora
1{
2 "Version": "2012-10-17",
3 "Statement": [
4 {
5 "Sid": "RDSDescribe",
6 "Effect": "Allow",
7 "Action": [
8 "rds:DescribeDBClusters"
9 ],
10 "Resource": [
11 "*"
12 ]
13 },
14 {
15 "Sid": "RDSControl",
16 "Effect": "Allow",
17 "Action": [
18 "rds:StartDBCluster",
19 "rds:StopDBCluster"
20 ],
21 "Resource": [
22 "*"
23 ]
24 }
25 ]
26}
name: eventbridge_automation_rds_policy
# EventBridge
https://dev.to/aws-builders/easy-setup-for-ec2-stop-jobs-with-amazon-eventbridge-scheduler-4lpg