Google Cloud (GCP) Classic

Pulumi Official
Package maintained by Pulumi
v6.29.0 published on Monday, Jun 27, 2022 by Pulumi

Ruleset

The Firebaserules Ruleset resource

Example Usage

Basic_ruleset

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var primary = new Gcp.Firebaserules.Ruleset("primary", new Gcp.Firebaserules.RulesetArgs
        {
            Project = "my-project-name",
            Source = new Gcp.Firebaserules.Inputs.RulesetSourceArgs
            {
                Files = 
                {
                    new Gcp.Firebaserules.Inputs.RulesetSourceFileArgs
                    {
                        Content = "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
                        Fingerprint = "",
                        Name = "firestore.rules",
                    },
                },
                Language = "",
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
			Project: pulumi.String("my-project-name"),
			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; } } }"),
						Fingerprint: pulumi.String(""),
						Name:        pulumi.String("firestore.rules"),
					},
				},
				Language: pulumi.String(""),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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()        
            .project("my-project-name")
            .source(RulesetSourceArgs.builder()
                .files(RulesetSourceFileArgs.builder()
                    .content("service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }")
                    .fingerprint("")
                    .name("firestore.rules")
                    .build())
                .language("")
                .build())
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

primary = gcp.firebaserules.Ruleset("primary",
    project="my-project-name",
    source=gcp.firebaserules.RulesetSourceArgs(
        files=[gcp.firebaserules.RulesetSourceFileArgs(
            content="service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
            fingerprint="",
            name="firestore.rules",
        )],
        language="",
    ))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const primary = new gcp.firebaserules.Ruleset("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: "",
    },
});
resources:
  primary:
    type: gcp:firebaserules:Ruleset
    properties:
      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:

Minimal_ruleset

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var primary = new Gcp.Firebaserules.Ruleset("primary", new Gcp.Firebaserules.RulesetArgs
        {
            Project = "my-project-name",
            Source = new Gcp.Firebaserules.Inputs.RulesetSourceArgs
            {
                Files = 
                {
                    new Gcp.Firebaserules.Inputs.RulesetSourceFileArgs
                    {
                        Content = "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
                        Name = "firestore.rules",
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v6/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{
			Project: pulumi.String("my-project-name"),
			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"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

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()        
            .project("my-project-name")
            .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())
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

primary = gcp.firebaserules.Ruleset("primary",
    project="my-project-name",
    source=gcp.firebaserules.RulesetSourceArgs(
        files=[gcp.firebaserules.RulesetSourceFileArgs(
            content="service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
            name="firestore.rules",
        )],
    ))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const primary = new gcp.firebaserules.Ruleset("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",
        }],
    },
});
resources:
  primary:
    type: gcp:firebaserules:Ruleset
    properties:
      project: my-project-name
      source:
        files:
          - content: 'service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }'
            name: firestore.rules

Create a Ruleset Resource

new Ruleset(name: string, args: RulesetArgs, opts?: CustomResourceOptions);
@overload
def Ruleset(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            project: Optional[str] = None,
            source: Optional[RulesetSourceArgs] = None)
@overload
def Ruleset(resource_name: str,
            args: RulesetArgs,
            opts: Optional[ResourceOptions] = 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.

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.

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

The Ruleset resource accepts the following input properties:

Source RulesetSourceArgs

Source for the Ruleset.

Project string

The project for the resource

Source RulesetSourceArgs

Source for the Ruleset.

Project string

The project for the resource

source RulesetSourceArgs

Source for the Ruleset.

project String

The project for the resource

source RulesetSourceArgs

Source for the Ruleset.

project string

The project for the resource

source RulesetSourceArgs

Source for the Ruleset.

project str

The project for the resource

source Property Map

Source for the Ruleset.

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:

CreateTime string

Output only. Time the Ruleset was created.

Id string

The provider-assigned unique ID for this managed resource.

Metadatas List<RulesetMetadata>

Output only. The metadata for this ruleset.

Name string

File name.

CreateTime string

Output only. Time the Ruleset was created.

Id string

The provider-assigned unique ID for this managed resource.

Metadatas []RulesetMetadata

Output only. The metadata for this ruleset.

Name string

File name.

createTime String

Output only. Time the Ruleset was created.

id String

The provider-assigned unique ID for this managed resource.

metadatas List<RulesetMetadata>

Output only. The metadata for this ruleset.

name String

File name.

createTime string

Output only. Time the Ruleset was created.

id string

The provider-assigned unique ID for this managed resource.

metadatas RulesetMetadata[]

Output only. The metadata for this ruleset.

name string

File name.

create_time str

Output only. Time the Ruleset was created.

id str

The provider-assigned unique ID for this managed resource.

metadatas Sequence[RulesetMetadata]

Output only. The metadata for this ruleset.

name str

File name.

createTime 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

File name.

Look up an 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.
The following state arguments are supported:
CreateTime string

Output only. Time the Ruleset was created.

Metadatas List<RulesetMetadataArgs>

Output only. The metadata for this ruleset.

Name string

File name.

Project string

The project for the resource

Source RulesetSourceArgs

Source for the Ruleset.

CreateTime string

Output only. Time the Ruleset was created.

Metadatas []RulesetMetadataArgs

Output only. The metadata for this ruleset.

Name string

File name.

Project string

The project for the resource

Source RulesetSourceArgs

Source for the Ruleset.

createTime String

Output only. Time the Ruleset was created.

metadatas List<RulesetMetadataArgs>

Output only. The metadata for this ruleset.

name String

File name.

project String

The project for the resource

source RulesetSourceArgs

Source for the Ruleset.

createTime string

Output only. Time the Ruleset was created.

metadatas RulesetMetadataArgs[]

Output only. The metadata for this ruleset.

name string

File name.

project string

The project for the resource

source RulesetSourceArgs

Source for the Ruleset.

create_time str

Output only. Time the Ruleset was created.

metadatas Sequence[RulesetMetadataArgs]

Output only. The metadata for this ruleset.

name str

File name.

project str

The project for the resource

source RulesetSourceArgs

Source for the Ruleset.

createTime String

Output only. Time the Ruleset was created.

metadatas List<Property Map>

Output only. The metadata for this ruleset.

name String

File name.

project String

The project for the resource

source Property Map

Source for the Ruleset.

Supporting Types

RulesetMetadata

Services List<string>
Services []string
services List<String>
services string[]
services Sequence[str]
services List<String>

RulesetSource

Files List<RulesetSourceFile>

File set constituting the Source bundle.

Language string

Language of the Source bundle. If unspecified, the language will default to FIREBASE_RULES. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS

Files []RulesetSourceFile

File set constituting the Source bundle.

Language string

Language of the Source bundle. If unspecified, the language will default to FIREBASE_RULES. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS

files List<RulesetSourceFile>

File set constituting the Source bundle.

language String

Language of the Source bundle. If unspecified, the language will default to FIREBASE_RULES. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS

files RulesetSourceFile[]

File set constituting the Source bundle.

language string

Language of the Source bundle. If unspecified, the language will default to FIREBASE_RULES. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS

files Sequence[RulesetSourceFile]

File set constituting the Source bundle.

language str

Language of the Source bundle. If unspecified, the language will default to FIREBASE_RULES. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS

files List<Property Map>

File set constituting the Source bundle.

language String

Language of the Source bundle. If unspecified, the language will default to FIREBASE_RULES. Possible values: LANGUAGE_UNSPECIFIED, FIREBASE_RULES, EVENT_FLOW_TRIGGERS

RulesetSourceFile

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

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

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes

This Pulumi package is based on the google-beta Terraform Provider.