UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

151 lines (150 loc) 5.05 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * For more information, see: * * [Get started with Firebase Security Rules](https://firebase.google.com/docs/rules/get-started) * ## Example Usage * * ### Basic_ruleset * Creates a basic Firestore ruleset * ```typescript * 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", * }); * ``` * ### Minimal_ruleset * Creates a minimal Firestore ruleset * ```typescript * 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 * * 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: * * ```sh * $ pulumi import gcp:firebaserules/ruleset:Ruleset default projects/{{project}}/rulesets/{{name}} * ``` * * ```sh * $ pulumi import gcp:firebaserules/ruleset:Ruleset default {{project}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:firebaserules/ruleset:Ruleset default {{name}} * ``` */ export declare class Ruleset extends pulumi.CustomResource { /** * Get an existing Ruleset resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RulesetState, opts?: pulumi.CustomResourceOptions): Ruleset; /** * Returns true if the given object is an instance of Ruleset. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Ruleset; /** * Output only. Time the `Ruleset` was created. */ readonly createTime: pulumi.Output<string>; /** * Output only. The metadata for this ruleset. */ readonly metadatas: pulumi.Output<outputs.firebaserules.RulesetMetadata[]>; /** * Output only. Name of the `Ruleset`. The rulesetId is auto generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}` */ readonly name: pulumi.Output<string>; /** * The project for the resource */ readonly project: pulumi.Output<string>; /** * `Source` for the `Ruleset`. */ readonly source: pulumi.Output<outputs.firebaserules.RulesetSource>; /** * Create a Ruleset resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: RulesetArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Ruleset resources. */ export interface RulesetState { /** * Output only. Time the `Ruleset` was created. */ createTime?: pulumi.Input<string>; /** * Output only. The metadata for this ruleset. */ metadatas?: pulumi.Input<pulumi.Input<inputs.firebaserules.RulesetMetadata>[]>; /** * Output only. Name of the `Ruleset`. The rulesetId is auto generated by the service. Format: `projects/{project_id}/rulesets/{ruleset_id}` */ name?: pulumi.Input<string>; /** * The project for the resource */ project?: pulumi.Input<string>; /** * `Source` for the `Ruleset`. */ source?: pulumi.Input<inputs.firebaserules.RulesetSource>; } /** * The set of arguments for constructing a Ruleset resource. */ export interface RulesetArgs { /** * The project for the resource */ project?: pulumi.Input<string>; /** * `Source` for the `Ruleset`. */ source: pulumi.Input<inputs.firebaserules.RulesetSource>; }