An Instance is an installation of an Extension into a user's project.
To get more information about Instance, see:
resource "google_storage_bucket" "images" {
provider = google-beta
project = "my-project-name"
name = "bucket-id"
location = "US"
uniform_bucket_level_access = true
# Delete all objects when the bucket is deleted
force_destroy = true
}
resource "google_firebase_extensions_instance" "resize_image" {
provider = google-beta
project = "my-project-name"
instance_id = "storage-resize-images"
config {
extension_ref = "firebase/storage-resize-images"
extension_version = "0.2.2"
# The following params apply to the firebase/storage-resize-images extension.
# Different extensions may have different params
params = {
DELETE_ORIGINAL_FILE = false
MAKE_PUBLIC = false
IMAGE_TYPE = false
IS_ANIMATED = true
FUNCTION_MEMORY = 1024
DO_BACKFILL = false
IMG_SIZES = "200x200"
IMG_BUCKET = google_storage_bucket.images.name
}
system_params = {
"firebaseextensions.v1beta.function/location" = ""
"firebaseextensions.v1beta.function/maxInstances" = 3000
"firebaseextensions.v1beta.function/minInstances" = 0
"firebaseextensions.v1beta.function/vpcConnectorEgressSettings" = "VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED"
}
allowed_event_types = [
"firebase.extensions.storage-resize-images.v1.onCompletion"
]
eventarc_channel = "projects/my-project-name/locations//channels/firebase"
}
}
The following arguments are supported:
config
-
(Required)
The current Config of the Extension Instance.
Structure is documented below.
instance_id
-
(Required)
The ID to use for the Extension Instance, which will become the final
component of the instance's name.
name
-
(Output)
The unique identifier for this configuration.
create_time
-
(Output)
The time at which the Extension Instance Config was created.
params
-
(Required)
Environment variables that may be configured for the Extension
system_params
-
(Optional)
Params whose values are only available at deployment time.
Unlike other params, these will not be set as environment variables on
functions. See a full list of system parameters at
https://firebase.google.com/docs/extensions/publishers/parameters#system_parameters
extension_ref
-
(Required)
The ref of the Extension from the Registry (e.g. publisher-id/awesome-extension)
extension_version
-
(Optional)
The version of the Extension from the Registry (e.g. 1.0.3). If left blank, latest is assumed.
allowed_event_types
-
(Optional)
List of extension events selected by consumer that extension is allowed to
emit, identified by their types.
eventarc_channel
-
(Optional)
Fully qualified Eventarc resource name that consumers should use for event triggers.
populated_postinstall_content
-
(Output)
Postinstall instructions to be shown for this Extension, with
template strings representing function and parameter values substituted
with actual values. These strings include: ${param:FOO},
${function:myFunc.url},
${function:myFunc.name}, and ${function:myFunc.location}
project
- (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format projects/{{project}}/instances/{{instance_id}}
name
-
The fully-qualified resource name of the Extension Instance.
create_time
-
The time at which the Extension Instance was created.
update_time
-
The time at which the Extension Instance was updated.
state
-
The current state of the Extension Instance.
DEPLOYING:
The Extension Instance is waiting on an Operation to complete. Could
resolve to ACTIVE
, PAUSED
, ERRORED
.
UNINSTALLING:
The Extension Instance is being removed from the project. Could resolve
to ERRORED
, but more likely the instance will soon cease to exist.
ACTIVE:
The Extension Instance is installed and ready.
ERRORED:
The Extension Instance encountered an error while DEPLOYING
or
UNINSTALLING
.
PAUSED:
The Extension's resources have been removed from the project, but the
Config remains so the Instance can be restored.
error_status
-
If this Instance has state: ERRORED
, the error messages
will be found here.
Structure is documented below.
service_account_email
-
The email of the service account to be used at runtime by compute resources
created for the operation of the Extension instance.
last_operation_name
-
The name of the last operation that acted on this Extension
Instance
last_operation_type
-
The type of the last operation that acted on the Extension Instance.
etag
-
A weak etag that is computed by the server based on other configuration
values and may be sent on update and delete requests to ensure the
client has an up-to-date value before proceeding.
runtime_data
-
Data set by the extension instance at runtime.
Structure is documented below.
The error_status
block contains:
code
-
(Optional)
The status code, which should be an enum value of google.rpc.Code.
message
-
(Optional)
A developer-facing error message, which should be in English.
details
-
(Optional)
A list of messages that carry the error details.
The runtime_data
block contains:
state_update_time
-
(Optional)
The time of the last state update.
processing_state
-
(Optional)
The processing state for the extension instance
Structure is documented below.
fatal_error
-
(Optional)
The fatal error state for the extension instance
Structure is documented below.
The processing_state
block supports:
state
-
(Optional)
The processing state of the extension instance.
detail_message
-
(Optional)
Details about the processing. e.g. This could include the type of
processing in progress or it could list errors or failures.
This information will be shown in the console on the detail page
for the extension instance.
The fatal_error
block supports:
error_message
-
(Optional)
The error message. This is set by the extension developer to give
more detail on why the extension is unusable and must be re-installed
or reconfigured.This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.update
- Default is 20 minutes.delete
- Default is 20 minutes.Instance can be imported using any of these accepted formats:
projects/{{project}}/instances/{{instance_id}}
{{project}}/{{instance_id}}
{{instance_id}}
In Terraform v1.5.0 and later, use an import
block to import Instance using one of the formats above. For example:
import {
id = "projects/{{project}}/instances/{{instance_id}}"
to = google_firebase_extensions_instance.default
}
When using the terraform import
command, Instance can be imported using one of the formats above. For example:
$ terraform import google_firebase_extensions_instance.default projects/{{project}}/instances/{{instance_id}}
$ terraform import google_firebase_extensions_instance.default {{project}}/{{instance_id}}
$ terraform import google_firebase_extensions_instance.default {{instance_id}}
This resource supports User Project Overrides.