Skip to content

googleFirebaseHostingChannel

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 for more details on beta resources.

To get more information about Channel, see:

Example Usage - Firebasehosting Channel Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleFirebaseHostingSiteDefault =
  new google.firebaseHostingSite.FirebaseHostingSite(this, "default", {
    project: "my-project-name",
    provider: "${google-beta}",
    site_id: "site-with-channel",
  });
const googleFirebaseHostingChannelDefault =
  new google.firebaseHostingChannel.FirebaseHostingChannel(this, "default_1", {
    channel_id: "channel-basic",
    provider: "${google-beta}",
    site_id: googleFirebaseHostingSiteDefault.siteId,
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
googleFirebaseHostingChannelDefault.overrideLogicalId("default");

Example Usage - Firebasehosting Channel Full

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
const googleFirebaseHostingSiteDefault =
  new google.firebaseHostingSite.FirebaseHostingSite(this, "default", {
    project: "my-project-name",
    provider: "${google-beta}",
    site_id: "site-with-channel",
  });
new google.firebaseHostingChannel.FirebaseHostingChannel(this, "full", {
  channel_id: "channel-full",
  labels: [
    {
      "some-key": "some-value",
    },
  ],
  provider: "${google-beta}",
  retained_release_count: 20,
  site_id: googleFirebaseHostingSiteDefault.siteId,
  ttl: "86400s",
});

Argument Reference

The following arguments are supported:

  • siteId - (Required) Required. The ID of the site in which to create this channel.

  • channelId - (Required) Required. Immutable. A unique ID within the site that identifies the channel.


  • retainedReleaseCount - (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

  • expireTime - (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 expireTime 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/{{siteId}}/channels/{{channelId}}

  • 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 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}}