Skip to content

Commit 5ea7cb7

Browse files
Cloud Run and Cloud Functions integration with Firebase Hosting #12955 (#7213) (#13793)
Signed-off-by: Modular Magician <[email protected]>
1 parent fcbef51 commit 5ea7cb7

File tree

3 files changed

+481
-0
lines changed

3 files changed

+481
-0
lines changed

.changelog/7213.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```release-note:new-resource
2+
google_firebase_hosting_version
3+
google_firebase_hosting_release
4+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
---
2+
# ----------------------------------------------------------------------------
3+
#
4+
# *** AUTO GENERATED CODE *** Type: MMv1 ***
5+
#
6+
# ----------------------------------------------------------------------------
7+
#
8+
# This file is automatically generated by Magic Modules and manual
9+
# changes will be clobbered when the file is regenerated.
10+
#
11+
# Please read more about how to change this file in
12+
# .github/CONTRIBUTING.md.
13+
#
14+
# ----------------------------------------------------------------------------
15+
subcategory: "Firebase Hosting"
16+
description: |-
17+
A Release is a particular collection of configurations that is set to be public at a particular time.
18+
---
19+
20+
# google\_firebase\_hosting\_release
21+
22+
A Release is a particular collection of configurations that is set to be public at a particular time.
23+
24+
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
25+
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
26+
27+
To get more information about Release, see:
28+
29+
* [API documentation](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/sites.releases)
30+
* How-to Guides
31+
* [Official Documentation](https://firebase.google.com/docs/hosting)
32+
33+
## Example Usage - Firebasehosting Release In Site
34+
35+
36+
```hcl
37+
resource "google_firebase_hosting_site" "default" {
38+
provider = google-beta
39+
project = "my-project-name"
40+
site_id = "site-id"
41+
}
42+
43+
resource "google_firebase_hosting_version" "default" {
44+
provider = google-beta
45+
site_id = google_firebase_hosting_site.default.site_id
46+
config {
47+
redirects {
48+
glob = "/google/**"
49+
status_code = 302
50+
location = "https://www.google.com"
51+
}
52+
}
53+
}
54+
55+
resource "google_firebase_hosting_release" "default" {
56+
provider = google-beta
57+
site_id = google_firebase_hosting_site.default.site_id
58+
version_name = google_firebase_hosting_version.default.name
59+
message = "Test release"
60+
}
61+
```
62+
## Example Usage - Firebasehosting Release In Channel
63+
64+
65+
```hcl
66+
resource "google_firebase_hosting_site" "default" {
67+
provider = google-beta
68+
project = "my-project-name"
69+
site_id = "site-with-channel"
70+
}
71+
72+
resource "google_firebase_hosting_version" "default" {
73+
provider = google-beta
74+
site_id = google_firebase_hosting_site.default.site_id
75+
config {
76+
redirects {
77+
glob = "/google/**"
78+
status_code = 302
79+
location = "https://www.google.com"
80+
}
81+
}
82+
}
83+
84+
resource "google_firebase_hosting_channel" "default" {
85+
provider = google-beta
86+
site_id = google_firebase_hosting_site.default.site_id
87+
channel_id = "channel-id"
88+
}
89+
90+
resource "google_firebase_hosting_release" "default" {
91+
provider = google-beta
92+
site_id = google_firebase_hosting_site.default.site_id
93+
channel_id = google_firebase_hosting_channel.default.channel_id
94+
version_name = google_firebase_hosting_version.default.name
95+
message = "Test release in channel"
96+
}
97+
```
98+
## Example Usage - Firebasehosting Release Disable
99+
100+
101+
```hcl
102+
resource "google_firebase_hosting_site" "default" {
103+
provider = google-beta
104+
project = "my-project-name"
105+
site_id = "site-id"
106+
}
107+
108+
resource "google_firebase_hosting_release" "default" {
109+
provider = google-beta
110+
site_id = google_firebase_hosting_site.default.site_id
111+
type = "SITE_DISABLE"
112+
message = "Take down site"
113+
}
114+
```
115+
116+
## Argument Reference
117+
118+
The following arguments are supported:
119+
120+
121+
* `site_id` -
122+
(Required)
123+
Required. The ID of the site to which the release belongs.
124+
125+
126+
- - -
127+
128+
129+
* `type` -
130+
(Optional)
131+
The type of the release; indicates what happened to the content of the site. There is no need to specify
132+
`DEPLOY` or `ROLLBACK` type if a `version_name` is provided.
133+
DEPLOY: A version was uploaded to Firebase Hosting and released. Output only.
134+
ROLLBACK: The release points back to a previously deployed version. Output only.
135+
SITE_DISABLE: The release prevents the site from serving content. Firebase Hosting acts as if the site never existed
136+
Possible values are `DEPLOY`, `ROLLBACK`, and `SITE_DISABLE`.
137+
138+
* `message` -
139+
(Optional)
140+
The deploy description when the release was created. The value can be up to 512 characters.
141+
142+
* `channel_id` -
143+
(Optional)
144+
The ID of the channel to which the release belongs. If not provided, the release will
145+
belong to the default "live" channel
146+
147+
* `version_name` -
148+
(Optional)
149+
The unique identifier for a version, in the format: sites/SITE_ID/versions/VERSION_ID.
150+
The content of the version specified will be actively displayed on the appropriate URL.
151+
The Version must belong to the same site as in the `site_id`.
152+
This parameter must be empty if the `type` of the release is `SITE_DISABLE`.
153+
154+
155+
## Attributes Reference
156+
157+
In addition to the arguments listed above, the following computed attributes are exported:
158+
159+
* `id` - an identifier for the resource with format `sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}`
160+
161+
* `name` -
162+
The unique identifier for the release, in either of the following formats:
163+
sites/SITE_ID/releases/RELEASE_ID
164+
sites/SITE_ID/channels/CHANNEL_ID/releases/RELEASE_ID
165+
166+
* `release_id` -
167+
The unique identifier for the Release.
168+
169+
170+
## Timeouts
171+
172+
This resource provides the following
173+
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
174+
175+
- `create` - Default is 20 minutes.
176+
- `delete` - Default is 20 minutes.
177+
178+
## Import
179+
180+
181+
Release can be imported using any of these accepted formats:
182+
183+
```
184+
$ terraform import google_firebase_hosting_release.default sites/{{site_id}}/channels/{{channel_id}}/releases/{{release_id}}
185+
$ terraform import google_firebase_hosting_release.default sites/{{site_id}}/releases/{{release_id}}
186+
$ terraform import google_firebase_hosting_release.default {{site_id}}/{{channel_id}}/{{release_id}}
187+
$ terraform import google_firebase_hosting_release.default {{site_id}}/{{release_id}}
188+
```

0 commit comments

Comments
 (0)