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

File metadata

File hashes

Hashes for gammarers_aws_rds_database_auto_running_protection_stack-2.5.18.tar.gz
Algorithm Hash digest
SHA256 2181f404184993361ab99dc366dc4f0318e3e74c6ed023da40b012c59599999e
MD5 823fa63d50c694db4addf64a939c40c6
BLAKE2b-256 642f8f62b293a817ce79aed5328dcc2b3659560f4a9f3caed113fcfcd89a53df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gammarers_aws_rds_database_auto_running_protection_stack-2.5.18-py3-none-any.whl
Algorithm Hash digest
SHA256 1b66f1192479d2f0d1926198b6574066c735907ed8299da69e0ec58c1b34feaf
MD5 31f43497f33933550fde843af355778b
BLAKE2b-256 fb4d7313fda036a9e1c30d51bbee45d8fc0f4e844f7d3c5d0777b79d97ecf545

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