It's just a way to easily filter the kind (type) of k8s resource to transform; e.g.:
Copy code
new ConfigFile($"{prefix}-ingress",
new ConfigFileArgs
{
File = "ingress-controller.yml",
Transformations =
{
(obj, opts) => obj.Mutate("Deployment", deployment =>
{
var args = (List<object>)deployment.spec.template.spec.containers[0].args;
args.AddRange(new[] { $"--aws-region={config.AwsRegion}", $"--cluster-name={name}" });
})
}
},
new ComponentResourceOptions { Provider = Provider });
To transform the k8s deployment resource
worried-city-86458
10/31/2020, 7:10 PM
While I appreciate the intention of the immutable types, the dev experience sucks. 😞
b
bored-activity-40468
10/31/2020, 8:00 PM
Got it, thanks. Yeah, I agree, your extensions help with that though. 🙂
w
worried-city-86458
11/01/2020, 1:30 AM
I recommend using kube2pulumi instead, which gives much more control, but might not be practicable for large yaml files while tracking upstream changes, depending on how much you tweak the resulting c# to your liking. 😉
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.