Skip to content

Commit

Permalink
docs(lambda): log group docs not being rendered properly (#28871)
Browse files Browse the repository at this point in the history
TSDoc for `logGroup` is not being rendered properly due to the use of `<` and `>`.

This affects Vscode:

![Screenshot 2024-01-25 164442](https://github.com/aws/aws-cdk/assets/61606375/9db93b8c-dcbc-437e-8c07-a5f6b30c99b7)

And `aws-cdk-lib` docs as well: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html#loggroup

![Screenshot 2024-01-25 164752](https://github.com/aws/aws-cdk/assets/61606375/a924353e-f5c2-4355-80d8-b511bb6488a3)

Fixed by escaping `<` and `>` properly

This is probably caused by `<` is interpreted as opening `JSX` tags by `MDX`.

After fix:
![Screenshot 2024-01-25 165425](https://github.com/aws/aws-cdk/assets/61606375/c40c225b-cfac-4cf8-a102-832bc5f00213)



----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
longtv2222 authored Jan 26, 2024
1 parent efccfcb commit 589c19c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-lambda/lib/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export interface FunctionOptions extends EventInvokeConfigOptions {
/**
* The log group the function sends logs to.
*
* By default, Lambda functions send logs to an automatically created default log group named /aws/lambda/<function name>.
* By default, Lambda functions send logs to an automatically created default log group named /aws/lambda/\<function name\>.
* However you cannot change the properties of this auto-created log group using the AWS CDK, e.g. you cannot set a different log retention.
*
* Use the `logGroup` property to create a fully customizable LogGroup ahead of time, and instruct the Lambda function to send logs to it.
Expand Down

0 comments on commit 589c19c

Please sign in to comment.