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

prehistoric-analyst-52684

10/03/2019, 11:07 AM
I cannot get aliases to work to migrate my resources when I move them inside component resources. I have a bunch of resources that didn't have an explicit parent. I created a component resource and moved all existing resource inside. Then I exported the stack and took the `urn`s to use in the
aliases
argument of each existing resource. When I
pulumi up
, all resources are to be recreated. I am pretty sure the urn is correct, as I am taking it from the exported stack file. Here is an example resource:
Copy code
const logGroup = new aws.cloudwatch.LogGroup(`${name}_cloudwatchLogGroup`, {}, { provider, parent: this, aliases: ["urn:pulumi:edith-lookup-feat::edith::aws:cloudwatch/logGroup:LogGroup::cloudwatchLogGroup_edith-lookup-service"] });
What am I doing wrong?
By the way, before trying `urn`s I tried using the same name, and using
[{name: oldname, parent: undefined}]
as an
aliases
argument, and those didn't work either: all attempts always result in delete and recreation of resources.
w

white-balloon-205

10/03/2019, 3:51 PM
What is the full urn of the existing resource? What is the desired urn after the migration?
Also - are you using recent versions of both the CLI and the AWS package?
p

prehistoric-analyst-52684

10/03/2019, 5:14 PM
Thank you for getting back to me, Luke. I found the problem: I have the latest version of Pulumi, but the node package was not up to date. It is working now.
👍 1
5 Views