Skip to content

Instantly share code, notes, and snippets.

View cagriar's full-sized avatar

Cagri Aslanbas cagriar

View GitHub Profile
@cagriar
cagriar / KeepDbStopped.yml
Created May 4, 2020 06:46 — forked from kichik/KeepDbStopped.yml
CloudFormation template that stops RDS from automatically starting back up
# aws cloudformation deploy --template-file KeepDbStopped.yml --stack-name stop-db --capabilities CAPABILITY_IAM --parameter-overrides DB=arn:aws:rds:us-east-1:XXX:db:XXX
Description: Automatically stop RDS instance every time it turns on due to exceeding the maximum allowed time being stopped
Parameters:
DB:
Description: ARN of database that needs to be stopped
Type: String
AllowedPattern: arn:aws:rds:[a-z0-9\-]+:[0-9]+:db:[^:]*
Resources:
DatabaseStopperFunction:
Type: AWS::Lambda::Function