https://pulumi.com logo
#golang
Title
# golang
a

ambitious-furniture-60362

12/21/2018, 10:19 PM
Another noisy question, should I make explicit dependences between
ObjectACL
and
BucketObject
in that case how I should proceed ? Thanks 🙂
Copy code
Previewing destroy (gcp-go-dev):

 -  gcp:storage:ObjectACL indexAllUsers delete
 -  gcp:storage:Bucket pulumibucket delete
 -  gcp:storage:BucketObject index.html delete
 -  pulumi:pulumi:Stack pulumi-poc-gcp-go-dev delete

Resources:
    4 changes
    - 4 to delete

Destroying (gcp-go-dev):

 -  gcp:storage:Bucket pulumibucket deleting
 -  gcp:storage:BucketObject index.html deleting
 -  gcp:storage:ObjectACL indexAllUsers deleting
 -  gcp:storage:BucketObject index.html deleted
 -  gcp:storage:ObjectACL indexAllUsers deleting error: Plan apply failed: deleting urn:pulumi:gcp-go-dev::pulumi-poc::gcp:storage/objectACL:ObjectACL::indexAllUsers: Error deleting entity allUsers ACL: googleapi: Error 404: No such object: my-bucket-pulumi-poc-olopez/index.html, notFound
 -  gcp:storage:ObjectACL indexAllUsers **deleting failed** error: Plan apply failed: deleting urn:pulumi:gcp-go-dev::pulumi-poc::gcp:storage/objectACL:ObjectACL::indexAllUsers: Error deleting entity allUsers ACL: googleapi: Error 404: No such object: my-bucket-pulumi-poc-olopez/index.html, notFound
 -  gcp:storage:Bucket pulumibucket deleting error: Plan apply failed: transport is closing
 -  gcp:storage:Bucket pulumibucket **deleting failed** error: Plan apply failed: transport is closing
    pulumi:pulumi:Stack pulumi-poc-gcp-go-dev
w

white-balloon-205

12/21/2018, 10:26 PM
Something along the lines of this perhaps:
Copy code
if _, err := s3.NewBucketObject(ctx, name, &s3.BucketObjectArgs{
				Bucket:      siteBucket.ID(),                      // reference to the s3.Bucket object
				Source:      asset.NewFileAsset(filePath),         // use FileAsset to point to a file
				ContentType: mime.TypeByExtension(path.Ext(name)), // set the MIME type of the file
			}, pulumi.ResourceOpt{DependsOn: []pulumi.Resource{acl}}); err != nil {
				return err
			}
Thus
DependsOn
is only needed when the dependency is not explicit. I think this is indeed a case where the objects depend on the ACL implicitly and so the dependency does need to be provided via
DependsOn
.
a

ambitious-furniture-60362

12/22/2018, 6:14 PM
👍 makes sense
thanks again
3 Views