-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0fc050f
commit e3e0879
Showing
1 changed file
with
39 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |