gcp logo
Google Cloud Classic v6.52.0, Mar 22 23

gcp.firebase.StorageBucket

Import

Bucket can be imported using any of these accepted formats

 $ pulumi import gcp:firebase/storageBucket:StorageBucket default projects/{{project}}/buckets/{{bucket_id}}
 $ pulumi import gcp:firebase/storageBucket:StorageBucket default {{project}}/{{bucket_id}}
 $ pulumi import gcp:firebase/storageBucket:StorageBucket default {{bucket_id}}

Example Usage

Firebasestorage Bucket Basic

using System.Collections.Generic;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var defaultBucket = new Gcp.Storage.Bucket("defaultBucket", new()
    {
        Location = "US",
        UniformBucketLevelAccess = true,
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

    var defaultStorageBucket = new Gcp.Firebase.StorageBucket("defaultStorageBucket", new()
    {
        Project = "my-project-name",
        BucketId = defaultBucket.Id,
    }, new CustomResourceOptions
    {
        Provider = google_beta,
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/firebase"
	"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		defaultBucket, err := storage.NewBucket(ctx, "defaultBucket", &storage.BucketArgs{
			Location:                 pulumi.String("US"),
			UniformBucketLevelAccess: pulumi.Bool(true),
		}, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		_, err = firebase.NewStorageBucket(ctx, "defaultStorageBucket", &firebase.StorageBucketArgs{
			Project:  pulumi.String("my-project-name"),
			BucketId: defaultBucket.ID(),
		}, pulumi.Provider(google_beta))
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.storage.Bucket;
import com.pulumi.gcp.storage.BucketArgs;
import com.pulumi.gcp.firebase.StorageBucket;
import com.pulumi.gcp.firebase.StorageBucketArgs;
import com.pulumi.resources.CustomResourceOptions;
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 defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()        
            .location("US")
            .uniformBucketLevelAccess(true)
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

        var defaultStorageBucket = new StorageBucket("defaultStorageBucket", StorageBucketArgs.builder()        
            .project("my-project-name")
            .bucketId(defaultBucket.id())
            .build(), CustomResourceOptions.builder()
                .provider(google_beta)
                .build());

    }
}
import pulumi
import pulumi_gcp as gcp

default_bucket = gcp.storage.Bucket("defaultBucket",
    location="US",
    uniform_bucket_level_access=True,
    opts=pulumi.ResourceOptions(provider=google_beta))
default_storage_bucket = gcp.firebase.StorageBucket("defaultStorageBucket",
    project="my-project-name",
    bucket_id=default_bucket.id,
    opts=pulumi.ResourceOptions(provider=google_beta))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const defaultBucket = new gcp.storage.Bucket("defaultBucket", {
    location: "US",
    uniformBucketLevelAccess: true,
}, {
    provider: google_beta,
});
const defaultStorageBucket = new gcp.firebase.StorageBucket("defaultStorageBucket", {
    project: "my-project-name",
    bucketId: defaultBucket.id,
}, {
    provider: google_beta,
});
resources:
  defaultBucket:
    type: gcp:storage:Bucket
    properties:
      location: US
      uniformBucketLevelAccess: true
    options:
      provider: ${["google-beta"]}
  defaultStorageBucket:
    type: gcp:firebase:StorageBucket
    properties:
      project: my-project-name
      bucketId: ${defaultBucket.id}
    options:
      provider: ${["google-beta"]}

Create StorageBucket Resource

new StorageBucket(name: string, args?: StorageBucketArgs, opts?: CustomResourceOptions);
@overload
def StorageBucket(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  bucket_id: Optional[str] = None,
                  project: Optional[str] = None)
@overload
def StorageBucket(resource_name: str,
                  args: Optional[StorageBucketArgs] = None,
                  opts: Optional[ResourceOptions] = None)
func NewStorageBucket(ctx *Context, name string, args *StorageBucketArgs, opts ...ResourceOption) (*StorageBucket, error)
public StorageBucket(string name, StorageBucketArgs? args = null, CustomResourceOptions? opts = null)
public StorageBucket(String name, StorageBucketArgs args)
public StorageBucket(String name, StorageBucketArgs args, CustomResourceOptions options)
type: gcp:firebase:StorageBucket
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args StorageBucketArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args StorageBucketArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args StorageBucketArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args StorageBucketArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args StorageBucketArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

StorageBucket Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The StorageBucket resource accepts the following input properties:

BucketId string

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

BucketId string

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucketId String

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucketId string

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucket_id str

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucketId String

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Outputs

All input properties are implicitly available as output properties. Additionally, the StorageBucket resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

Id string

The provider-assigned unique ID for this managed resource.

Name string

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

id string

The provider-assigned unique ID for this managed resource.

name string

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

id str

The provider-assigned unique ID for this managed resource.

name str

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

id String

The provider-assigned unique ID for this managed resource.

name String

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

Look up Existing StorageBucket Resource

Get an existing StorageBucket 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?: StorageBucketState, opts?: CustomResourceOptions): StorageBucket
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket_id: Optional[str] = None,
        name: Optional[str] = None,
        project: Optional[str] = None) -> StorageBucket
func GetStorageBucket(ctx *Context, name string, id IDInput, state *StorageBucketState, opts ...ResourceOption) (*StorageBucket, error)
public static StorageBucket Get(string name, Input<string> id, StorageBucketState? state, CustomResourceOptions? opts = null)
public static StorageBucket get(String name, Output<String> id, StorageBucketState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
BucketId string

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

Name string

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

BucketId string

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

Name string

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucketId String

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

name String

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucketId string

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

name string

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucket_id str

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

name str

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

bucketId String

Required. Immutable. The ID of the underlying Google Cloud Storage bucket

name String

Resource name of the bucket in the format projects/PROJECT_IDENTIFIER/buckets/BUCKET_ID

project String

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Package Details

Repository
Google Cloud (GCP) Classic pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.