From 5edb89e58065fbb80a3cb26276cc46695edf3da5 Mon Sep 17 00:00:00 2001 From: The Magician Date: Wed, 16 Nov 2022 09:36:52 -0800 Subject: [PATCH] Firebase hosting channel (#6791) (#13053) * Firebase Hosting Channels * Use references site_id * Add handwritten update test * Use billing_project instead of project * Remove dependence on a project Signed-off-by: Modular Magician Signed-off-by: Modular Magician --- .changelog/6791.txt | 3 + .../resource_firebase_hosting_channel_test.go | 1 + .../r/firebase_hosting_channel.html.markdown | 141 ++++++++++++++++++ 3 files changed, 145 insertions(+) create mode 100644 .changelog/6791.txt create mode 100644 google/resource_firebase_hosting_channel_test.go create mode 100644 website/docs/r/firebase_hosting_channel.html.markdown diff --git a/.changelog/6791.txt b/.changelog/6791.txt new file mode 100644 index 00000000000..1c6abed52bf --- /dev/null +++ b/.changelog/6791.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +`google_firebase_hosting_channel` +``` diff --git a/google/resource_firebase_hosting_channel_test.go b/google/resource_firebase_hosting_channel_test.go new file mode 100644 index 00000000000..71664db3c87 --- /dev/null +++ b/google/resource_firebase_hosting_channel_test.go @@ -0,0 +1 @@ +package google diff --git a/website/docs/r/firebase_hosting_channel.html.markdown b/website/docs/r/firebase_hosting_channel.html.markdown new file mode 100644 index 00000000000..4aa5b41ff51 --- /dev/null +++ b/website/docs/r/firebase_hosting_channel.html.markdown @@ -0,0 +1,141 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** 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" +page_title: "Google: google_firebase_hosting_channel" +description: |- + A `Channel` represents a stream of releases for a site. +--- + +# google\_firebase\_hosting\_channel + +A `Channel` represents a stream of releases for a site. All sites have a default +`live` channel that serves content to the Firebase-provided subdomains and any +connected custom domains. + +~> **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 Channel, see: + +* [API documentation](https://firebase.google.com/docs/reference/hosting/rest/v1beta1/sites.channels) +* How-to Guides + * [Official Documentation](https://firebase.google.com/docs/hosting) + +## Example Usage - Firebasehosting Channel Basic + + +```hcl +resource "google_firebase_hosting_site" "default" { + provider = google-beta + project = "my-project-name" + site_id = "site-with-channel" +} + +resource "google_firebase_hosting_channel" "default" { + provider = google-beta + site_id = google_firebase_hosting_site.default.site_id + channel_id = "channel-basic" +} +``` +## Example Usage - Firebasehosting Channel Full + + +```hcl +resource "google_firebase_hosting_site" "default" { + provider = google-beta + project = "my-project-name" + site_id = "site-with-channel" +} + +resource "google_firebase_hosting_channel" "full" { + provider = google-beta + site_id = google_firebase_hosting_site.default.site_id + channel_id = "channel-full" + ttl = "86400s" + retained_release_count = 20 + labels = { + "some-key": "some-value" + } +} +``` + +## Argument Reference + +The following arguments are supported: + + +* `site_id` - + (Required) + Required. The ID of the site in which to create this channel. + +* `channel_id` - + (Required) + Required. Immutable. A unique ID within the site that identifies the channel. + + +- - - + + +* `retained_release_count` - + (Optional) + The number of previous releases to retain on the channel for rollback or other + purposes. Must be a number between 1-100. Defaults to 10 for new channels. + +* `labels` - + (Optional) + Text labels used for extra metadata and/or filtering + +* `expire_time` - + (Optional) + The time at which the channel will be automatically deleted. If null, the channel + will not be automatically deleted. This field is present in the output whether it's + set directly or via the `ttl` field. + +* `ttl` - + (Optional) + Input only. A time-to-live for this channel. Sets `expire_time` to the provided + duration past the time of the request. A duration in seconds with up to nine fractional + digits, terminated by 's'. Example: "86400s" (one day). + + +## 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}}` + +* `name` - + The fully-qualified resource name for the channel, in the format: + sites/SITE_ID/channels/CHANNEL_ID + + +## Timeouts + +This resource provides the following +[Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - Default is 20 minutes. +- `update` - Default is 20 minutes. +- `delete` - Default is 20 minutes. + +## Import + + +Channel can be imported using any of these accepted formats: + +``` +$ terraform import google_firebase_hosting_channel.default sites/{{site_id}}/channels/{{channel_id}} +$ terraform import google_firebase_hosting_channel.default {{site_id}}/{{channel_id}} +```