Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.storage.kotlin
import com.pulumi.asset.AssetOrArchive
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.storage.BucketObjectArgs.builder
import com.pulumi.gcp.storage.kotlin.inputs.BucketObjectCustomerEncryptionArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketObjectCustomerEncryptionArgsBuilder
import com.pulumi.gcp.storage.kotlin.inputs.BucketObjectRetentionArgs
import com.pulumi.gcp.storage.kotlin.inputs.BucketObjectRetentionArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* Creates a new object inside an existing bucket in Google cloud storage service (GCS).
* [ACLs](https://cloud.google.com/storage/docs/access-control/lists) can be applied using the `gcp.storage.ObjectACL` resource.
* For more information see
* [the official documentation](https://cloud.google.com/storage/docs/key-terms#objects)
* and
* [API](https://cloud.google.com/storage/docs/json_api/v1/objects).
* ## Example Usage
* Example creating a public object in an existing `image-store` bucket.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const picture = new gcp.storage.BucketObject("picture", {
* name: "butterfly01",
* source: new pulumi.asset.FileAsset("/images/nature/garden-tiger-moth.jpg"),
* bucket: "image-store",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* picture = gcp.storage.BucketObject("picture",
* name="butterfly01",
* source=pulumi.FileAsset("/images/nature/garden-tiger-moth.jpg"),
* bucket="image-store")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var picture = new Gcp.Storage.BucketObject("picture", new()
* {
* Name = "butterfly01",
* Source = new FileAsset("/images/nature/garden-tiger-moth.jpg"),
* Bucket = "image-store",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := storage.NewBucketObject(ctx, "picture", &storage.BucketObjectArgs{
* Name: pulumi.String("butterfly01"),
* Source: pulumi.NewFileAsset("/images/nature/garden-tiger-moth.jpg"),
* Bucket: pulumi.String("image-store"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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()
* .name("butterfly01")
* .source(new FileAsset("/images/nature/garden-tiger-moth.jpg"))
* .bucket("image-store")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* picture:
* type: gcp:storage:BucketObject
* properties:
* name: butterfly01
* source:
* fn::FileAsset: /images/nature/garden-tiger-moth.jpg
* bucket: image-store
* ```
*
* Example creating an empty folder in an existing `image-store` bucket.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const emptyFolder = new gcp.storage.BucketObject("empty_folder", {
* name: "empty_folder/",
* content: " ",
* bucket: "image-store",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* empty_folder = gcp.storage.BucketObject("empty_folder",
* name="empty_folder/",
* content=" ",
* bucket="image-store")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var emptyFolder = new Gcp.Storage.BucketObject("empty_folder", new()
* {
* Name = "empty_folder/",
* Content = " ",
* Bucket = "image-store",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/storage"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := storage.NewBucketObject(ctx, "empty_folder", &storage.BucketObjectArgs{
* Name: pulumi.String("empty_folder/"),
* Content: pulumi.String(" "),
* Bucket: pulumi.String("image-store"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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 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 emptyFolder = new BucketObject("emptyFolder", BucketObjectArgs.builder()
* .name("empty_folder/")
* .content(" ")
* .bucket("image-store")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* emptyFolder:
* type: gcp:storage:BucketObject
* name: empty_folder
* properties:
* name: empty_folder/
* content: ' '
* bucket: image-store
* ```
*
* ## Import
* This resource does not support import.
* @property bucket The name of the containing bucket.
* @property cacheControl [Cache-Control](https://tools.ietf.org/html/rfc7234#section-5.2)
* 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
* @property content Data as `string` to be uploaded. Must be defined if `source` is not. **Note**: The `content` field is marked as sensitive.
* @property contentDisposition [Content-Disposition](https://tools.ietf.org/html/rfc6266) of the object data.
* @property contentEncoding [Content-Encoding](https://tools.ietf.org/html/rfc7231#section-3.1.2.2) of the object data.
* @property contentLanguage [Content-Language](https://tools.ietf.org/html/rfc7231#section-3.1.3.2) of the object data.
* @property contentType [Content-Type](https://tools.ietf.org/html/rfc7231#section-3.1.1.5) of the object data. Defaults to "application/octet-stream" or "text/plain; charset=utf-8".
* @property customerEncryption Enables object encryption with Customer-Supplied Encryption Key (CSEK). Google [documentation about CSEK.](https://cloud.google.com/storage/docs/encryption/customer-supplied-keys)
* Structure is documented below.
* @property detectMd5hash
* @property eventBasedHold Whether an object is under [event-based hold](https://cloud.google.com/storage/docs/object-holds#hold-types). 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).
* @property kmsKeyName The resource name of the Cloud KMS key that will be used to [encrypt](https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys) the object.
* @property metadata User-provided metadata, in key/value pairs.
* One of the following is required:
* @property name The name of the object. If you're interpolating the name of this object, see `output_name` instead.
* @property retention The [object retention](http://cloud.google.com/storage/docs/object-lock) settings for the object. The retention settings allow an object to be retained until a provided date. Structure is documented below.
* @property source A path to the data you want to upload. Must be defined
* if `content` is not.
* - - -
* @property storageClass The [StorageClass](https://cloud.google.com/storage/docs/storage-classes) 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](https://cloud.google.com/storage/docs/storage-classes#standard) class.
* @property temporaryHold Whether an object is under [temporary hold](https://cloud.google.com/storage/docs/object-holds#hold-types). While this flag is set to true, the object is protected against deletion and overwrites.
*/
public data class BucketObjectArgs(
public val bucket: Output? = null,
public val cacheControl: Output? = null,
public val content: Output? = null,
public val contentDisposition: Output? = null,
public val contentEncoding: Output? = null,
public val contentLanguage: Output? = null,
public val contentType: Output? = null,
public val customerEncryption: Output? = null,
public val detectMd5hash: Output? = null,
public val eventBasedHold: Output? = null,
public val kmsKeyName: Output? = null,
public val metadata: Output