Comments (4)
I had already created a pull request for this. But I jumped in when I thought this was a little simpler than it turned out to be. So I thought a better approach was to create an issue/socialize the change & implementation.
the main issue is getting around the fact that EvaluateExpression uses SingletonFunction. Which is fine for the existing implementation, but adding the role property can cause some confusing behavior if its not implemented correctly. The first thing I noticed was the UUID is based only on the nodejs version, so you need to also take into account the role passed in, or the first instance of SingletonFunction evaluated will prevent other roles from being used.
from aws-cdk.
Makes sense.
Before we have the fix I guess you probably can find out the IAM role of the lambda SingletonFunction and override it with your existing one. You probably can modify my sample to fit your needs:
from aws-cdk.
While workaround is possible, we still welcome and appreciate any pull requests to address this.
from aws-cdk.
#29212 is also a good example of what can go wrong. With my implementation, if you were to change the role between deployments, any currently running workflows could fail.
-
I also considered just accepting the first occurrence of EvaluateExpression wins scenario. Then as a user, you have to make sure the
role
property is set on every occurrence of EvaluateExpression in the stack. -
Another approach could be to just add the uuid to the API of EvaluateExpression. If omitted, EvaluteExpression uses the current behavior, otherwise users can force a uuid without messing with private APIs. It can still land in some non-intuitive behavior but at least the users have a public API & visibility into what the issue is + solves the issue of keeping the same lambda function through configuration updates.
-
my implemented approach of adding the role's node addr into the uuid, so each role used will create different lambda functions, but reusing a role should also reuse the Lambda function. that only solves this issue and not 29212
from aws-cdk.
Related Issues (20)
- (pipes-sources): Add MSK stream source for EventBridge pipes
- (pipes-sources): Add Self managed Apache Kafka stream source for EventBridge pipes
- (pipes-enrichments): Add API destination enrichment for EventBridge pipes
- (pipes-enrichments): Add Amazon API Gateway enrichment for EventBridge pipes
- (pipes-enrichments): Add Step Functions state machine enrichment for EventBridge pipes
- (pipes-targets): Add API destination target for EventBridge pipes
- (xray): Invalid template synthesis for X-Ray resources when using Tags.of() HOT 1
- CrossAccountZoneDelegationRecord: IAM policy propogation delay causes intermittent failures HOT 1
- (core): new tagging of existing AWS::EKS::AccessEntry resources is failing HOT 9
- rds: support for IO2 instance storage HOT 2
- aws_iam.Policy: Confusing parameter description in the Policy construct HOT 2
- codepipeline: EcsDeployAction missing ecs:TagResource HOT 2
- rds: Add support for MariaDB RDS Proxy HOT 8
- state machine : Dynamic passing of bucket and key to distributed map HOT 1
- (software.amazon.awscdk.services.lambda.Function): Recursive folder creation in cdk.out when lambda jar path is mentioned as "" HOT 1
- Personalize: Wrong attribute created in cloudformation (Python) HOT 5
- core: Over-aggressive cache fingerprinting on synthesize HOT 2
- batch: Cannot omit the start/end of target node on batch.MultiNodeContainer HOT 1
- eks: managed node group allocatable pods number error HOT 10
- ❗ NOTICE: List stack output change issue. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-cdk.