Skip to main content

This construct is aws rds database or cluster auto running to stop.

Project description

AWS RDS Database Auto Running Protection Stack

GitHub npm (scoped) PyPI Nuget GitHub Workflow Status (branch) GitHub release (latest SemVer)

View on Construct Hub

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
  },
});

Resources

This construct creating resource list.

  • StepFunctions(StateMachine)
  • IAM Role (StepFunctions)
  • IAM Policy (StepFunctions)
  • EventBridge
  • IAM Role (EventBridge)

Install

TypeScript

install by npm

npm install @gammarers/aws-rds-database-auto-running-protection-stack

install by yarn

yarn add @gammarers/aws-rds-database-auto-running-protection-stack

install by pnpm

pnpm add @gammarers/aws-rds-database-auto-running-protection-stack

install by bun

bun add @gammarers/aws-rds-database-auto-running-protection-stack

Python

pip install gammarers.aws-rds-database-auto-running-protection-stack

C# / .NET

dotnet add package Gammarers.CDK.AWS.RDSDatabaseAutoRunningProtectionStack

Example

Code

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"
      'foo@example.com',
      'bar@example.net',
    ],
    slack: { // "Incoming Sample Message - Slack"
      webhookSecretName: 'example/slack/webhook', // Slack webhook secret
    },
  },
});

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
Channel
Webhook

Incoming Sample Message

EMAIL

Slack

License

This project is licensed under the Apache-2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file gammarers_aws_rds_database_auto_running_protection_stack-2.7.0.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_rds_database_auto_running_protection_stack-2.7.0.tar.gz
Algorithm Hash digest
SHA256 19d5c96f7c317732b7db193a42546d438ce73f9a4e2e6e242cb161b78faeacca
MD5 210a2297a757f8a9886a0c46014f97c2
BLAKE2b-256 2b2b115796f36d53db65742e2f51da02ded042a15ef41c3b7c838340db42314c

See more details on using hashes here.

File details

Details for the file gammarers_aws_rds_database_auto_running_protection_stack-2.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gammarers_aws_rds_database_auto_running_protection_stack-2.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 94618c52d5ef8f1af4ff9d0ab7df0982fc192e558cf42356acf27783b5317574
MD5 f6381fc2023319a889695d71ba5771e6
BLAKE2b-256 fa646fe487ceccefc5ec49b0b3c632fa30acd2bcd16b8e836138abf44ab9c2f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page