https://pulumi.com logo
#getting-started
Title
# getting-started
e

elegant-gigabyte-8733

10/20/2023, 6:35 PM
I have a weird one, I am trying to reference an existing ECR Repository:
Copy code
const ecrRepository = aws.ecr.getRepository({
  name: 'stream-accounts-receivable-driver',
});
But as part of the plan it wants to delete this repository:
b

billowy-army-68599

10/20/2023, 7:29 PM
did you previously define the repo in the code? what happened before you added that
getRepository
method?
e

elegant-gigabyte-8733

10/21/2023, 2:30 AM
Good question. Previously it was defined in this code, but then the definition was removed to do
getRepository
because this is used in multiple stacks. But my guess is because it was defined here it needs to stay that way otherwise the plan will try to delete it?
b

billowy-army-68599

10/21/2023, 4:28 AM
You just need to remove it from state. Run pulumi stack —show-urns to find its urn. Then do pulumi state delete to remove it
e

elegant-gigabyte-8733

10/21/2023, 8:05 PM
Thanks @billowy-army-68599