Skip to content

Commit

Permalink
docs(lambda): add missing JSDoc Markdown code block (#29348)
Browse files Browse the repository at this point in the history
### Reason for this change

There is a missing Markdown code block  in the [`EventSourceMapping` documentation](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.EventSourceMapping.html):

![image](https://github.com/aws/aws-cdk/assets/2505696/cb50ded7-a4b0-43f9-ace7-736d805b23d0)


### Description of changes

Adds missing Markdown code block tags

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
nmussy authored Mar 8, 2024
1 parent 946412b commit 1f8acc1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/aws-cdk-lib/aws-lambda/lib/event-source-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,15 @@ export interface IEventSourceMapping extends cdk.IResource {
* Usually, you won't need to define the mapping yourself. This will usually be done by
* event sources. For example, to add an SQS event source to a function:
*
* import { SqsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';
* lambda.addEventSource(new SqsEventSource(sqs));
* ```ts
* import * as sqs from 'aws-cdk-lib/aws-sqs';
* import * as eventsources from 'aws-cdk-lib/aws-lambda-event-sources';
*
* declare const handler: lambda.Function;
* declare const queue: sqs.Queue;
*
* handler.addEventSource(new eventsources.SqsEventSource(queue));
* ```
*
* The `SqsEventSource` class will automatically create the mapping, and will also
* modify the Lambda's execution role so it can consume messages from the queue.
Expand Down

0 comments on commit 1f8acc1

Please sign in to comment.