-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Improve examples/cdk/README.md (#467)
* Improve examples/cdk/README.md * Address PR comments on README update * Addres PR comments #2
- Loading branch information
1 parent
7f91566
commit 646a9e8
Showing
5 changed files
with
25 additions
and
15 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,24 @@ | ||
# Welcome to your CDK TypeScript project! | ||
# AWS Lambda Powertools (TypeScript) examples in CDK | ||
|
||
This is a blank project for TypeScript development with CDK. | ||
This is a deployable CDK app that deploys AWS Lambda functions as part of a CloudFormation stack. These Lambda functions use the utilities made available as part of AWS Lambda Powertools (TypeScript) to demonstrate their usage. | ||
|
||
The `cdk.json` file tells the CDK Toolkit how to execute your app. | ||
You will need to have a valid AWS Account in order to deploy these resources. These resources may incur costs to your AWS Account. The cost from **some services** are covered by the [AWS Free Tier](https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Types=*all&awsf.Free%20Tier%20Categories=*all) but not all of them. If you don't have an AWS Account follow [these instructions to create one](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/). | ||
|
||
## Useful commands | ||
The example functions, located in the `lib` folder, are invoked automatically, twice, when deployed using the CDK construct defined in `lib/example-function.ts`. The first invocation demonstrates the effect on logs/metrics/annotations when the Lambda function has a cold start, and the latter without a cold start. | ||
|
||
* `npm run build` compile typescript to js | ||
* `npm run watch` watch for changes and compile | ||
* `npm run test` perform the jest unit tests | ||
* `cdk deploy` deploy this stack to your default AWS account/region | ||
* `cdk diff` compare deployed stack with current state | ||
* `cdk synth` emits the synthesized CloudFormation template | ||
## Deploying the stack | ||
|
||
* Ensure that CDK v2 is installed globally on your machine (if not, run `npm install -g aws-cdk`) | ||
* Navigate to this location of the repo in your terminal (`examples/cdk`) | ||
* `npm install` | ||
* `cdk deploy --all --profile <YOUR_AWS_PROFILE>` | ||
|
||
Note: Prior to deploying you may need to run `cdk bootstrap aws://<YOU_AWS_ACCOUNT_ID>/<AWS_REGION> --profile <YOUR_AWS_PROFILE>` if you have not already bootstrapped your account for CDK. | ||
|
||
## Viewing Utility Outputs | ||
|
||
All utility outputs can be viewed in the Amazon CloudWatch console. | ||
|
||
* `Logger` output can be found in Logs > Log groups | ||
* `Metrics` output can be found in Metrics > All metrics > CdkExample | ||
* `Tracer` output can be found in X-Ray traces > Traces |
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
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
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
2 changes: 1 addition & 1 deletion
2
packages/metrics/tests/e2e/standardFunctions.test.MyFunction.ts
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