1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebase
  5. DatabaseInstance
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

gcp.firebase.DatabaseInstance

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.19.0 published on Thursday, Apr 18, 2024 by Pulumi

    Example Usage

    Firebase Database Instance Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const basic = new gcp.firebase.DatabaseInstance("basic", {
        project: "my-project-name",
        region: "us-central1",
        instanceId: "active-db",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    basic = gcp.firebase.DatabaseInstance("basic",
        project="my-project-name",
        region="us-central1",
        instance_id="active-db")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := firebase.NewDatabaseInstance(ctx, "basic", &firebase.DatabaseInstanceArgs{
    			Project:    pulumi.String("my-project-name"),
    			Region:     pulumi.String("us-central1"),
    			InstanceId: pulumi.String("active-db"),
    		})
    		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 basic = new Gcp.Firebase.DatabaseInstance("basic", new()
        {
            Project = "my-project-name",
            Region = "us-central1",
            InstanceId = "active-db",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.firebase.DatabaseInstance;
    import com.pulumi.gcp.firebase.DatabaseInstanceArgs;
    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 basic = new DatabaseInstance("basic", DatabaseInstanceArgs.builder()        
                .project("my-project-name")
                .region("us-central1")
                .instanceId("active-db")
                .build());
    
        }
    }
    
    resources:
      basic:
        type: gcp:firebase:DatabaseInstance
        properties:
          project: my-project-name
          region: us-central1
          instanceId: active-db
    

    Firebase Database Instance Full

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const full = new gcp.firebase.DatabaseInstance("full", {
        project: "my-project-name",
        region: "europe-west1",
        instanceId: "disabled-db",
        type: "USER_DATABASE",
        desiredState: "DISABLED",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    full = gcp.firebase.DatabaseInstance("full",
        project="my-project-name",
        region="europe-west1",
        instance_id="disabled-db",
        type="USER_DATABASE",
        desired_state="DISABLED")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := firebase.NewDatabaseInstance(ctx, "full", &firebase.DatabaseInstanceArgs{
    			Project:      pulumi.String("my-project-name"),
    			Region:       pulumi.String("europe-west1"),
    			InstanceId:   pulumi.String("disabled-db"),
    			Type:         pulumi.String("USER_DATABASE"),
    			DesiredState: pulumi.String("DISABLED"),
    		})
    		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 full = new Gcp.Firebase.DatabaseInstance("full", new()
        {
            Project = "my-project-name",
            Region = "europe-west1",
            InstanceId = "disabled-db",
            Type = "USER_DATABASE",
            DesiredState = "DISABLED",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.firebase.DatabaseInstance;
    import com.pulumi.gcp.firebase.DatabaseInstanceArgs;
    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 full = new DatabaseInstance("full", DatabaseInstanceArgs.builder()        
                .project("my-project-name")
                .region("europe-west1")
                .instanceId("disabled-db")
                .type("USER_DATABASE")
                .desiredState("DISABLED")
                .build());
    
        }
    }
    
    resources:
      full:
        type: gcp:firebase:DatabaseInstance
        properties:
          project: my-project-name
          region: europe-west1
          instanceId: disabled-db
          type: USER_DATABASE
          desiredState: DISABLED
    

    Firebase Database Instance Default Database

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const _default = new gcp.organizations.Project("default", {
        projectId: "rtdb-project",
        name: "rtdb-project",
        orgId: "123456789",
        labels: {
            firebase: "enabled",
        },
    });
    const defaultProject = new gcp.firebase.Project("default", {project: _default.projectId});
    const firebaseDatabase = new gcp.projects.Service("firebase_database", {
        project: defaultProject.project,
        service: "firebasedatabase.googleapis.com",
    });
    const defaultDatabaseInstance = new gcp.firebase.DatabaseInstance("default", {
        project: defaultProject.project,
        region: "us-central1",
        instanceId: "rtdb-project-default-rtdb",
        type: "DEFAULT_DATABASE",
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.organizations.Project("default",
        project_id="rtdb-project",
        name="rtdb-project",
        org_id="123456789",
        labels={
            "firebase": "enabled",
        })
    default_project = gcp.firebase.Project("default", project=default.project_id)
    firebase_database = gcp.projects.Service("firebase_database",
        project=default_project.project,
        service="firebasedatabase.googleapis.com")
    default_database_instance = gcp.firebase.DatabaseInstance("default",
        project=default_project.project,
        region="us-central1",
        instance_id="rtdb-project-default-rtdb",
        type="DEFAULT_DATABASE")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/firebase"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := organizations.NewProject(ctx, "default", &organizations.ProjectArgs{
    			ProjectId: pulumi.String("rtdb-project"),
    			Name:      pulumi.String("rtdb-project"),
    			OrgId:     pulumi.String("123456789"),
    			Labels: pulumi.StringMap{
    				"firebase": pulumi.String("enabled"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultProject, err := firebase.NewProject(ctx, "default", &firebase.ProjectArgs{
    			Project: _default.ProjectId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = projects.NewService(ctx, "firebase_database", &projects.ServiceArgs{
    			Project: defaultProject.Project,
    			Service: pulumi.String("firebasedatabase.googleapis.com"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = firebase.NewDatabaseInstance(ctx, "default", &firebase.DatabaseInstanceArgs{
    			Project:    defaultProject.Project,
    			Region:     pulumi.String("us-central1"),
    			InstanceId: pulumi.String("rtdb-project-default-rtdb"),
    			Type:       pulumi.String("DEFAULT_DATABASE"),
    		})
    		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.Organizations.Project("default", new()
        {
            ProjectId = "rtdb-project",
            Name = "rtdb-project",
            OrgId = "123456789",
            Labels = 
            {
                { "firebase", "enabled" },
            },
        });
    
        var defaultProject = new Gcp.Firebase.Project("default", new()
        {
            ProjectID = @default.ProjectId,
        });
    
        var firebaseDatabase = new Gcp.Projects.Service("firebase_database", new()
        {
            Project = defaultProject.ProjectID,
            ServiceName = "firebasedatabase.googleapis.com",
        });
    
        var defaultDatabaseInstance = new Gcp.Firebase.DatabaseInstance("default", new()
        {
            Project = defaultProject.ProjectID,
            Region = "us-central1",
            InstanceId = "rtdb-project-default-rtdb",
            Type = "DEFAULT_DATABASE",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.organizations.Project;
    import com.pulumi.gcp.organizations.ProjectArgs;
    import com.pulumi.gcp.firebase.Project;
    import com.pulumi.gcp.firebase.ProjectArgs;
    import com.pulumi.gcp.projects.Service;
    import com.pulumi.gcp.projects.ServiceArgs;
    import com.pulumi.gcp.firebase.DatabaseInstance;
    import com.pulumi.gcp.firebase.DatabaseInstanceArgs;
    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 Project("default", ProjectArgs.builder()        
                .projectId("rtdb-project")
                .name("rtdb-project")
                .orgId("123456789")
                .labels(Map.of("firebase", "enabled"))
                .build());
    
            var defaultProject = new Project("defaultProject", ProjectArgs.builder()        
                .project(default_.projectId())
                .build());
    
            var firebaseDatabase = new Service("firebaseDatabase", ServiceArgs.builder()        
                .project(defaultProject.project())
                .service("firebasedatabase.googleapis.com")
                .build());
    
            var defaultDatabaseInstance = new DatabaseInstance("defaultDatabaseInstance", DatabaseInstanceArgs.builder()        
                .project(defaultProject.project())
                .region("us-central1")
                .instanceId("rtdb-project-default-rtdb")
                .type("DEFAULT_DATABASE")
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:organizations:Project
        properties:
          projectId: rtdb-project
          name: rtdb-project
          orgId: '123456789'
          labels:
            firebase: enabled
      defaultProject:
        type: gcp:firebase:Project
        name: default
        properties:
          project: ${default.projectId}
      firebaseDatabase:
        type: gcp:projects:Service
        name: firebase_database
        properties:
          project: ${defaultProject.project}
          service: firebasedatabase.googleapis.com
      defaultDatabaseInstance:
        type: gcp:firebase:DatabaseInstance
        name: default
        properties:
          project: ${defaultProject.project}
          region: us-central1
          instanceId: rtdb-project-default-rtdb
          type: DEFAULT_DATABASE
    

    Create DatabaseInstance Resource

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

    Constructor syntax

    new DatabaseInstance(name: string, args: DatabaseInstanceArgs, opts?: CustomResourceOptions);
    @overload
    def DatabaseInstance(resource_name: str,
                         args: DatabaseInstanceArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def DatabaseInstance(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         instance_id: Optional[str] = None,
                         region: Optional[str] = None,
                         desired_state: Optional[str] = None,
                         project: Optional[str] = None,
                         type: Optional[str] = None)
    func NewDatabaseInstance(ctx *Context, name string, args DatabaseInstanceArgs, opts ...ResourceOption) (*DatabaseInstance, error)
    public DatabaseInstance(string name, DatabaseInstanceArgs args, CustomResourceOptions? opts = null)
    public DatabaseInstance(String name, DatabaseInstanceArgs args)
    public DatabaseInstance(String name, DatabaseInstanceArgs args, CustomResourceOptions options)
    
    type: gcp:firebase:DatabaseInstance
    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 DatabaseInstanceArgs
    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 DatabaseInstanceArgs
    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 DatabaseInstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatabaseInstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DatabaseInstanceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var databaseInstanceResource = new Gcp.Firebase.DatabaseInstance("databaseInstanceResource", new()
    {
        InstanceId = "string",
        Region = "string",
        DesiredState = "string",
        Project = "string",
        Type = "string",
    });
    
    example, err := firebase.NewDatabaseInstance(ctx, "databaseInstanceResource", &firebase.DatabaseInstanceArgs{
    	InstanceId:   pulumi.String("string"),
    	Region:       pulumi.String("string"),
    	DesiredState: pulumi.String("string"),
    	Project:      pulumi.String("string"),
    	Type:         pulumi.String("string"),
    })
    
    var databaseInstanceResource = new DatabaseInstance("databaseInstanceResource", DatabaseInstanceArgs.builder()        
        .instanceId("string")
        .region("string")
        .desiredState("string")
        .project("string")
        .type("string")
        .build());
    
    database_instance_resource = gcp.firebase.DatabaseInstance("databaseInstanceResource",
        instance_id="string",
        region="string",
        desired_state="string",
        project="string",
        type="string")
    
    const databaseInstanceResource = new gcp.firebase.DatabaseInstance("databaseInstanceResource", {
        instanceId: "string",
        region: "string",
        desiredState: "string",
        project: "string",
        type: "string",
    });
    
    type: gcp:firebase:DatabaseInstance
    properties:
        desiredState: string
        instanceId: string
        project: string
        region: string
        type: string
    

    DatabaseInstance 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 DatabaseInstance resource accepts the following input properties:

    InstanceId string
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    Region string
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    DesiredState string
    The intended database state.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Type string
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    InstanceId string
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    Region string
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    DesiredState string
    The intended database state.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Type string
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    instanceId String
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    region String
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    desiredState String
    The intended database state.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    type String
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    instanceId string
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    region string
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    desiredState string
    The intended database state.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    type string
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    instance_id str
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    region str
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    desired_state str
    The intended database state.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    type str
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    instanceId String
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    region String
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    desiredState String
    The intended database state.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    type String
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.

    Outputs

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

    DatabaseUrl string
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    State string
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    DatabaseUrl string
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    State string
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    databaseUrl String
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    state String
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    databaseUrl string
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    state string
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    database_url str
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    state str
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    databaseUrl String
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    state String
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database

    Look up Existing DatabaseInstance Resource

    Get an existing DatabaseInstance 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?: DatabaseInstanceState, opts?: CustomResourceOptions): DatabaseInstance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            database_url: Optional[str] = None,
            desired_state: Optional[str] = None,
            instance_id: Optional[str] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            region: Optional[str] = None,
            state: Optional[str] = None,
            type: Optional[str] = None) -> DatabaseInstance
    func GetDatabaseInstance(ctx *Context, name string, id IDInput, state *DatabaseInstanceState, opts ...ResourceOption) (*DatabaseInstance, error)
    public static DatabaseInstance Get(string name, Input<string> id, DatabaseInstanceState? state, CustomResourceOptions? opts = null)
    public static DatabaseInstance get(String name, Output<String> id, DatabaseInstanceState 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:
    DatabaseUrl string
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    DesiredState string
    The intended database state.
    InstanceId string
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    Name string
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    State string
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    Type string
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    DatabaseUrl string
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    DesiredState string
    The intended database state.
    InstanceId string
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    Name string
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    Region string
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    State string
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    Type string
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    databaseUrl String
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    desiredState String
    The intended database state.
    instanceId String
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    name String
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    state String
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    type String
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    databaseUrl string
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    desiredState string
    The intended database state.
    instanceId string
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    name string
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region string
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    state string
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    type string
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    database_url str
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    desired_state str
    The intended database state.
    instance_id str
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    name str
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region str
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    state str
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    type str
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.
    databaseUrl String
    The database URL in the form of https://{instance-id}.firebaseio.com for us-central1 instances or https://{instance-id}.{region}.firebasedatabase.app in other regions.
    desiredState String
    The intended database state.
    instanceId String
    The globally unique identifier of the Firebase Realtime Database instance. Instance IDs cannot be reused after deletion.


    name String
    The fully-qualified resource name of the Firebase Realtime Database, in the format: projects/PROJECT_NUMBER/locations/REGION_IDENTIFIER/instances/INSTANCE_ID PROJECT_NUMBER: The Firebase project's ProjectNumber Learn more about using project identifiers in Google's AIP 2510 standard.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    region String
    A reference to the region where the Firebase Realtime database resides. Check all available regions
    state String
    The current database state. Set desired_state to :DISABLED to disable the database and :ACTIVE to reenable the database
    type String
    The database type. Each project can create one default Firebase Realtime Database, which cannot be deleted once created. Creating user Databases is only available for projects on the Blaze plan. Projects can be upgraded using the Cloud Billing API https://cloud.google.com/billing/reference/rest/v1/projects/updateBillingInfo. Default value is USER_DATABASE. Possible values are: DEFAULT_DATABASE, USER_DATABASE.

    Import

    Instance can be imported using any of these accepted formats:

    • projects/{{project}}/locations/{{region}}/instances/{{instance_id}}

    • {{project}}/{{region}}/{{instance_id}}

    • {{region}}/{{instance_id}}

    • {{instance_id}}

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

    $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default projects/{{project}}/locations/{{region}}/instances/{{instance_id}}
    
    $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default {{project}}/{{region}}/{{instance_id}}
    
    $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default {{region}}/{{instance_id}}
    
    $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default {{instance_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.19.0 published on Thursday, Apr 18, 2024 by Pulumi