-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(pipes-targets): add lambda function #30271
Conversation
23db285
to
3aa03cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks good to me. I added some minor improvement ideas.
packages/@aws-cdk/aws-pipes-targets-alpha/test/integ.lambda.handler/handler.ts
Outdated
Show resolved
Hide resolved
packages/@aws-cdk/aws-pipes-targets-alpha/test/integ.lambda.handler/handler.ts
Outdated
Show resolved
Hide resolved
const app = new App(); | ||
const stack = new Stack(app, 'TestLambdaFunctionStack'); | ||
|
||
const lambdaFunction = new lambda.Function(stack, 'MyLambda', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't have to define a lambda. A string of an arn should be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? Shouldnt be the lambda be available for import? Because for the LambdaFunction#grantPush you need a reference to a lambda.IFunction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it's a unit test, Raphael is right here, you can just hardcode a fake arn and run `lambda.Function.fromFunctionArn(stack, 'MyImportedLambda', ''.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When using lambda.Function.fromFunctionArn(stack, 'MyImportedLambda', arn)
, I got following error:
Cannot modify permission to lambda function. Function is either imported or $LATEST version.
If the function is imported from the same account use `fromFunctionAttributes()` API with the `sameEnvironment` flag.
If the function is imported from a different account and already has the correct permissions use `fromFunctionAttributes()` API with the `skipPermissions` flag.
I've used the fromFunctionAttributes
with the sameEnvironment
flag. However I left the test should work with imported function
unchanged as it would not make sense to use the same import twice. An alternative would be the deletion of this test.
125f4b6
to
d9e571b
Compare
@GavinZZ whats your opinion on this PR? |
Thanks for drafting the changes and making contributions. The changes look good to me in general. A minor doc change and a question before approving. |
d9e571b
to
2ae6ddd
Compare
@gastonsilva thanks for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for updating it!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one. |
Issue # (if applicable)
Closes #30270.
Reason for this change
Lambda Function target is not supported yet by pipes-targets.
Description of changes
LambdaFunctionInvocationType.REQUEST_RESPONSE
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license