Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda event sources can't be added as disabled when using add_event_source method #5750

Closed
DrLuke opened this issue Jan 10, 2020 · 2 comments · Fixed by #10927
Closed

Lambda event sources can't be added as disabled when using add_event_source method #5750

DrLuke opened this issue Jan 10, 2020 · 2 comments · Fixed by #10927
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on. p2

Comments

@DrLuke
Copy link

DrLuke commented Jan 10, 2020

I'd like to add event sources to my lambda functions and have them be disabled on creation. This is currently not possible with the add_event_source method.

Use Case

It should be possible to create event sources set to disabled.

Proposed Solution

Currently you add event sources like this:

my_lambda_function.add_event_source(
    SqsEventSource(my_queue)
)

An optional argument could be added that will be passed down to the EventSourceMapping that is created by the method:

my_lambda_function.add_event_source(
    SqsEventSource(my_queue),
    enabled=True
)

Same should be done for the other arguments defined in EventSourceMappingOptions:

  • batch_size
  • max_batching_window
  • starting_position

Other

This might be a good first issue candidate.


This is a 🚀 Feature Request

@DrLuke DrLuke added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 10, 2020
@SomayaB SomayaB added the @aws-cdk/aws-lambda Related to AWS Lambda label Jan 13, 2020
@nija-at
Copy link
Contributor

nija-at commented Feb 4, 2020

Requries the implementation of Enabled property

@nija-at nija-at added effort/small Small work item – less than a day of effort good first issue Related to contributions. See CONTRIBUTING.md and removed needs-triage This issue or PR still needs to be triaged. labels Feb 4, 2020
zeynepsu pushed a commit to zeynepsu/aws-cdk that referenced this issue Mar 2, 2020
…pping options parameter to supported event sources in Lambda

closes aws#5750
zeynepsu pushed a commit to zeynepsu/aws-cdk that referenced this issue Mar 2, 2020
…pping options parameter to supported event sources in Lambda

closes aws#5750
zeynepsu pushed a commit to zeynepsu/aws-cdk that referenced this issue Mar 2, 2020
…pping options parameter to supported event sources in Lambda

closes aws#5750
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Mar 2, 2020
@nija-at nija-at added p2 and removed in-progress This issue is being actively worked on. labels Aug 18, 2020
wtho added a commit to wtho/aws-cdk that referenced this issue Oct 17, 2020
Specifically, it enables this flag in the props of which resources use
an underlying Cfn EventSourceMapping, which carries the Enabled flag
itself.
These are currently: SQS, DynamoDb Streams and Kinesis.

Closes aws#5750
wtho added a commit to wtho/aws-cdk that referenced this issue Oct 17, 2020
Specifically, it enables this flag in the props of which resources use
an underlying Cfn EventSourceMapping, which carries the Enabled flag
itself.
These are currently: SQS, DynamoDb Streams and Kinesis.

Closes aws#5750
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label Oct 19, 2020
wtho added a commit to wtho/aws-cdk that referenced this issue Oct 21, 2020
Specifically, it enables this flag in the props of which resources use
an underlying Cfn EventSourceMapping, which carries the Enabled flag
itself.
These are currently: SQS, DynamoDb Streams and Kinesis.

Closes aws#5750
wtho added a commit to wtho/aws-cdk that referenced this issue Oct 21, 2020
Specifically, it enables this flag in the props of which resources use
an underlying Cfn EventSourceMapping, which carries the Enabled flag
itself.
These are currently: SQS, DynamoDb Streams and Kinesis.

Closes aws#5750
@mergify mergify bot closed this as completed in #10927 Oct 23, 2020
mergify bot pushed a commit that referenced this issue Oct 23, 2020
Specifically, it enables this flag in the props of which resources use
an underlying Cfn EventSourceMapping, which carries the Enabled flag
itself.
These are currently: SQS, DynamoDb Streams and Kinesis.

MSK is also listed in the Cfn Docs, but I could not find MSK in `lambda-event-sources`.

Closes #5750

- [X] Added Unit Tests
- [X] Documented addition in `README.md`

This change is not breaking.

I did not add integration tests so far, but could write some if required.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda Related to AWS Lambda effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. good first issue Related to contributions. See CONTRIBUTING.md in-progress This issue is being actively worked on. p2
Projects
None yet
3 participants