googleFirebaserulesRuleset
For more information, see:
Example Usage - basic_ruleset
Creates a basic Firestore ruleset
/*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.*/
new google.firebaserulesRuleset.FirebaserulesRuleset(this, "primary", {
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: "",
},
],
});
Example Usage - minimal_ruleset
Creates a minimal Firestore ruleset
/*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.*/
new google.firebaserulesRuleset.FirebaserulesRuleset(this, "primary", {
project: "my-project-name",
source: [
{
files: [
{
content:
"service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
name: "firestore.rules",
},
],
},
],
});
Argument Reference
The following arguments are supported:
source
- (Required)source
for theruleset
.
The source
block supports:
-
files
- (Required)file
set constituting thesource
bundle. -
language
- (Optional)language
of thesource
bundle. If unspecified, the language will default tofirebaseRules
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
The files
block supports:
-
content
- (Required) Textual Content. -
fingerprint
- (Optional) Fingerprint (e.g. github sha) associated with thefile
. -
name
- (Required) File name.
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 formatprojects/{{project}}/rulesets/{{name}}
-
createTime
- Output only. Time theruleset
was created. -
metadata
- Output only. The metadata for this ruleset. -
name
- Output only. Name of theruleset
. The ruleset_id is auto generated by the service. Format:projects/{projectId}/rulesets/{rulesetId}
Timeouts
This resource provides the following Timeouts configuration options:
create
- Default is 20 minutes.delete
- Default is 20 minutes.
Import
Ruleset can be imported using any of these accepted formats: