curious if in pulumi i can lazily update propertie...
# general
b
curious if in pulumi i can lazily update properties? for example i would like to create a lambda function but then update its environment inside an
all
callback since the AWS API supports an update i know i can do it all in one step and this isn't a very declarative question but i'm working on something lower level that would benefit from this
b
It’s not currently possible but we’re trying to work out a way of doing this because it allows us to do circular dependencies
But as you say, it’s not very declarative which makes it hard
b
yeah the circular dependency was actually the reason i asked
i guess in my case i can create a resource called UpdateFunctionEnv which handles this right
b
Can you do it from the command line?
b
sorry not following, do what?
b
it’s a bit… hacky… but if you can update the environment using the AWS CLI then we have the command provider for this: https://www.pulumi.com/registry/packages/command/ but it might be a workaround
What would your
UpdateFunctionEnv
do?
b
ah yeah i could use that
i would basically just want to run the
UpdateFunctionConfiguration
aws-sdk v3 command
w
Yeah - the
Command
package is probably the best way to go for now. That will ensure you can control the lifecycle of these additional actions as part of the CRUD lifecycle (unlike with
apply
which just runs on every update). We would love in the future to allow something like Command but with callbacks you can implement directly in code (as callbacks invoked on Create/Update/Delete), so that you could just use the SDK directly instead of having an AWS CLI dependency. There's some other discussion on future opportunities in this direction in https://github.com/pulumi/pulumi/issues/3021, https://github.com/pulumi/pulumi/issues/13999 and https://www.pulumi.com/blog/exploring-circular-dependencies/.
b
gotcha makes sense i'll poke through those
giving some tools for circular deps would be major - one of our biggest places we have hacks in CDK
Command and a dynamic provider are roughly the same solution in this case right? i wanted to avoid spawning a new process