gcp.firebaserules.Ruleset
Explore with Pulumi AI
For more information, see:
Example Usage
Basic_ruleset
Creates a basic Firestore ruleset
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const primary = new gcp.firebaserules.Ruleset("primary", {
source: {
files: [{
content: "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
name: "firestore.rules",
fingerprint: "",
}],
language: "",
},
project: "my-project-name",
});
import pulumi
import pulumi_gcp as gcp
primary = gcp.firebaserules.Ruleset("primary",
source={
"files": [{
"content": "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
"name": "firestore.rules",
"fingerprint": "",
}],
"language": "",
},
project="my-project-name")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/firebaserules"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := firebaserules.NewRuleset(ctx, "primary", &firebaserules.RulesetArgs{
Source: &firebaserules.RulesetSourceArgs{
Files: firebaserules.RulesetSourceFileArray{
&firebaserules.RulesetSourceFileArgs{
Content: pulumi.String("service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }"),
Name: pulumi.String("firestore.rules"),
Fingerprint: pulumi.String(""),
},
},
Language: pulumi.String(""),
},
Project: pulumi.String("my-project-name"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var primary = new Gcp.Firebaserules.Ruleset("primary", new()
{
Source = new Gcp.Firebaserules.Inputs.RulesetSourceArgs
{
Files = new[]
{
new Gcp.Firebaserules.Inputs.RulesetSourceFileArgs
{
Content = "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
Name = "firestore.rules",
Fingerprint = "",
},
},
Language = "",
},
Project = "my-project-name",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firebaserules.Ruleset;
import com.pulumi.gcp.firebaserules.RulesetArgs;
import com.pulumi.gcp.firebaserules.inputs.RulesetSourceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primary = new Ruleset("primary", RulesetArgs.builder()
.source(RulesetSourceArgs.builder()
.files(RulesetSourceFileArgs.builder()
.content("service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }")
.name("firestore.rules")
.fingerprint("")
.build())
.language("")
.build())
.project("my-project-name")
.build());
}
}
resources:
primary:
type: gcp:firebaserules:Ruleset
properties:
source:
files:
- content: 'service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }'
name: firestore.rules
fingerprint: ""
language: ""
project: my-project-name
Minimal_ruleset
Creates a minimal Firestore ruleset
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const primary = new gcp.firebaserules.Ruleset("primary", {
source: {
files: [{
content: "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
name: "firestore.rules",
}],
},
project: "my-project-name",
});
import pulumi
import pulumi_gcp as gcp
primary = gcp.firebaserules.Ruleset("primary",
source={
"files": [{
"content": "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
"name": "firestore.rules",
}],
},
project="my-project-name")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/firebaserules"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := firebaserules.NewRuleset(ctx, "primary", &firebaserules.RulesetArgs{
Source: &firebaserules.RulesetSourceArgs{
Files: firebaserules.RulesetSourceFileArray{
&firebaserules.RulesetSourceFileArgs{
Content: pulumi.String("service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }"),
Name: pulumi.String("firestore.rules"),
},
},
},
Project: pulumi.String("my-project-name"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var primary = new Gcp.Firebaserules.Ruleset("primary", new()
{
Source = new Gcp.Firebaserules.Inputs.RulesetSourceArgs
{
Files = new[]
{
new Gcp.Firebaserules.Inputs.RulesetSourceFileArgs
{
Content = "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
Name = "firestore.rules",
},
},
},
Project = "my-project-name",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.firebaserules.Ruleset;
import com.pulumi.gcp.firebaserules.RulesetArgs;
import com.pulumi.gcp.firebaserules.inputs.RulesetSourceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primary = new Ruleset("primary", RulesetArgs.builder()
.source(RulesetSourceArgs.builder()
.files(RulesetSourceFileArgs.builder()
.content("service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }")
.name("firestore.rules")
.build())
.build())
.project("my-project-name")
.build());
}
}
resources:
primary:
type: gcp:firebaserules:Ruleset
properties:
source:
files:
- content: 'service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }'
name: firestore.rules
project: my-project-name
Create Ruleset Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Ruleset(name: string, args: RulesetArgs, opts?: CustomResourceOptions);
@overload
def Ruleset(resource_name: str,
args: RulesetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Ruleset(resource_name: str,
opts: Optional[ResourceOptions] = None,
source: Optional[RulesetSourceArgs] = None,
project: Optional[str] = None)
func NewRuleset(ctx *Context, name string, args RulesetArgs, opts ...ResourceOption) (*Ruleset, error)
public Ruleset(string name, RulesetArgs args, CustomResourceOptions? opts = null)
public Ruleset(String name, RulesetArgs args)
public Ruleset(String name, RulesetArgs args, CustomResourceOptions options)
type: gcp:firebaserules:Ruleset
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RulesetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args RulesetArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args RulesetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RulesetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RulesetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var rulesetResource = new Gcp.Firebaserules.Ruleset("rulesetResource", new()
{
Source = new Gcp.Firebaserules.Inputs.RulesetSourceArgs
{
Files = new[]
{
new Gcp.Firebaserules.Inputs.RulesetSourceFileArgs
{
Content = "string",
Name = "string",
Fingerprint = "string",
},
},
Language = "string",
},
Project = "string",
});
example, err := firebaserules.NewRuleset(ctx, "rulesetResource", &firebaserules.RulesetArgs{
Source: &firebaserules.RulesetSourceArgs{
Files: firebaserules.RulesetSourceFileArray{
&firebaserules.RulesetSourceFileArgs{
Content: pulumi.String("string"),
Name: pulumi.String("string"),
Fingerprint: pulumi.String("string"),
},
},
Language: pulumi.String("string"),
},
Project: pulumi.String("string"),
})
var rulesetResource = new Ruleset("rulesetResource", RulesetArgs.builder()
.source(RulesetSourceArgs.builder()
.files(RulesetSourceFileArgs.builder()
.content("string")
.name("string")
.fingerprint("string")
.build())
.language("string")
.build())
.project("string")
.build());
ruleset_resource = gcp.firebaserules.Ruleset("rulesetResource",
source={
"files": [{
"content": "string",
"name": "string",
"fingerprint": "string",
}],
"language": "string",
},
project="string")
const rulesetResource = new gcp.firebaserules.Ruleset("rulesetResource", {
source: {
files: [{
content: "string",
name: "string",
fingerprint: "string",
}],
language: "string",
},
project: "string",
});
type: gcp:firebaserules:Ruleset
properties:
project: string
source:
files:
- content: string
fingerprint: string
name: string
language: string
Ruleset Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Ruleset resource accepts the following input properties:
- Source
Ruleset
Source Source
for theRuleset
.- Project string
- The project for the resource
- Source
Ruleset
Source Args Source
for theRuleset
.- Project string
- The project for the resource
- source
Ruleset
Source Source
for theRuleset
.- project String
- The project for the resource
- source
Ruleset
Source Source
for theRuleset
.- project string
- The project for the resource
- source
Ruleset
Source Args Source
for theRuleset
.- project str
- The project for the resource
- source Property Map
Source
for theRuleset
.- project String
- The project for the resource
Outputs
All input properties are implicitly available as output properties. Additionally, the Ruleset resource produces the following output properties:
- Create
Time string - Output only. Time the
Ruleset
was created. - Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
List<Ruleset
Metadata> - Output only. The metadata for this ruleset.
- Name string
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- Create
Time string - Output only. Time the
Ruleset
was created. - Id string
- The provider-assigned unique ID for this managed resource.
- Metadatas
[]Ruleset
Metadata - Output only. The metadata for this ruleset.
- Name string
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- create
Time String - Output only. Time the
Ruleset
was created. - id String
- The provider-assigned unique ID for this managed resource.
- metadatas
List<Ruleset
Metadata> - Output only. The metadata for this ruleset.
- name String
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- create
Time string - Output only. Time the
Ruleset
was created. - id string
- The provider-assigned unique ID for this managed resource.
- metadatas
Ruleset
Metadata[] - Output only. The metadata for this ruleset.
- name string
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- create_
time str - Output only. Time the
Ruleset
was created. - id str
- The provider-assigned unique ID for this managed resource.
- metadatas
Sequence[Ruleset
Metadata] - Output only. The metadata for this ruleset.
- name str
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- create
Time String - Output only. Time the
Ruleset
was created. - id String
- The provider-assigned unique ID for this managed resource.
- metadatas List<Property Map>
- Output only. The metadata for this ruleset.
- name String
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
Look up Existing Ruleset Resource
Get an existing Ruleset resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: RulesetState, opts?: CustomResourceOptions): Ruleset
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
metadatas: Optional[Sequence[RulesetMetadataArgs]] = None,
name: Optional[str] = None,
project: Optional[str] = None,
source: Optional[RulesetSourceArgs] = None) -> Ruleset
func GetRuleset(ctx *Context, name string, id IDInput, state *RulesetState, opts ...ResourceOption) (*Ruleset, error)
public static Ruleset Get(string name, Input<string> id, RulesetState? state, CustomResourceOptions? opts = null)
public static Ruleset get(String name, Output<String> id, RulesetState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Create
Time string - Output only. Time the
Ruleset
was created. - Metadatas
List<Ruleset
Metadata> - Output only. The metadata for this ruleset.
- Name string
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- Project string
- The project for the resource
- Source
Ruleset
Source Source
for theRuleset
.
- Create
Time string - Output only. Time the
Ruleset
was created. - Metadatas
[]Ruleset
Metadata Args - Output only. The metadata for this ruleset.
- Name string
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- Project string
- The project for the resource
- Source
Ruleset
Source Args Source
for theRuleset
.
- create
Time String - Output only. Time the
Ruleset
was created. - metadatas
List<Ruleset
Metadata> - Output only. The metadata for this ruleset.
- name String
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- project String
- The project for the resource
- source
Ruleset
Source Source
for theRuleset
.
- create
Time string - Output only. Time the
Ruleset
was created. - metadatas
Ruleset
Metadata[] - Output only. The metadata for this ruleset.
- name string
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- project string
- The project for the resource
- source
Ruleset
Source Source
for theRuleset
.
- create_
time str - Output only. Time the
Ruleset
was created. - metadatas
Sequence[Ruleset
Metadata Args] - Output only. The metadata for this ruleset.
- name str
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- project str
- The project for the resource
- source
Ruleset
Source Args Source
for theRuleset
.
- create
Time String - Output only. Time the
Ruleset
was created. - metadatas List<Property Map>
- Output only. The metadata for this ruleset.
- name String
- Output only. Name of the
Ruleset
. The ruleset_id is auto generated by the service. Format:projects/{project_id}/rulesets/{ruleset_id}
- project String
- The project for the resource
- source Property Map
Source
for theRuleset
.
Supporting Types
RulesetMetadata, RulesetMetadataArgs
- Services List<string>
- Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
- Services []string
- Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
- services List<String>
- Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
- services string[]
- Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
- services Sequence[str]
- Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
- services List<String>
- Services that this ruleset has declarations for (e.g., "cloud.firestore"). There may be 0+ of these.
RulesetSource, RulesetSourceArgs
- Files
List<Ruleset
Source File> File
set constituting theSource
bundle.- Language string
Language
of theSource
bundle. If unspecified, the language will default toFIREBASE_RULES
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
- Files
[]Ruleset
Source File File
set constituting theSource
bundle.- Language string
Language
of theSource
bundle. If unspecified, the language will default toFIREBASE_RULES
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
- files
List<Ruleset
Source File> File
set constituting theSource
bundle.- language String
Language
of theSource
bundle. If unspecified, the language will default toFIREBASE_RULES
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
- files
Ruleset
Source File[] File
set constituting theSource
bundle.- language string
Language
of theSource
bundle. If unspecified, the language will default toFIREBASE_RULES
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
- files
Sequence[Ruleset
Source File] File
set constituting theSource
bundle.- language str
Language
of theSource
bundle. If unspecified, the language will default toFIREBASE_RULES
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
- files List<Property Map>
File
set constituting theSource
bundle.- language String
Language
of theSource
bundle. If unspecified, the language will default toFIREBASE_RULES
. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS
RulesetSourceFile, RulesetSourceFileArgs
- Content string
- Textual Content.
- Name string
- File name.
- Fingerprint string
- Fingerprint (e.g. github sha) associated with the
File
.
- Content string
- Textual Content.
- Name string
- File name.
- Fingerprint string
- Fingerprint (e.g. github sha) associated with the
File
.
- content String
- Textual Content.
- name String
- File name.
- fingerprint String
- Fingerprint (e.g. github sha) associated with the
File
.
- content string
- Textual Content.
- name string
- File name.
- fingerprint string
- Fingerprint (e.g. github sha) associated with the
File
.
- content str
- Textual Content.
- name str
- File name.
- fingerprint str
- Fingerprint (e.g. github sha) associated with the
File
.
- content String
- Textual Content.
- name String
- File name.
- fingerprint String
- Fingerprint (e.g. github sha) associated with the
File
.
Import
Ruleset can be imported using any of these accepted formats:
projects/{{project}}/rulesets/{{name}}
{{project}}/{{name}}
{{name}}
When using the pulumi import
command, Ruleset can be imported using one of the formats above. For example:
$ pulumi import gcp:firebaserules/ruleset:Ruleset default projects/{{project}}/rulesets/{{name}}
$ pulumi import gcp:firebaserules/ruleset:Ruleset default {{project}}/{{name}}
$ pulumi import gcp:firebaserules/ruleset:Ruleset default {{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.