sparse-intern-71089
03/31/2020, 1:50 PMbillowy-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
helpful-processor-86468
03/31/2020, 2:09 PMname
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
helpful-processor-86468
03/31/2020, 2:10 PMhelpful-processor-86468
03/31/2020, 2:12 PMhelpful-processor-86468
03/31/2020, 2:12 PMpulumi up
and pulumi refresh
after that it finally updated the pulumi state (the state was missing information about bucket deletion which happened during replacement).helpful-processor-86468
03/31/2020, 2:14 PMpulumi 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 PMadorable-action-51248
03/31/2020, 2:18 PMpulumi up --refresh
adorable-action-51248
03/31/2020, 2:18 PMadorable-action-51248
03/31/2020, 2:18 PMadorable-action-51248
03/31/2020, 2:18 PMhelpful-processor-86468
03/31/2020, 2:19 PMadorable-action-51248
03/31/2020, 2:20 PMadorable-action-51248
03/31/2020, 2:20 PMadorable-action-51248
03/31/2020, 2:20 PMadorable-action-51248
03/31/2020, 2:23 PMhelpful-processor-86468
03/31/2020, 2:23 PMpulumi up --refresh
doesnt workhelpful-processor-86468
03/31/2020, 2:25 PMpulumi 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>"
helpful-processor-86468
03/31/2020, 2:26 PMpulumi refresh
helpful-processor-86468
03/31/2020, 2:26 PMpulumi 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
adorable-action-51248
03/31/2020, 2:27 PMadorable-action-51248
03/31/2020, 2:27 PMgreen-school-95910
03/31/2020, 2:55 PMgreen-school-95910
03/31/2020, 2:57 PMgreen-school-95910
03/31/2020, 2:59 PMdeleteBeforeReplace
somewhere in your codehelpful-processor-86468
03/31/2020, 3:02 PMdeleteBeforeReplace
by defaulthelpful-processor-86468
03/31/2020, 3:04 PMpulumi 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.