@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
260 lines (259 loc) • 10.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* A Firebase Realtime Database instance.
*
* To get more information about Instance, see:
*
* * [API documentation](https://firebase.google.com/docs/reference/rest/database/database-management/rest)
* * How-to Guides
* * [Official Documentation](https://firebase.google.com/products/realtime-database)
*
* ## Example Usage
*
* ### Firebase Database Instance Basic
*
* ```typescript
* 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",
* });
* ```
* ### Firebase Database Instance Full
*
* ```typescript
* 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",
* });
* ```
* ### Firebase Database Instance Default Database
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as time from "@pulumiverse/time";
*
* const _default = new gcp.organizations.Project("default", {
* projectId: "rtdb-project",
* name: "rtdb-project",
* orgId: "123456789",
* deletionPolicy: "DELETE",
* labels: {
* firebase: "enabled",
* },
* });
* const firebase = new gcp.projects.Service("firebase", {
* project: _default.projectId,
* service: "firebase.googleapis.com",
* });
* const defaultProject = new gcp.firebase.Project("default", {project: _default.projectId}, {
* dependsOn: [firebase],
* });
* const firebaseDatabase = new gcp.projects.Service("firebase_database", {
* project: defaultProject.project,
* service: "firebasedatabase.googleapis.com",
* });
* const wait60Seconds = new time.index.Sleep("wait_60_seconds", {createDuration: "60s"}, {
* dependsOn: [firebaseDatabase],
* });
* const defaultDatabaseInstance = new gcp.firebase.DatabaseInstance("default", {
* project: defaultProject.project,
* region: "us-central1",
* instanceId: "rtdb-project-default-rtdb",
* type: "DEFAULT_DATABASE",
* }, {
* dependsOn: [wait60Seconds],
* });
* ```
*
* ## 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:
*
* ```sh
* $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default projects/{{project}}/locations/{{region}}/instances/{{instance_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default {{project}}/{{region}}/{{instance_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default {{region}}/{{instance_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/databaseInstance:DatabaseInstance default {{instance_id}}
* ```
*/
export declare class DatabaseInstance extends pulumi.CustomResource {
/**
* Get an existing DatabaseInstance resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseInstanceState, opts?: pulumi.CustomResourceOptions): DatabaseInstance;
/**
* Returns true if the given object is an instance of DatabaseInstance. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is DatabaseInstance;
/**
* 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.
*/
readonly databaseUrl: pulumi.Output<string>;
/**
* The intended database state. Possible values: ACTIVE, DISABLED.
*/
readonly desiredState: pulumi.Output<string | undefined>;
/**
* The globally unique identifier of the Firebase Realtime Database instance.
* Instance IDs cannot be reused after deletion.
*/
readonly instanceId: pulumi.Output<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`](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects#FirebaseProject.FIELDS.project_number)
* Learn more about using project identifiers in Google's [AIP 2510 standard](https://google.aip.dev/cloud/2510).
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* A reference to the region where the Firebase Realtime database resides.
* Check all [available regions](https://firebase.google.com/docs/projects/locations#rtdb-locations)
*/
readonly region: pulumi.Output<string>;
/**
* The current database state. Set desiredState to :DISABLED to disable the database and :ACTIVE to reenable the database
*/
readonly state: pulumi.Output<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`.
*/
readonly type: pulumi.Output<string | undefined>;
/**
* Create a DatabaseInstance resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DatabaseInstanceArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering DatabaseInstance resources.
*/
export interface DatabaseInstanceState {
/**
* 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.
*/
databaseUrl?: pulumi.Input<string>;
/**
* The intended database state. Possible values: ACTIVE, DISABLED.
*/
desiredState?: pulumi.Input<string>;
/**
* The globally unique identifier of the Firebase Realtime Database instance.
* Instance IDs cannot be reused after deletion.
*/
instanceId?: pulumi.Input<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`](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects#FirebaseProject.FIELDS.project_number)
* Learn more about using project identifiers in Google's [AIP 2510 standard](https://google.aip.dev/cloud/2510).
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* A reference to the region where the Firebase Realtime database resides.
* Check all [available regions](https://firebase.google.com/docs/projects/locations#rtdb-locations)
*/
region?: pulumi.Input<string>;
/**
* The current database state. Set desiredState to :DISABLED to disable the database and :ACTIVE to reenable the database
*/
state?: pulumi.Input<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`.
*/
type?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a DatabaseInstance resource.
*/
export interface DatabaseInstanceArgs {
/**
* The intended database state. Possible values: ACTIVE, DISABLED.
*/
desiredState?: pulumi.Input<string>;
/**
* The globally unique identifier of the Firebase Realtime Database instance.
* Instance IDs cannot be reused after deletion.
*/
instanceId: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* A reference to the region where the Firebase Realtime database resides.
* Check all [available regions](https://firebase.google.com/docs/projects/locations#rtdb-locations)
*/
region: pulumi.Input<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`.
*/
type?: pulumi.Input<string>;
}