Skip to content

Commit

Permalink
readmne
Browse files Browse the repository at this point in the history
  • Loading branch information
ford-at-aws committed Nov 4, 2024
1 parent 0fc050f commit e3e0879
Showing 1 changed file with 39 additions and 10 deletions.
49 changes: 39 additions & 10 deletions aws_doc_sdk_examples_tools/stats/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
# Welcome to your CDK TypeScript project

This is a blank project for CDK development with TypeScript.
# CodeCommitCloneStack

The `cdk.json` file tells the CDK Toolkit how to execute your app.
Deploys an AWS Lambda function that monitors a CodeCommit repository for updates, extracts data from a `.stats` file, and appends it to a `stats.csv` file in an S3 bucket.

## Useful commands
## Architecture

* `npm run build` compile typescript to js
* `npm run watch` watch for changes and compile
* `npm run test` perform the jest unit tests
* `npx cdk deploy` deploy this stack to your default AWS account/region
* `npx cdk diff` compare deployed stack with current state
* `npx cdk synth` emits the synthesized CloudFormation template
- **Lambda Function**: Pulls `.stats` file from CodeCommit, parses it, updates `stats.csv` in S3.
- **EventBridge Rule**: Triggers Lambda on CodeCommit repository changes.
- **IAM Role**: Grants Lambda necessary permissions for CodeCommit and S3 access.

## Prerequisites

- **Node.js**
- **AWS CDK**: `npm install -g aws-cdk`
- **AWS CLI**: Configured for your account
- **Python 3.9** (Lambda runtime)

## Deployment

2. **Install Dependencies**:
```bash
npm install
```

3. **Deploy Stack**:
```bash
cdk deploy
```

## Testing

Commit to the monitored CodeCommit repo and verify that `stats.csv` in S3 updates. Check Lambda logs in CloudWatch for details.

## Cleanup

```bash
cdk destroy
```

---

**License**: Apache-2.0

0 comments on commit e3e0879

Please sign in to comment.