Bucket Object
Creates a new object inside an existing bucket in Google cloud storage service (GCS). ACLs can be applied using the gcp.storage.ObjectACL
resource. For more information see the official documentation and API.
Example Usage
Example creating a public object in an existing image-store
bucket.
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.BucketObject;
import com.pulumi.gcp.storage.BucketObjectArgs;
import com.pulumi.asset.FileAsset;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var picture = new BucketObject("picture", BucketObjectArgs.builder()
.bucket("image-store")
.source(new FileAsset("/images/nature/garden-tiger-moth.jpg"))
.build());
}
}
Import
This resource does not support import.
Properties
Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
Content-Disposition of the object data.
Content-Encoding of the object data.
Content-Language of the object data.
Content-Type of the object data. Defaults to "application/octet-stream" or "text/plain; charset=utf-8".
Enables object encryption with Customer-Supplied Encryption Key (CSEK). Google documentation about CSEK. Structure is documented below.
Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any).
The resource name of the Cloud KMS key that will be used to encrypt the object.
(Computed) The name of the object. Use this field in interpolations with gcp.storage.ObjectACL
to recreate gcp.storage.ObjectACL
resources when your gcp.storage.BucketObject
is recreated.
The StorageClass of the new bucket object. Supported values include: MULTI_REGIONAL
, REGIONAL
, NEARLINE
, COLDLINE
, ARCHIVE
. If not provided, this defaults to the bucket's default storage class or to a standard class.
Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites.