pulumi/sdk/dotnet/Pulumi
Pat Gavlin ece9f2fb30
[sdk/{go,dotnet] Unmarshal invalid assets. (#7579)
The two more strongly-typed Pulumi SDKs curently fail with an error
during unmarshaling when attempting to marshal a value that is not an
asset into an asset-typed location (e.g. an asset-typed resource
output property). While this behavior is reasonable on its face, it
gives rise to practical challenges when dealing with TF-provider-backed
resources that have asset-typed properties. When such a resource is
refreshed, the values of its asset-typed properties are replaced with
non-asset values, as the TF bridge can't currently create a resonable
stand-in asset value.

For example, consider an S3 bucket object:

```
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const bucket = new aws.s3.Bucket("my-bucket");
new aws.s3.BucketObject("my-object", {
    source: new pulumi.FileAsset("some/file"),
});
```

Upon creation, the value of the input property `source` will be a file
asset backed by the path `some/file`. The bridge will propagate this
value to the `source` output property; this propagation is safe because
the resource was just created and so the output property must have the
value that was passed by the program.

Now, let some actor apply out-of-band changes to the contents of the
bucket object s.t. the `source` property changes when the object is
refreshed. In that case, the `source` property will be a string value
which the bridge is unable to interpret as an asset. The next time the
Pulumi program is run, the Go or .NET SDK will attempt to deserialize
the string into an asset-typed property and will fail.

With these changes, the deserialization would not fail, and would
instead create an asset or archive value that will fail to marshal if
passed to another resource. Users can avoid these errors by not passing
asset or archive outputs to other resources/stack outputs.

These changes unblock users who are hitting
https://github.com/pulumi/pulumi-aws/issues/1521.
2021-07-21 13:40:36 -07:00
..
Core [sdk/{go,dotnet] Unmarshal invalid assets. (#7579) 2021-07-21 13:40:36 -07:00
Deployment [sdk] Wait on remote component dependencies (#7541) 2021-07-16 16:11:34 -07:00
Exceptions [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
Resources [sdk] Wait on remote component dependencies (#7541) 2021-07-16 16:11:34 -07:00
Serialization [sdk/{go,dotnet] Unmarshal invalid assets. (#7579) 2021-07-21 13:40:36 -07:00
Testing [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
AssemblyAttributes.cs [Automation API] - C# Implementation (#5761) 2021-02-18 11:36:21 +01:00
Config.cs [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
Config_Exceptions.cs [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
Extensions.cs [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
Log.cs Fix docstring on node log.error and other SDK equivalents (#6573) 2021-03-18 13:57:10 -04:00
PublicAPI.Shipped.txt [dotnet/sdk] Add create unknown to output utilities (#7173) 2021-06-10 10:54:16 -04:00
PublicAPI.Unshipped.txt Add replaceOnChanges resource option (#7226) 2021-07-01 13:32:08 -06:00
Pulumi.csproj Support microsoft logging extensions with inline programs (#7117) 2021-06-10 23:06:57 -04:00
Stack.cs [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00