# general


05/25/2023, 11:52 PM
Hi fellow
experts and practitioners, as we implemented our
automation without interacting with
pulumi CLI
, we have encountered the following challenges. If there is any common interests in the community of going over these obstacles, we will highly appreciate anyone could share your experience about the following: • How do we import existing resources (not created by
) into an established
stack? • How do we get the physical name out of a resource instance, and use it in another resource? The name of a resource instance is a
in Python, which disallows us to use it in subsequent concatenation of building our resource naming convention. • If some
managed resources get removed/modified by someone without going through our pulumi program, how should we manage such situations and keep them in sync? Many thanks. @narrow-wall-86026 @steep-sunset-89396


05/26/2023, 12:34 AM
Hey hey Hey @delightful-jelly-17346 1. if you run
pulumi import ...
that should do it. For each resource type you'd like to import, check the documentation page and at the bottom you will usually fund the correct import syntax. 2. If you want the actual cloud resource name (ie, the physical name), you need to use one of the properties as the result of creating the resource.Look at this example and how
is used to export the actual bucket name.
On the last point, you can uncover modified resources by running
pulumi preview --refresh
which will retrieve the latest resource state from your cloud env. Then, you should either 1. patch your code to match the modified in the cloud and run the previous command above to ensure there are no changes. And then appy those changes with
pulumi up --refresh
which should also result in no changes. 2. simply run
pulumi up --refresh
to discard changes present in the cloud and use the current source code as the desired state for those resources. Pulumi will then do its best to revert those changes (ie, update the cloud resources)


05/26/2023, 12:40 AM
Thanks Aurelien, I will give them a go:)


05/31/2023, 3:57 AM
Hey Wilson, would it make sense to have a follow-up next week? You can invite the team to join the zoom if you'd like.