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.5.14.tar.gz.

File metadata

File hashes

Hashes for gammarers_aws_rds_database_auto_running_protection_stack-2.5.14.tar.gz
Algorithm Hash digest
SHA256 969003dbde9773f3bc1805ac25b6968669195d073605485b3d9f3375fbb62cc1
MD5 8740f3a42580553b1f91446cf983f2ba
BLAKE2b-256 56f44da06a43e9f176605c7ec9274daa762886c8a4a0a2c83b23ebdc97ac9842

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_rds_database_auto_running_protection_stack-2.5.14-py3-none-any.whl
Algorithm Hash digest
SHA256 cea1dab269386443fb2613ac81c1291877d029eaa5c80088fc8ec4aa2640ec82
MD5 9d04144f796acf0a2a20baf8969800c9
BLAKE2b-256 21906581c770a5ae4797cfeb5cc0e09f4076120c8ff06a5fdbed0c27a95aee76

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