This constructor stack includes a function to automatically stop a database or cluster that will automatically start in 7 days.
Warning
v2.1.0:
Stack props add option resourceNamingOption
default ResourceNamingType.DEFAULT is cdk generated name
if you want to maintain compatibility with versions below v2.1.0
, please include the following settings (ResourceNamingType.AUTO).
new RDSDatabaseAutoRunningProtectionStack(app, 'RDSDatabaseAutoRunningProtectionStack', {
stackName: 'rds-database-auto-running-protection-stack',
targetResource: {
tagKey: 'AutoRunningProtection',
tagValues: ['YES'],
},
resourceNamingOption: {
type: RDSDatabaseAutoRunningProtectionStackResourceNamingType.AUTO, // HERE
},
});
This construct creating resource list.
- StepFunctions(StateMachine)
- IAM Role (StepFunctions)
- IAM Policy (StepFunctions)
- EventBridge
- IAM Role (EventBridge)
npm install @gammarers/aws-rds-database-auto-running-protection-stack
yarn add @gammarers/aws-rds-database-auto-running-protection-stack
pnpm add @gammarers/aws-rds-database-auto-running-protection-stack
bun add @gammarers/aws-rds-database-auto-running-protection-stack
pip install gammarers.aws-rds-database-auto-running-protection-stack
dotnet add package Gammarers.CDK.AWS.RDSDatabaseAutoRunningProtectionStack
import { RDSDatabaseAutoRunningProtectionStack } from '@gammarers/aws-rds-database-auto-running-protection-stack';
new RDSDatabaseAutoRunningProtectionStack(app, 'RDSDatabaseAutoRunningProtectionStack', {
stackName: 'rds-database-auto-running-protection-stack',
targetResource: {
tagKey: 'AutoRunningProtection',
tagValues: ['YES'],
},
resourceNamingOption: {
type: RDSDatabaseAutoRunningProtectionStackResourceNamingType.DEFAULT,
},
notifications: {
emails: [ // "Incoming Sample Message - EMAIL"
'[email protected]',
'[email protected]',
],
slack: { // "Incoming Sample Message - Slack"
webhookSecretName: 'example/slack/webhook', // Slack webhook secret
},
},
});
Please save it in AWS Secrets Manager in the following format.
get your slack webhook url parts
https://hooks.slack.com/services/<workspace>/<channel>/<whebook>
SecretKey | SecretValue |
---|---|
Workspace | <workspace> |
Channel | <channel> |
Webhook | <whebook> |
This project is licensed under the Apache-2.0 License.