Fix CreateRegisterResourceRequest
@@ -25,7 +25,7 @@ namespace Pulumi
throw new Exception("The Pulumi CLI does not support the DeletedWith option. Please update the Pulumi CLI.");
}
- var request = CreateRegisterResourceRequest(type, name, custom, remote, options);
+ var request = await CreateRegisterResourceRequest(type, name, custom, remote, options);
Log.Debug($"Preparing resource: t={type}, name={name}, custom={custom}, remote={remote}");
var prepareResult = await PrepareResourceAsync(label, resource, custom, remote, args, options).ConfigureAwait(false);
@@ -68,11 +68,15 @@ namespace Pulumi
}
}
- private static RegisterResourceRequest CreateRegisterResourceRequest(
+ private async static Task<RegisterResourceRequest> CreateRegisterResourceRequest(
string type, string name, bool custom, bool remote, ResourceOptions options)
{
var customOpts = options as CustomResourceOptions;
var deleteBeforeReplace = customOpts?.DeleteBeforeReplace;
+ var deletedWith = "";
+ if (options.DeletedWith != null) {
+ deletedWith = await options.DeletedWith.Urn.GetValueAsync("").ConfigureAwait(false);
+ }
var request = new RegisterResourceRequest
{
@@ -95,7 +99,7 @@ namespace Pulumi
},
Remote = remote,
RetainOnDelete = options.RetainOnDelete ?? false,
- DeletedWith = options.DeletedWith ?? false,
+ DeletedWith = deletedWith,
};
if (customOpts != null)
