Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Run and Cloud Functions integration with Firebase Hosting hashicorp/terraform-provider-google#12955 #13793

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/7213.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:new-resource
google_firebase_hosting_version
google_firebase_hosting_release
```
188 changes: 188 additions & 0 deletions website/docs/r/firebase_hosting_release.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
---
# ----------------------------------------------------------------------------
#
# *** 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`, and `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:

```
$ 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}}
```
Loading