in the `pulumi-eks` if i have defined a `NodeAmiId...
# aws
a
in the
pulumi-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
Copy code
~ 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"
m
ignoreChanges
behaves differently for component resources:
The
ignoreChanges
resource option does not apply to inputs to component resources. If
ignoreChanges
is passed to a component resource, it is up to that component’s implementation to decide what if anything it will do.
So 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 of
Cluster
here: https://github.com/pulumi/pulumi-eks/blob/master/nodejs/eks/cluster/cluster.ts
a
hm, that file is not the same as this file https://github.com/pulumi/pulumi-eks/blob/master/sdk/go/eks/cluster.go ? or is it
m
No, it's not the same. What you link is the SDK, and I linked the implementation. Your file just contains the Go interface.
a
so the implementation is always typescript?
like i can find the implementation in nodejs/** of the repo
seems they dont care about ignorechanges no
q
You can use the
transforms
resource option on the component to set the
ignoreChanges
on the launch template: https://www.pulumi.com/docs/iac/concepts/options/transforms/
m
It's not always TypeScript, I think. I've never looked into the precise mechanics of how it works, but there's something called https://www.pulumi.com/crosscode/, in particular https://github.com/pulumi/pulumi/tree/master/pkg/codegen, that allows to translate between languages. Packages like
pulumi-eks
are usually implemented in one language, and then made available in all others.
q
And yes, the awsx, apigateway and eks component providers are using Node.js and you can interact with them using your favorite language. Usually the repos have a root level directory called
sdk
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
directory
a
seems this worked nice
Copy code
func(_ 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
	}