diff --git a/content/docs/concepts/options/transformations.md b/content/docs/concepts/options/transformations.md index 3efac417c657..68871c4b3756 100644 --- a/content/docs/concepts/options/transformations.md +++ b/content/docs/concepts/options/transformations.md @@ -211,11 +211,22 @@ public class MyStack : Stack private static ResourceTransformationResult? MyTransformation(ResourceTransformationArgs args) { - // ... + var tagProperty = args.Args.GetType().GetProperty("Tags"); + if (tagProperty != null) { + var currentResourceTags = (InputMap)tagProperty.GetValue(args.Args, null) ?? new InputMap(); + currentResourceTags["env"] = "production"; + tagProperty.SetValue(args.Args, currentResourceTags, null); + return new ResourceTransformationResult(args.Args, (CustomResourceOptions)args.Options); + } + return null; } } ``` +{{% notes type="warning" %}} +It is not currently possible to use stack level transformations in .NET when using a top-level async program. We have an [open issue](https://github.com/pulumi/pulumi-dotnet/issues/202) regarding this feature that you can follow to find out more information. +{{% /notes %}} + {{% /choosable %}} {{% choosable language java %}}