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 S3 Event Source Custom Resource Missing Depends On #1501

Closed
moofish32 opened this issue Jan 8, 2019 · 5 comments
Closed

Lambda S3 Event Source Custom Resource Missing Depends On #1501

moofish32 opened this issue Jan 8, 2019 · 5 comments
Labels
@aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p2

Comments

@moofish32
Copy link
Contributor

When you create an S3 Event source for a lambda function the customer resource is really an in line lambda. That inline lambda does not correctly apply a depends on for the role and policy that the lambda needs. If you update and delete the lambda or notification you can find your self in a 403 error scenario.

We need to properly set those depends on in order to support updating. To verify this problem I manually updated the CFN template with depends on after receiving multiple failures.

@rix0rrr
Copy link
Contributor

rix0rrr commented Jan 9, 2019

We need to make it easier to add a dependency on an added policy. This comes up all the time.

@rix0rrr rix0rrr added pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version. @aws-cdk/core Related to core CDK functionality @aws-cdk/aws-iam Related to AWS Identity and Access Management labels Jan 9, 2019
@eladb
Copy link
Contributor

eladb commented Jan 9, 2019

We should rethink how dependencies are modeled and added (#95). I think we might be able to take a dependency on any construct which will transitively mean that you will add a dependency to all resources in that scope.

@rix0rrr
Copy link
Contributor

rix0rrr commented Jan 9, 2019

I would still prefer to do a more pin-pointed approach (depend on just the policy you added). But on the other hand, the way we arrange our policies today would effectively mean the same thing, since we lump all statements into the same policy anyway.

@eladb eladb added @aws-cdk/aws-lambda Related to AWS Lambda @aws-cdk/aws-s3 Related to Amazon S3 and removed @aws-cdk/core Related to core CDK functionality @aws-cdk/aws-iam Related to AWS Identity and Access Management @aws-cdk/aws-lambda Related to AWS Lambda pr/breaking-change This PR is a breaking change. It needs to be modified to be allowed in the current major version. labels Mar 4, 2019
@moofish32
Copy link
Contributor Author

FYI - I just hit this bug again. I had a Lambda triggered directly from S3. I needed to move to S3->SNS->Lambda so I could have multiple things listening to this path. The worst part is I get no error and the event is not put on the s3 bucket. I think we might want to find a way to at least alert the user to this problem?

@eladb eladb assigned eladb and unassigned eladb Aug 12, 2019
@SomayaB SomayaB added the bug This issue is a bug. label Oct 23, 2019
@eladb eladb added the p1 label Oct 25, 2019
@eladb eladb added p2 and removed p1 labels Nov 11, 2019
@eladb eladb assigned iliapolo and unassigned eladb Jan 22, 2020
@iliapolo iliapolo added the effort/small Small work item – less than a day of effort label Aug 29, 2020
@iliapolo iliapolo removed their assignment Jun 27, 2021
@github-actions
Copy link

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 28, 2022
@github-actions github-actions bot closed this as completed Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-s3 Related to Amazon S3 bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/small Small work item – less than a day of effort p2
Projects
None yet
Development

No branches or pull requests

5 participants