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

most-agency-6980

03/21/2024, 7:20 AM
I am using pulumi for importing all the current hosted instances and manage them. I am facing issue where pulumi is trying to replace all the instances. Steps to replicate: 1> Import instances using stack configuration or using gcp api (I created a functiion to import using gcp api) 2> Once Imported I manually deleted a instance using pulumi state delete (Note: this step is being done as in cases where in the severe prod issues we focus on resolving the issue so suppose we create a new instance.) 3> Now using the config I tried to import these instances then pulumi tried to replace all the instances with no Diffs and import that one instance which I deleted. Yaml.Config I am using --- config: gcpregion us-west1 import_all: false instances: - boot: name: elasticsearch-staging-1 image: https://www.googleapis.com/compute/beta/projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20230302 size: 500 counter: 1 metadata: enable-oslogin: 'true' labels: applications: elasticsearch-staging-1 machine_type: n2-standard-8 subnetwork: name name: elasticsearch service_account: email: xyz.com scopes: - https://www.googleapis.com/auth/devstorage.read_only - https://www.googleapis.com/auth/logging.write - https://www.googleapis.com/auth/service.management.readonly - https://www.googleapis.com/auth/servicecontrol - https://www.googleapis.com/auth/trace.append - https://www.googleapis.com/auth/monitoring.write zone: c
b

broad-doctor-18421

03/21/2024, 1:42 PM
I don't have experience importing resources, but from the people I talked to before getting into pulumi, they said to avoid importing if you can as it caused them a similar problem. I know this doesn't help accomplish what you set out to do. For this reason I have not imported anything.