BucketObject
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.
Create a BucketObject Resource
new BucketObject(name: string, args: BucketObjectArgs, opts?: CustomResourceOptions);def BucketObject(resource_name, opts=None, bucket=None, cache_control=None, content=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, detect_md5hash=None, metadata=None, name=None, source=None, storage_class=None, __props__=None);func NewBucketObject(ctx *Context, name string, args BucketObjectArgs, opts ...ResourceOption) (*BucketObject, error)public BucketObject(string name, BucketObjectArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args BucketObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BucketObjectArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketObjectArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
BucketObject Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The BucketObject resource accepts the following input properties:
- Bucket string
The name of the containing bucket.
- Cache
Control string 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 string
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- Content
Disposition string Content-Disposition of the object data.
- Content
Encoding string Content-Encoding of the object data.
- Content
Language string Content-Language of the object data.
- Content
Type string Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- Detect
Md5hash string - Metadata Dictionary<string, string>
User-provided metadata, in key/value pairs.
- Name string
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- Source
Asset
Or Archive A path to the data you want to upload. Must be defined if
contentis not.- Storage
Class string The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
- Bucket string
The name of the containing bucket.
- Cache
Control string 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 string
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- Content
Disposition string Content-Disposition of the object data.
- Content
Encoding string Content-Encoding of the object data.
- Content
Language string Content-Language of the object data.
- Content
Type string Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- Detect
Md5hash string - Metadata map[string]string
User-provided metadata, in key/value pairs.
- Name string
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- Source
pulumi.
Asset Or Archive A path to the data you want to upload. Must be defined if
contentis not.- Storage
Class string The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
- bucket string
The name of the containing bucket.
- cache
Control string 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 string
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- content
Disposition string Content-Disposition of the object data.
- content
Encoding string Content-Encoding of the object data.
- content
Language string Content-Language of the object data.
- content
Type string Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- detect
Md5hash string - metadata {[key: string]: string}
User-provided metadata, in key/value pairs.
- name string
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- source
pulumi.asset.
Asset | pulumi.asset. Archive A path to the data you want to upload. Must be defined if
contentis not.- storage
Class string The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
- bucket str
The name of the containing bucket.
- cache_
control str 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 str
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- content_
disposition str Content-Disposition of the object data.
- content_
encoding str Content-Encoding of the object data.
- content_
language str Content-Language of the object data.
- content_
type str Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- detect_
md5hash str - metadata Dict[str, str]
User-provided metadata, in key/value pairs.
- name str
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- source
Union[pulumi.
Asset, pulumi. Archive] A path to the data you want to upload. Must be defined if
contentis not.- storage_
class str The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketObject resource produces the following output properties:
- Crc32c string
(Computed) Base 64 CRC32 hash of the uploaded data.
- Id string
- The provider-assigned unique ID for this managed resource.
- Md5hash string
(Computed) Base 64 MD5 hash of the uploaded data.
- Output
Name string (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- Self
Link string (Computed) A url reference to this object.
- Crc32c string
(Computed) Base 64 CRC32 hash of the uploaded data.
- Id string
- The provider-assigned unique ID for this managed resource.
- Md5hash string
(Computed) Base 64 MD5 hash of the uploaded data.
- Output
Name string (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- Self
Link string (Computed) A url reference to this object.
- crc32c string
(Computed) Base 64 CRC32 hash of the uploaded data.
- id string
- The provider-assigned unique ID for this managed resource.
- md5hash string
(Computed) Base 64 MD5 hash of the uploaded data.
- output
Name string (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- self
Link string (Computed) A url reference to this object.
- crc32c str
(Computed) Base 64 CRC32 hash of the uploaded data.
- id str
- The provider-assigned unique ID for this managed resource.
- md5hash str
(Computed) Base 64 MD5 hash of the uploaded data.
- output_
name str (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- self_
link str (Computed) A url reference to this object.
Look up an Existing BucketObject Resource
Get an existing BucketObject resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: BucketObjectState, opts?: CustomResourceOptions): BucketObjectstatic get(resource_name, id, opts=None, bucket=None, cache_control=None, content=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, crc32c=None, detect_md5hash=None, md5hash=None, metadata=None, name=None, output_name=None, self_link=None, source=None, storage_class=None, __props__=None);func GetBucketObject(ctx *Context, name string, id IDInput, state *BucketObjectState, opts ...ResourceOption) (*BucketObject, error)public static BucketObject Get(string name, Input<string> id, BucketObjectState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Bucket string
The name of the containing bucket.
- Cache
Control string 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 string
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- Content
Disposition string Content-Disposition of the object data.
- Content
Encoding string Content-Encoding of the object data.
- Content
Language string Content-Language of the object data.
- Content
Type string Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- Crc32c string
(Computed) Base 64 CRC32 hash of the uploaded data.
- Detect
Md5hash string - Md5hash string
(Computed) Base 64 MD5 hash of the uploaded data.
- Metadata Dictionary<string, string>
User-provided metadata, in key/value pairs.
- Name string
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- Output
Name string (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- Self
Link string (Computed) A url reference to this object.
- Source
Asset
Or Archive A path to the data you want to upload. Must be defined if
contentis not.- Storage
Class string The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
- Bucket string
The name of the containing bucket.
- Cache
Control string 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 string
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- Content
Disposition string Content-Disposition of the object data.
- Content
Encoding string Content-Encoding of the object data.
- Content
Language string Content-Language of the object data.
- Content
Type string Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- Crc32c string
(Computed) Base 64 CRC32 hash of the uploaded data.
- Detect
Md5hash string - Md5hash string
(Computed) Base 64 MD5 hash of the uploaded data.
- Metadata map[string]string
User-provided metadata, in key/value pairs.
- Name string
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- Output
Name string (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- Self
Link string (Computed) A url reference to this object.
- Source
pulumi.
Asset Or Archive A path to the data you want to upload. Must be defined if
contentis not.- Storage
Class string The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
- bucket string
The name of the containing bucket.
- cache
Control string 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 string
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- content
Disposition string Content-Disposition of the object data.
- content
Encoding string Content-Encoding of the object data.
- content
Language string Content-Language of the object data.
- content
Type string Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- crc32c string
(Computed) Base 64 CRC32 hash of the uploaded data.
- detect
Md5hash string - md5hash string
(Computed) Base 64 MD5 hash of the uploaded data.
- metadata {[key: string]: string}
User-provided metadata, in key/value pairs.
- name string
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- output
Name string (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- self
Link string (Computed) A url reference to this object.
- source
pulumi.asset.
Asset | pulumi.asset. Archive A path to the data you want to upload. Must be defined if
contentis not.- storage
Class string The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
- bucket str
The name of the containing bucket.
- cache_
control str 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 str
Data as
stringto be uploaded. Must be defined ifsourceis not. Note: Thecontentfield is marked as sensitive.- content_
disposition str Content-Disposition of the object data.
- content_
encoding str Content-Encoding of the object data.
- content_
language str Content-Language of the object data.
- content_
type str Content-Type of the object data. Defaults to “application/octet-stream” or “text/plain; charset=utf-8”.
- crc32c str
(Computed) Base 64 CRC32 hash of the uploaded data.
- detect_
md5hash str - md5hash str
(Computed) Base 64 MD5 hash of the uploaded data.
- metadata Dict[str, str]
User-provided metadata, in key/value pairs.
- name str
The name of the object. If you’re interpolating the name of this object, see
output_nameinstead.- output_
name str (Computed) The name of the object. Use this field in interpolations with
gcp.storage.ObjectACLto recreategcp.storage.ObjectACLresources when yourgcp.storage.BucketObjectis recreated.- self_
link str (Computed) A url reference to this object.
- source
Union[pulumi.
Asset, pulumi. Archive] A path to the data you want to upload. Must be defined if
contentis not.- storage_
class str The StorageClass of the new bucket object. Supported values include:
MULTI_REGIONAL,REGIONAL,NEARLINE,COLDLINE. If not provided, this defaults to the bucket’s default storage class or to a standard class.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.