https://github.com/gammarers/aws-daily-cloud-watch-logs-archive-stack
AWS CloudWatch Logs daily archive to s3 bucket
https://github.com/gammarers/aws-daily-cloud-watch-logs-archive-stack
aws cdk cdk-construct-library scheduler
Last synced: 7 months ago
JSON representation
AWS CloudWatch Logs daily archive to s3 bucket
- Host: GitHub
- URL: https://github.com/gammarers/aws-daily-cloud-watch-logs-archive-stack
- Owner: gammarers
- License: apache-2.0
- Created: 2023-03-03T01:59:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-23T19:17:22.000Z (over 1 year ago)
- Last Synced: 2025-04-26T12:06:17.556Z (over 1 year ago)
- Topics: aws, cdk, cdk-construct-library, scheduler
- Language: TypeScript
- Homepage:
- Size: 2.89 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWS Daily CloudWatch Logs Archive Stack
[](https://github.com/gammarers/aws-daily-cloud-watch-logs-archive-stack/blob/main/LICENSE)
[](https://www.npmjs.com/package/@gammarers/aws-daily-cloud-watch-logs-archive-stack)
[](https://pypi.org/project/gammarers.aws-daily-cloud-watch-logs-archive-stack/)
[](https://www.nuget.org/packages/gammarers.CDK.AWS.DailyCloudWatchLogsArchiveStack/)
[](https://github.com/gammarers/aws-daily-cloud-watch-logs-archive-stack/actions/workflows/release.yml)
[](https://github.com/gammarers/aws-daily-cloud-watch-logs-archive-stack/releases)
[](https://constructs.dev/packages/@gammarers/aws-daily-cloud-watch-logs-archive-stack)
AWS CloudWatch Logs daily(13:00Z) archive to s3 bucket.
## Resources
This construct creating resource list.
- S3 Bucket (log-archive-xxxxxxxx from @gammarers/aws-secure-log-bucket)
- Lambda function execution role
- Lambda function
- Lambda function log group
- StepFunctions state machine execution role
- StepFunctions state machine
- EventBridge Scheduler execution role
- EventBridge Scheduler
## Architecture

## Install
### TypeScript
#### install by npm
```shell
npm install @gammarers/aws-daily-cloud-watch-logs-archive-stack
```
#### install by yarn
```shell
yarn add @gammarers/aws-daily-cloud-watch-logs-archive-stack
```
#### install by pnpm
```shell
pnpm add @gammarers/aws-daily-cloud-watch-logs-archive-stack
```
#### install by bun
```shell
bun add @gammarers/aws-daily-cloud-watch-logs-archive-stack
```
### Python
```shell
pip install gammarers.aws-daily-cloud-watch-logs-archive-stack
```
### C# / .NET
```shell
dotnet add package Gammarers.CDK.AWS.DailyCloudWatchLogsArchiveStack
```
## Example
```shell
npm install @gammarers/aws-daily-cloud-watch-logs-archive-stack
```
```typescript
import { DailyCloudWatchLogsArchiveStack } from '@gammarers/aws-daily-cloud-watch-logs-archive-stack';
new DailyCloudWatchLogsArchiveStack(stack, 'DailyCloudWatchLogsArchiveStack', {
targetResourceTag: {
key: 'DailyLogExport',
values: ['Yes'],
},
});
```
## Otherwise
If you want to export old log files, please refer to the following repository. The log file will be exported in the same output format.
[AWS CloudWatch Logs Exporter](https://github.com/gammarers/aws-cloud-watch-logs-exporter)
## License
This project is licensed under the Apache-2.0 License.