1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebase
  5. StorageBucket
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

gcp.firebase.StorageBucket

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi

    Example Usage

    Firebasestorage Bucket Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.storage.Bucket("default", {
        name: "test_bucket",
        location: "US",
        uniformBucketLevelAccess: true,
    });
    const defaultStorageBucket = new gcp.firebase.StorageBucket("default", {
        project: "my-project-name",
        bucketId: _default.id,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.storage.Bucket("default",
        name="test_bucket",
        location="US",
        uniform_bucket_level_access=True)
    default_storage_bucket = gcp.firebase.StorageBucket("default",
        project="my-project-name",
        bucket_id=default.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
    	"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.NewBucket(ctx, "default", &storage.BucketArgs{
    			Name:                     pulumi.String("test_bucket"),
    			Location:                 pulumi.String("US"),
    			UniformBucketLevelAccess: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = firebase.NewStorageBucket(ctx, "default", &firebase.StorageBucketArgs{
    			Project:  pulumi.String("my-project-name"),
    			BucketId: _default.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Gcp.Storage.Bucket("default", new()
        {
            Name = "test_bucket",
            Location = "US",
            UniformBucketLevelAccess = true,
        });
    
        var defaultStorageBucket = new Gcp.Firebase.StorageBucket("default", new()
        {
            Project = "my-project-name",
            BucketId = @default.Id,
        });
    
    });
    
    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 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 default_ = new Bucket("default", BucketArgs.builder()
                .name("test_bucket")
                .location("US")
                .uniformBucketLevelAccess(true)
                .build());
    
            var defaultStorageBucket = new StorageBucket("defaultStorageBucket", StorageBucketArgs.builder()
                .project("my-project-name")
                .bucketId(default_.id())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:storage:Bucket
        properties:
          name: test_bucket
          location: US
          uniformBucketLevelAccess: true
      defaultStorageBucket:
        type: gcp:firebase:StorageBucket
        name: default
        properties:
          project: my-project-name
          bucketId: ${default.id}
    

    Create StorageBucket Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new StorageBucket(name: string, args?: StorageBucketArgs, opts?: CustomResourceOptions);
    @overload
    def StorageBucket(resource_name: str,
                      args: Optional[StorageBucketArgs] = None,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def StorageBucket(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      bucket_id: Optional[str] = None,
                      project: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var storageBucketResource = new Gcp.Firebase.StorageBucket("storageBucketResource", new()
    {
        BucketId = "string",
        Project = "string",
    });
    
    example, err := firebase.NewStorageBucket(ctx, "storageBucketResource", &firebase.StorageBucketArgs{
    	BucketId: pulumi.String("string"),
    	Project:  pulumi.String("string"),
    })
    
    var storageBucketResource = new StorageBucket("storageBucketResource", StorageBucketArgs.builder()
        .bucketId("string")
        .project("string")
        .build());
    
    storage_bucket_resource = gcp.firebase.StorageBucket("storageBucketResource",
        bucket_id="string",
        project="string")
    
    const storageBucketResource = new gcp.firebase.StorageBucket("storageBucketResource", {
        bucketId: "string",
        project: "string",
    });
    
    type: gcp:firebase:StorageBucket
    properties:
        bucketId: string
        project: string
    

    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.

    Import

    Bucket can be imported using any of these accepted formats:

    • projects/{{project}}/buckets/{{bucket_id}}

    • {{project}}/{{bucket_id}}

    • {{bucket_id}}

    When using the pulumi import command, Bucket can be imported using one of the formats above. For example:

    $ 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}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.
    gcp logo
    Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi