https://github.com/gammarers/aws-rds-database-auto-running-protection-stack
This constructor stack includes a function to automatically stop a database or cluster that will automatically start in 7 days.
https://github.com/gammarers/aws-rds-database-auto-running-protection-stack
auto aws aws-cdk cdk rds stop
Last synced: 2 months ago
JSON representation
This constructor stack includes a function to automatically stop a database or cluster that will automatically start in 7 days.
- Host: GitHub
- URL: https://github.com/gammarers/aws-rds-database-auto-running-protection-stack
- Owner: gammarers
- License: apache-2.0
- Created: 2023-08-22T06:25:17.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-04-16T19:17:44.000Z (3 months ago)
- Last Synced: 2025-04-17T02:48:26.568Z (3 months ago)
- Topics: auto, aws, aws-cdk, cdk, rds, stop
- Language: TypeScript
- Homepage:
- Size: 1.4 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS RDS Database Auto Running Protection Stack
[](https://github.com/gammarers/aws-rds-database-auto-running-protection-stack/blob/main/LICENSE)
[](https://www.npmjs.com/package/@gammarers/aws-rds-database-auto-running-protection-stack)
[](https://pypi.org/project/gammarers.aws-rds-database-auto-running-protection-stack/)
[](https://www.nuget.org/packages/Gammarers.CDK.AWS.RDSDatabaseAutoRunningProtectionStack/)
[](https://github.com/gammarers/aws-rds-database-auto-running-protection-stack/actions/workflows/release.yml)
[](https://github.com/gammarers/aws-rds-database-auto-running-protection-stack/releases)[](https://constructs.dev/packages/@gammarers/aws-rds-database-auto-running-protection-stack)
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).
> ```typescript
> 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
```shell
npm install @gammarers/aws-rds-database-auto-running-protection-stack
```#### install by yarn
```shell
yarn add @gammarers/aws-rds-database-auto-running-protection-stack
```#### install by pnpm
```shell
pnpm add @gammarers/aws-rds-database-auto-running-protection-stack
```#### install by bun
```shell
bun add @gammarers/aws-rds-database-auto-running-protection-stack
```### Python
```shell
pip install gammarers.aws-rds-database-auto-running-protection-stack
```### C# / .NET
```shell
dotnet add package Gammarers.CDK.AWS.RDSDatabaseAutoRunningProtectionStack
```## Example
### Code
```typescript
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
},
},
});
```### Slack webhook secret
Please save it in AWS Secrets Manager in the following format.
get your slack webhook url parts
```text
https://hooks.slack.com/services///
```| SecretKey | SecretValue |
|-------------|-----------------|
| Workspace | \ |
| Channel | \ |
| Webhook | \ |## Incoming Sample Message

### Slack

## License
This project is licensed under the Apache-2.0 License.