-
Notifications
You must be signed in to change notification settings - Fork 155
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
pulumi refresh shows diff in the code property of a Lambda function even though nothing has changed #3548
Comments
I believe this is imminent given how Pulumi implements passing things to AWS provider. Ref: pulumi-aws/provider/resources.go Lines 2165 to 2192 in c9a0980
That chunk would always transform whatever we feed into A potential workaround (applicable for lambda functions only I think) is to create the function from S3 object and not convert it to a zip file upon refresh. I would assume the first part already works (as one can specify |
This issue isn't unique to Lambda, it occurs for any Asset/Archive usage. As noted above, #1521 is an example of the same issue with S3 BucketObject. |
@lukehoban Any update for this? Any plans when this will be fixed? |
Any update on this pls? Still running into similar issues. |
Just bumping into this myself, and indeed I believe the impact is not just cosmetic but this results in invalid Pulumi state especially if multiple boxes are cooperating on the same Pulumi statefile. I believe this can be addressed by fixing the bridge import logic to reconcile refreshes for assets and archives that are not physically changing. |
Fixes #1595, https://github.com/pulumi/pulumi/issues/6235 Before this change, refreshing an unchanged resource which used an Asset or an Archive resulted in polluting Pulumi state with a machine-local filename. The simplest example this is tested on is: ```typescript const exampleBucketObject = new aws.s3.BucketObject("exampleBucketObject", { key: "someobject", bucket: bucket.id, source: new pulumi.asset.FileAsset(inFile), }); ``` After this change this example refreshes correctly with no changes detected. Unfortunately this change by itself is insufficient to guarantee that these resources refresh correctly when Pulumi-tracked state is out of date with respect to the cloud state, and further work is required to make this correct for individual resources in each provider. For the example above, the upstream provider for BucketObject does not implement fetching contents of the object upon Read into a temporary file. Therefore refreshing the object in this situation updates the "etag" property but does not guide the user to the need of reconciling the FileAsset with the updated cloud state.
Checking up on this using aws-6.24.0:
|
The refresh is still not empty but it is much more benign and the original issue is fixed I believe. #2246 has a good explanation and discussion on why we still get a non-empty refresh here. |
I think we should close the issue as stated should be fixed now, however there's a few possibilities for future work here. Specifically this fixes refresh of unchanged lambda. If the code of the lambda changes in the cloud it's another matter. @v-the-cmd comments hold I think - Assets and Archives are a "one way" mechanism and Pulumi import never creates them on import. We have #3376 to delve into this further someday and cross-compare with TF behavior. |
Expected Behavior
No diff in the
code
property if the Lambda function body really hasn't changed.Current Behavior
When I ran a
pulumi refresh
for a stack that has Lambda functions deployed, I saw a diff similar to this.Steps to Reproduce
examples
repo.pulumi up
pulumi refresh
and see thedetails
when the "confirmation to proceed" pops upContext (Environment)
Note that I observed this with Node.js functions and have not tried the other Lambda runtimes.
Pat and Luke said this sounds like it is an "artifact of the rendering", if that's helpful in triaging this.
Node version: v14.15.3
Pulumi CLI version: v2.19.0
package.json
The text was updated successfully, but these errors were encountered: