https://pulumi.com logo
Title
a

adamant-translator-31969

03/29/2021, 4:21 PM
Hi ... I have a question. I have a previously created resource but I want to later modify an attribute within another function passing the resource as an argument. Is there a mechanism for this?
l

little-cartoon-10569

03/29/2021, 7:35 PM
Since they're in the same project and stack, there's nothing special needed. Resources are just objects in your chosen language, pass them just like other object parameters.
a

adamant-translator-31969

03/29/2021, 8:26 PM
@little-cartoon-10569 This function is in another project called UpgradeEks ... and my EKS was created previously , I want to do this
function updateVersion(eks:aws.eks.Cluster){
    eks.version = "1.17";
      .....
}
l

little-cartoon-10569

03/29/2021, 8:32 PM
There is no "update" action in Pulumi. It's a desired state configuration system. You change your code to describe the resource (in the resource's constructor), and Pulumi makes it happen.
Conditionally changing a resource is possible (construct it in branches of a conditional), but strongly discouraged.
a

adamant-translator-31969

03/29/2021, 10:17 PM
@little-cartoon-10569 ok! Thank you for your help
👍 1