I can't seem to figure out a way to append `cluste...
# aws
f
I can't seem to figure out a way to append
clusterTags
to existing EKS cluster, does someone have a hint?
q
What provider (and version of it) are you using? If you're using
pulumi-eks
, the tags you set in
clusterTags
should get applied to the underlying EKS cluster resource no matter if you're creating a new cluster or updating an existing one
c
Follow-up question: what if we're using the
pulumi_aws
package already instead?
q
c
Sorry, I should have made myself more clear 🙂 Due to our customer, we are forced to work with an existing
pulumi_aws.eks.Cluster
, which we obtained in our Pulumi script using the .get(...) method. We want to add a tag to the EKS cluster for our Karpenter deployment. I've already found out that we have
cluster.tags
, but changing this using
cluster.tags.apply(lambda tags: tags.update({"testMe": "testMe"}))
only changes the Pulumi state & not the tags on the actual cluster.
We managed to tag existing security groups etc. using the
pulumi_aws.ec2.Tag
class & we were wondering if something similar can be accomplished but for EKS clusters 🙂
q
I'm not aware of any
Tag
resource for EKS 😞 One option that I can think of is using the command provider to execute an aws cli script. Resources retrieved with
.get
will never be updated/deleted during an update. It's just used for fetching the resource's attributes
c
That's (almost 😉 ) the way we solved it, but we were curious if there was a better approach. Thanks for the help!
q
You could also create a dynamic resource provider for this. How did you end up solving it? 🙂
c
I didn't quite understand how the
Command
class could be used to manage the lifecycle of a tag object, so indeed I ended up using a dynamic resource & resource provider that just calls the AWS CLI to create, get (with some jq parsing) & delete the resource 🙂