-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
One lambda with two ALBs --> Error: There is already a Construct with name 'InvokeServicePrincipal(elasticloadbalancing.amazonaws.com)' in Function #8553
Labels
@aws-cdk/aws-elasticloadbalancing
Related to Amazon Elastic Load Balancing
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p1
Comments
Related to #4459 |
njlynch
added a commit
that referenced
this issue
Aug 25, 2020
If `grantInvoke()` is called twice for the same principal, the second call fails due to attempting to create two `CfnPermission` nodes with the same id. This (simple) fix skips the second creation if the node already exists. A more robust check would be to check the existing `CfnPermission`, and compare every field, skipping creation if the two are identical and throwing an error otherwise, as well as handling that in the upstream `grantInvoke` call. I opted for the simpler solution for now, but willing to take arguments for something more complex. fixes #8553
njlynch
added a commit
that referenced
this issue
Aug 25, 2020
If `grantInvoke()` is called twice for the same principal, the second call fails due to attempting to create two `CfnPermission` nodes with the same id. This (simple) fix skips the second creation if the node already exists. A more robust check would be to check the existing `CfnPermission`, and compare every field, skipping creation if the two are identical and throwing an error otherwise, as well as handling that in the upstream `grantInvoke` call. I opted for the simpler solution for now, but willing to take arguments for something more complex. I also nested the existing grantInvoke tests for future readability. fixes #8553
mergify bot
pushed a commit
that referenced
this issue
Aug 27, 2020
If `grantInvoke()` is called twice for the same principal, the second call fails due to attempting to create two `CfnPermission` nodes with the same id. This (simple) fix skips the second creation if the node already exists. A more robust check would be to check the existing `CfnPermission`, comparing every field, skipping creation if the two are identical and throwing an error otherwise, as well as handling that in the upstream `grantInvoke` call. I opted for the simpler solution for now, but willing to take arguments for something more complex. I also nested the existing grantInvoke tests for future readability. The tests weren't changed, just the last one added. fixes #8553 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I am getting same issue for apigateway , My requirement is to create two api gateway from same construct |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-elasticloadbalancing
Related to Amazon Elastic Load Balancing
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
effort/small
Small work item – less than a day of effort
in-progress
This issue is being actively worked on.
p1
The Question
When I'm trying to add one lambda function to two Application Load Balancers I'm getting this error:
This looks like a bug because there are no problems when I'm doing this in Console.
Or maybe I'm doing something wrong?
Environment
The text was updated successfully, but these errors were encountered: