blob: d6a91a001ab38dd6b0c57fae4627c46ab0a4c06e [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Firebase Hosting"
description: |-
A Release is a particular collection of configurations that is set to be public at a particular time.
---
# google\_firebase\_hosting\_release
A Release is a particular collection of configurations that is set to be public at a particular time.
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
To get more information about Release, see:
* [API documentation](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/sites.releases)
* How-to Guides
* [Official Documentation](https://firebase.google.com/docs/hosting)
## Example Usage - Firebasehosting Release In Site
```hcl
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"
}
```
## Example Usage - Firebasehosting Release In Channel
```hcl
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"
}
```
## Example Usage - Firebasehosting Release Disable
```hcl
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"
}
```
## Argument Reference
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`.
## Attributes Reference
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.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
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](https://developer.hashicorp.com/terraform/language/import) to import Release using one of the formats above. For example:
```tf
import {
id = "sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}"
to = google_firebase_hosting_release.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), 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}}
```