helpful-processor-86468
03/31/2020, 1:50 PMpulumi up
my previous bucket got deleted and the creation of new one failed. pulumi up
doesn't help. How can I solve this?billowy-army-68599
helpful-processor-86468
03/31/2020, 2:07 PMimport pulumi
from pulumi_gcp import storage
# Create a GCP resource (Storage Bucket)
bucket = storage.Bucket('pulumi_test', name='pulumi_test')
# Export the DNS name of the bucket
pulumi.export('pulumi_test', bucket.url)
after this i did pulumi up
- no errors
Second version (i did this on purpose, wanted to see what will happen):
import pulumi
from pulumi_gcp import storage
# Create a GCP resource (Storage Bucket)
bucket = storage.Bucket('pulumi_test', name='')
# Export the DNS name of the bucket
pulumi.export('pulumi_test', bucket.url)
Error recieved:
Type Name Status Info
pulumi:pulumi:Stack quickstart-dev **failed** 1 error
+- └─ gcp:storage:Bucket pulumi_test **replacing failed** [diff: ~name]; 1 error
Diagnostics:
pulumi:pulumi:Stack (quickstart-dev):
error: update failed
gcp:storage:Bucket (pulumi_test):
error: googleapi: Error 400: Empty bucket name, invalid
name
parameter, performed pulumi up
and got this error:
error: deleting urn:pulumi:dev::quickstart::gcp:storage/bucket:Bucket::pulumi_test: googleapi: Error 404: Not Found, notFound
pulumi up
and pulumi refresh
after that it finally updated the pulumi state (the state was missing information about bucket deletion which happened during replacement).pulumi up
and pulumi refresh
going to fix my state every time?
I'm trying to decide if we're going to start a new project with terraform or pulumi. I don't want to deal with corrupted state and spend hours trying to fix it manually.adorable-action-51248
03/31/2020, 2:18 PMpulumi up --refresh
helpful-processor-86468
03/31/2020, 2:19 PMadorable-action-51248
03/31/2020, 2:20 PMhelpful-processor-86468
03/31/2020, 2:23 PMpulumi up --refresh
doesnt workpulumi refresh
so it will actually catch that the bucket got deletedadorable-action-51248
03/31/2020, 2:25 PMhelpful-processor-86468
03/31/2020, 2:26 PMRefreshing (dev):
Type Name Status
pulumi:pulumi:Stack quickstart-dev
- └─ gcp:storage:Bucket pulumi_test deleted
Outputs:
pulumi_test: "<gs://pulumi_test>"
pulumi refresh
pulumi up --refresh
I get 2 unchanged resources
adorable-action-51248
03/31/2020, 2:26 PM-r, --refresh Refresh the state of the stack's resources before this update
green-school-95910
03/31/2020, 2:55 PMdeleteBeforeReplace
somewhere in your codehelpful-processor-86468
03/31/2020, 3:02 PMdeleteBeforeReplace
by defaultpulumi up
and pulumi refresh
fix my state every time?
I'd rather not spend multiple hours trying to fix the state. I saw it happen in terraform multiple times I just want to know if eventually I will encounter this using pulumi.