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

faint-motherboard-95438

01/28/2019, 4:40 PM
Hi there, I’m managing a few static objects in my google bucket with pulumi (https://www.terraform.io/docs/providers/google/r/storage_bucket_object.html) but I just hit a problem when my source object is updated, pulumi does not detect the file has changed and does not update it. How should I manage it so that it knows the source file has changed (maybe with a md5 or something) ?
g

gentle-diamond-70147

01/28/2019, 5:09 PM
Hey Richard, can you share your code? I just tested this with setting
content
in-line in my
gcp.storage.BucketObject
and when I change the content value, Pulumi detects this and modifies the content of the file in the google bucket.
f

faint-motherboard-95438

01/28/2019, 7:42 PM
hey @gentle-diamond-70147, I should have add that I use the
source
param, not the
content
one
so my path for
source
is the same, but the file content/md5 is definitely not
g

gentle-diamond-70147

01/28/2019, 7:46 PM
Gotcha. Ok, let me try that.
Can you share the code snippet where you're creating the
gcp.storage.BucketObject
? I'm not seeing what you describe (but am seeing something different), so want to make sure I'm using it the same way you are.
f

faint-motherboard-95438

01/28/2019, 8:44 PM
sure :
Copy code
args.objects.forEach(object => {
      const assetName = path.basename(object, path.extname(object))
      new gcp.storage.BucketObject(
        `${name}-${assetName}`,
        {
          bucket: this.bucket.name,
          name: path.basename(object),
          source: object,
        },
        { 
          parent: this,
          dependsOn: this.bucket,
        },
      )
    })
where : -
args.objects
is an array of absolute path of files on the local filesystem - we are in the constructor of a
pulumi.ComponentResource
extended class and giving the first object creation works fine, only a change in the file is basically invisible (no error nor update reported)
g

gentle-diamond-70147

01/28/2019, 8:52 PM
Hmm, yea, just seems like a bug. Do you mind opening an issue at https://github.com/pulumi/pulumi-gcp?
I'm seeing the same with your code fwiw.
f

faint-motherboard-95438

01/28/2019, 8:52 PM
sure, thanks for your help, I’ll open an issue