adamant-father-26302
02/19/2025, 11:11 AMpulumi-eks if i have defined a NodeAmiId , but change that later, but i want existing clusters to ignore that.
I would use pulumi.ignoreChanges, but it doesnt seem to work. ive tried all these pulumi.IgnoreChanges([]string{"nodeAmiId", "imageId", "NodeAmiId", "nodeGroupOptions.amiId", "launchTemplate.imageId"})
But it still wants to change
~ aws:ec2/launchTemplate:LaunchTemplate: (update)
[id=lt-091964d05fd3c43a2]
[urn=urn:pulumi:euc3::aws-cluster-0-stage::fiveten:eksspotcluster:EksSpotClusterComponent$eks:index:Cluster$aws:ec2/launchTemplate:LaunchTemplate::cluster-0-stage-3-eks-cluster-launchTemplate]
[provider=urn:pulumi:euc3::aws-cluster-0-stage::pulumi:providers:aws::default_6_66_1::361cbfc3-4b21-41dc-98c2-ff7641c55608]
~ imageId: "ami-08637badb83cf6722" => "ami-09cf35b5ff1dee8ed"modern-zebra-45309
02/19/2025, 11:19 AMignoreChanges behaves differently for component resources:
TheSo you'd have to figure out if the resource options you provide are passed down to the launch template, and how exactly that happens. You can see the implementation ofresource option does not apply to inputs to component resources. IfignoreChangesis passed to a component resource, it is up to that component’s implementation to decide what if anything it will do.ignoreChanges
Cluster here: https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/cluster/cluster.tsadamant-father-26302
02/19/2025, 11:26 AMmodern-zebra-45309
02/19/2025, 11:28 AMadamant-father-26302
02/19/2025, 11:30 AMadamant-father-26302
02/19/2025, 11:31 AMadamant-father-26302
02/19/2025, 11:31 AMquick-house-41860
02/19/2025, 11:35 AMtransforms resource option on the component to set the ignoreChanges on the launch template: https://www.pulumi.com/docs/iac/concepts/options/transforms/modern-zebra-45309
02/19/2025, 11:35 AMpulumi-eks are usually implemented in one language, and then made available in all others.quick-house-41860
02/19/2025, 11:39 AMsdk that houses the sdks and then the actual provider implementation is in a different directory (but there's no common patterns for that).
Kilian is right that for eks it's the nodejs directoryadamant-father-26302
02/19/2025, 11:43 AMfunc(_ context.Context, args *pulumi.ResourceTransformArgs) *pulumi.ResourceTransformResult {
if args.Type == "aws:ec2/launchTemplate:LaunchTemplate" {
args.Opts.IgnoreChanges = append(args.Opts.IgnoreChanges, "imageId")
return &pulumi.ResourceTransformResult{
Props: args.Props,
Opts: args.Opts,
}
}
return nil
}