-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
ApiGateway LambdaRestApi doesn't allow overriding default integration properties #3269
Comments
Hey @mb-dev, If I understand correctly, you want to assign a credentials role to the lambda handling the requests from the API. Please let me know if this solves your problem! |
@NGL321 A handler role and integration credentials role are different. I have a role assigned to the handler and that is correctly assigned to the lambda itself. However the credentials role defined in the integration allows api gateway to launch the lambda, and needs to have service principal of "apigateway.amazonaws.com" with invoke lambda permissions. So that doesn't solve the problem. |
Reading more in the docs - should I use permissions on the lambda instead? |
Hey! I'm having the same issue but with a twist. I was trying to pass an integration to the default integration because I really need cache to be based on the query parameters (using cacheKeyParameters on the options of this integration, which is not available on LamdaRestApi options). |
i ended up using the plain RestApi. You can look at the code to see what LambdaRestApi does and apply it manually. This seems to be the issue on many constructs that provide specialized behavior. For example ECSCluster addCapacity doesn't allow to specify iam role, or key name for the auto scaling group. Want a role? define auto scaling group yourself then use addAutoScalingGroup. |
This is really an issue for me too, we want to use a custom lambda integration that has a VpcLink to our own Vpc but I get this warning |
This should be easy to add. It would require modifying |
@nija-at This sounds like a good first issue for me as I've used CDK with ApiGateway heavily. I'm happy to take a look |
All yours @gustakasn0v |
This adds an `integrationOptions` field to the `LambdaRestApiProps` and ensures that `proxy` cannot be set differently from the base `proxy` flag (but discourages setting it at all). This will allow setting the `cacheKeyParameters`, `allowTestInvoke`, and `vpcLink` configuration fields without having to fall back to using a regular `RestApi`. Some of this is inspired by #12004 and its review comments, which was closed earlier this year due to inactivity. Resolves: #3269 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…17065) This adds an `integrationOptions` field to the `LambdaRestApiProps` and ensures that `proxy` cannot be set differently from the base `proxy` flag (but discourages setting it at all). This will allow setting the `cacheKeyParameters`, `allowTestInvoke`, and `vpcLink` configuration fields without having to fall back to using a regular `RestApi`. Some of this is inspired by aws#12004 and its review comments, which was closed earlier this year due to inactivity. Resolves: aws#3269 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.
I'm submitting a ...
What is the current behavior?
If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce
When defining LambdaRestApi I am unable to assign credentials role to the lambda. Only handler can be passed: https://github.com/awslabs/aws-cdk/blob/master/packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts#L51
I should be able to assign credentialsRole or other integration properties.
When users are introduced to apigateway constructs are going to choose lambda rest api naturally when having a lambda handler. However they will soon find they can't override any props on the integration (https://github.com/awslabs/aws-cdk/blob/master/packages/@aws-cdk/aws-apigateway/lib/lambda-api.ts#L46) and will need to switch to a regular RestApi.
Please tell us about your environment:
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
The text was updated successfully, but these errors were encountered: