Skip to content

googleFirebaserulesRelease

For more information, see:

Example Usage - basic_release

Creates a basic Firebase Rules Release

/*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 googleFirebaserulesRulesetBasic =
  new google.firebaserulesRuleset.FirebaserulesRuleset(this, "basic", {
    project: "my-project-name",
    source: [
      {
        files: [
          {
            content:
              "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
            fingerprint: "",
            name: "firestore.rules",
          },
        ],
        language: "",
      },
    ],
  });
new google.firebaserulesRuleset.FirebaserulesRuleset(this, "minimal", {
  project: "my-project-name",
  source: [
    {
      files: [
        {
          content:
            "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
          name: "firestore.rules",
        },
      ],
    },
  ],
});
new google.firebaserulesRelease.FirebaserulesRelease(this, "primary", {
  name: "release",
  project: "my-project-name",
  ruleset_name: `projects/my-project-name/rulesets/\${${googleFirebaserulesRulesetBasic.name}}`,
});

Example Usage - minimal_release

Creates a minimal Firebase Rules Release

/*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 googleFirebaserulesRulesetMinimal =
  new google.firebaserulesRuleset.FirebaserulesRuleset(this, "minimal", {
    project: "my-project-name",
    source: [
      {
        files: [
          {
            content:
              "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
            name: "firestore.rules",
          },
        ],
      },
    ],
  });
new google.firebaserulesRelease.FirebaserulesRelease(this, "primary", {
  name: "prod/release",
  project: "my-project-name",
  ruleset_name: `projects/my-project-name/rulesets/\${${googleFirebaserulesRulesetMinimal.name}}`,
});

Argument Reference

The following arguments are supported:

  • name - (Required) Format: projects/{projectId}/releases/{releaseId}\Firestore Rules Releases will always have the name 'cloud.firestore'

  • rulesetName - (Required) Name of the ruleset referred to by this release. The ruleset must exist for the release to be created.


  • project - (Optional) The project for the resource

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format projects/{{project}}/releases/{{name}}

  • createTime - Output only. Time the release was created.

  • disabled - Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.

  • updateTime - Output only. Time the release was updated.

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

Release can be imported using any of these accepted formats:

$ terraform import google_firebaserules_release.default projects/{{project}}/releases/{{name}}