A Release is a particular collection of configurations that is set to be public at a particular time.
To get more information about Release, see:
resource "google_firebase_hosting_site" "default" {
provider = google-beta
project = "my-project-name"
site_id = "site-id"
}
resource "google_firebase_hosting_version" "default" {
provider = google-beta
site_id = google_firebase_hosting_site.default.site_id
config {
redirects {
glob = "/google/**"
status_code = 302
location = "https://www.google.com"
}
}
}
resource "google_firebase_hosting_release" "default" {
provider = google-beta
site_id = google_firebase_hosting_site.default.site_id
version_name = google_firebase_hosting_version.default.name
message = "Test release"
}
resource "google_firebase_hosting_site" "default" {
provider = google-beta
project = "my-project-name"
site_id = "site-with-channel"
}
resource "google_firebase_hosting_version" "default" {
provider = google-beta
site_id = google_firebase_hosting_site.default.site_id
config {
redirects {
glob = "/google/**"
status_code = 302
location = "https://www.google.com"
}
}
}
resource "google_firebase_hosting_channel" "default" {
provider = google-beta
site_id = google_firebase_hosting_site.default.site_id
channel_id = "channel-id"
}
resource "google_firebase_hosting_release" "default" {
provider = google-beta
site_id = google_firebase_hosting_site.default.site_id
channel_id = google_firebase_hosting_channel.default.channel_id
version_name = google_firebase_hosting_version.default.name
message = "Test release in channel"
}
resource "google_firebase_hosting_site" "default" {
provider = google-beta
project = "my-project-name"
site_id = "site-id"
}
resource "google_firebase_hosting_release" "default" {
provider = google-beta
site_id = google_firebase_hosting_site.default.site_id
type = "SITE_DISABLE"
message = "Take down site"
}
The following arguments are supported:
site_id
-
(Required)
Required. The ID of the site to which the release belongs.type
-
(Optional)
The type of the release; indicates what happened to the content of the site. There is no need to specify
DEPLOY
or ROLLBACK
type if a version_name
is provided.
DEPLOY: A version was uploaded to Firebase Hosting and released. Output only.
ROLLBACK: The release points back to a previously deployed version. Output only.
SITE_DISABLE: The release prevents the site from serving content. Firebase Hosting acts as if the site never existed
Possible values are: DEPLOY
, ROLLBACK
, SITE_DISABLE
.
message
-
(Optional)
The deploy description when the release was created. The value can be up to 512 characters.
channel_id
-
(Optional)
The ID of the channel to which the release belongs. If not provided, the release will
belong to the default "live" channel
version_name
-
(Optional)
The unique identifier for a version, in the format: sites/SITE_ID/versions/VERSION_ID.
The content of the version specified will be actively displayed on the appropriate URL.
The Version must belong to the same site as in the site_id
.
This parameter must be empty if the type
of the release is SITE_DISABLE
.
In addition to the arguments listed above, the following computed attributes are exported:
id
- an identifier for the resource with format sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}
name
-
The unique identifier for the release, in either of the following formats:
sites/SITE_ID/releases/RELEASE_ID
sites/SITE_ID/channels/CHANNEL_ID/releases/RELEASE_ID
release_id
-
The unique identifier for the Release.
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.Release can be imported using any of these accepted formats:
sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}
sites/{{site_id}}/releases/{{release_id}}
{{site_id}}/{{channel_id}}/{{release_id}}
{{site_id}}/{{release_id}}
In Terraform v1.5.0 and later, use an import
block to import Release using one of the formats above. For example:
import {
id = "sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}"
to = google_firebase_hosting_release.default
}
When using the terraform import
command, Release can be imported using one of the formats above. For example:
$ terraform import google_firebase_hosting_release.default sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}
$ terraform import google_firebase_hosting_release.default sites/{{site_id}}/releases/{{release_id}}
$ terraform import google_firebase_hosting_release.default {{site_id}}/{{channel_id}}/{{release_id}}
$ terraform import google_firebase_hosting_release.default {{site_id}}/{{release_id}}