https://pulumi.com logo
#general
Title
# general
e

echoing-actor-55539

08/03/2021, 8:50 PM
I have a Pulumi controlled AWS RDS Cluster that had a default database name of X then X got renamed directly in the cluster to Y. I have changed the default database name in my pulumi script to Y, but it still wants to replace the cluster. I have tried dumping the stack and hand editing it with new name then re-importing it, but as soon as I do a pulumi refresh the name in the stack reverts back to X and it wants to replace the cluster again. Any ideas on how I can get pulumi to understand the code and AWS are in sync in terms of database name?
g

green-stone-37839

08/03/2021, 10:54 PM
You can use the
alias
field on ResourceOptions for a component. Essentially, this will tell Pulumi you've refactored the existing resource with a different name, type, parent, etc.
g

great-sunset-355

08/04/2021, 12:11 PM
@green-stone-37839 would you be able to give me a tip how to correclty use an alias here? I tried to change the resource name and remove suffix
Ec2
, but so far none of the aliases I tried worked 😕 https://gist.github.com/1oglop1/f3c4012b281fc344b52fd570441938c2 thank you!