1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebaserules
  5. Release
Google Cloud v8.22.0 published on Thursday, Mar 13, 2025 by Pulumi

gcp.firebaserules.Release

Explore with Pulumi AI

gcp logo
Google Cloud v8.22.0 published on Thursday, Mar 13, 2025 by Pulumi

    For more information, see:

    Example Usage

    Firestore_release

    Creates a Firebase Rules Release to the default Cloud Firestore instance

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const firestore = new gcp.firebaserules.Ruleset("firestore", {
        project: "my-project-name",
        source: {
            files: [{
                content: "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
                name: "firestore.rules",
            }],
        },
    });
    const primary = new gcp.firebaserules.Release("primary", {
        name: "cloud.firestore",
        project: "my-project-name",
        rulesetName: pulumi.interpolate`projects/my-project-name/rulesets/${firestore.name}`,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    firestore = gcp.firebaserules.Ruleset("firestore",
        project="my-project-name",
        source={
            "files": [{
                "content": "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
                "name": "firestore.rules",
            }],
        })
    primary = gcp.firebaserules.Release("primary",
        name="cloud.firestore",
        project="my-project-name",
        ruleset_name=firestore.name.apply(lambda name: f"projects/my-project-name/rulesets/{name}"))
    
    package main
    
    import (
    	"fmt"
    
    	"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 {
    		firestore, err := firebaserules.NewRuleset(ctx, "firestore", &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
    		}
    		_, err = firebaserules.NewRelease(ctx, "primary", &firebaserules.ReleaseArgs{
    			Name:    pulumi.String("cloud.firestore"),
    			Project: pulumi.String("my-project-name"),
    			RulesetName: firestore.Name.ApplyT(func(name string) (string, error) {
    				return fmt.Sprintf("projects/my-project-name/rulesets/%v", name), nil
    			}).(pulumi.StringOutput),
    		})
    		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 firestore = new Gcp.Firebaserules.Ruleset("firestore", new()
        {
            Project = "my-project-name",
            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",
                    },
                },
            },
        });
    
        var primary = new Gcp.Firebaserules.Release("primary", new()
        {
            Name = "cloud.firestore",
            Project = "my-project-name",
            RulesetName = firestore.Name.Apply(name => $"projects/my-project-name/rulesets/{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 com.pulumi.gcp.firebaserules.Release;
    import com.pulumi.gcp.firebaserules.ReleaseArgs;
    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 firestore = new Ruleset("firestore", 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());
    
            var primary = new Release("primary", ReleaseArgs.builder()
                .name("cloud.firestore")
                .project("my-project-name")
                .rulesetName(firestore.name().applyValue(name -> String.format("projects/my-project-name/rulesets/%s", name)))
                .build());
    
        }
    }
    
    resources:
      primary:
        type: gcp:firebaserules:Release
        properties:
          name: cloud.firestore
          project: my-project-name
          rulesetName: projects/my-project-name/rulesets/${firestore.name}
      firestore:
        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
    

    Firestore_release_additional

    Creates a Firebase Rules Release to an additional Cloud Firestore instance

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const firestore = new gcp.firebaserules.Ruleset("firestore", {
        project: "my-project-name",
        source: {
            files: [{
                content: "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
                name: "firestore.rules",
            }],
        },
    });
    const primary = new gcp.firebaserules.Release("primary", {
        name: "cloud.firestore/database",
        project: "my-project-name",
        rulesetName: pulumi.interpolate`projects/my-project-name/rulesets/${firestore.name}`,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    firestore = gcp.firebaserules.Ruleset("firestore",
        project="my-project-name",
        source={
            "files": [{
                "content": "service cloud.firestore {match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }",
                "name": "firestore.rules",
            }],
        })
    primary = gcp.firebaserules.Release("primary",
        name="cloud.firestore/database",
        project="my-project-name",
        ruleset_name=firestore.name.apply(lambda name: f"projects/my-project-name/rulesets/{name}"))
    
    package main
    
    import (
    	"fmt"
    
    	"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 {
    		firestore, err := firebaserules.NewRuleset(ctx, "firestore", &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
    		}
    		_, err = firebaserules.NewRelease(ctx, "primary", &firebaserules.ReleaseArgs{
    			Name:    pulumi.String("cloud.firestore/database"),
    			Project: pulumi.String("my-project-name"),
    			RulesetName: firestore.Name.ApplyT(func(name string) (string, error) {
    				return fmt.Sprintf("projects/my-project-name/rulesets/%v", name), nil
    			}).(pulumi.StringOutput),
    		})
    		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 firestore = new Gcp.Firebaserules.Ruleset("firestore", new()
        {
            Project = "my-project-name",
            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",
                    },
                },
            },
        });
    
        var primary = new Gcp.Firebaserules.Release("primary", new()
        {
            Name = "cloud.firestore/database",
            Project = "my-project-name",
            RulesetName = firestore.Name.Apply(name => $"projects/my-project-name/rulesets/{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 com.pulumi.gcp.firebaserules.Release;
    import com.pulumi.gcp.firebaserules.ReleaseArgs;
    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 firestore = new Ruleset("firestore", 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());
    
            var primary = new Release("primary", ReleaseArgs.builder()
                .name("cloud.firestore/database")
                .project("my-project-name")
                .rulesetName(firestore.name().applyValue(name -> String.format("projects/my-project-name/rulesets/%s", name)))
                .build());
    
        }
    }
    
    resources:
      primary:
        type: gcp:firebaserules:Release
        properties:
          name: cloud.firestore/database
          project: my-project-name
          rulesetName: projects/my-project-name/rulesets/${firestore.name}
      firestore:
        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
    

    Import

    Release can be imported using any of these accepted formats:

    • projects/{{project}}/releases/{{name}}

    When using the pulumi import command, Release can be imported using one of the formats above. For example:

    $ pulumi import gcp:firebaserules/release:Release default projects/{{project}}/releases/{{name}}
    

    Create Release Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Release(name: string, args: ReleaseArgs, opts?: CustomResourceOptions);
    @overload
    def Release(resource_name: str,
                args: ReleaseArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Release(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                ruleset_name: Optional[str] = None,
                name: Optional[str] = None,
                project: Optional[str] = None)
    func NewRelease(ctx *Context, name string, args ReleaseArgs, opts ...ResourceOption) (*Release, error)
    public Release(string name, ReleaseArgs args, CustomResourceOptions? opts = null)
    public Release(String name, ReleaseArgs args)
    public Release(String name, ReleaseArgs args, CustomResourceOptions options)
    
    type: gcp:firebaserules:Release
    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 ReleaseArgs
    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 ReleaseArgs
    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 ReleaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReleaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReleaseArgs
    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 releaseResource = new Gcp.Firebaserules.Release("releaseResource", new()
    {
        RulesetName = "string",
        Name = "string",
        Project = "string",
    });
    
    example, err := firebaserules.NewRelease(ctx, "releaseResource", &firebaserules.ReleaseArgs{
    	RulesetName: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Project:     pulumi.String("string"),
    })
    
    var releaseResource = new Release("releaseResource", ReleaseArgs.builder()
        .rulesetName("string")
        .name("string")
        .project("string")
        .build());
    
    release_resource = gcp.firebaserules.Release("releaseResource",
        ruleset_name="string",
        name="string",
        project="string")
    
    const releaseResource = new gcp.firebaserules.Release("releaseResource", {
        rulesetName: "string",
        name: "string",
        project: "string",
    });
    
    type: gcp:firebaserules:Release
    properties:
        name: string
        project: string
        rulesetName: string
    

    Release 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 Release resource accepts the following input properties:

    RulesetName string
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    Name string
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    Project string
    The project for the resource
    RulesetName string
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    Name string
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    Project string
    The project for the resource
    rulesetName String
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    name String
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project String
    The project for the resource
    rulesetName string
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    name string
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project string
    The project for the resource
    ruleset_name str
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    name str
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project str
    The project for the resource
    rulesetName String
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    name String
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project String
    The project for the resource

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Release resource produces the following output properties:

    CreateTime string
    Output only. Time the release was created.
    Disabled bool
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    Output only. Time the release was updated.
    CreateTime string
    Output only. Time the release was created.
    Disabled bool
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdateTime string
    Output only. Time the release was updated.
    createTime String
    Output only. Time the release was created.
    disabled Boolean
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    Output only. Time the release was updated.
    createTime string
    Output only. Time the release was created.
    disabled boolean
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    id string
    The provider-assigned unique ID for this managed resource.
    updateTime string
    Output only. Time the release was updated.
    create_time str
    Output only. Time the release was created.
    disabled bool
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    id str
    The provider-assigned unique ID for this managed resource.
    update_time str
    Output only. Time the release was updated.
    createTime String
    Output only. Time the release was created.
    disabled Boolean
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    id String
    The provider-assigned unique ID for this managed resource.
    updateTime String
    Output only. Time the release was updated.

    Look up Existing Release Resource

    Get an existing Release 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?: ReleaseState, opts?: CustomResourceOptions): Release
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            disabled: Optional[bool] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            ruleset_name: Optional[str] = None,
            update_time: Optional[str] = None) -> Release
    func GetRelease(ctx *Context, name string, id IDInput, state *ReleaseState, opts ...ResourceOption) (*Release, error)
    public static Release Get(string name, Input<string> id, ReleaseState? state, CustomResourceOptions? opts = null)
    public static Release get(String name, Output<String> id, ReleaseState state, CustomResourceOptions options)
    resources:  _:    type: gcp:firebaserules:Release    get:      id: ${id}
    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 release was created.
    Disabled bool
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    Name string
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    Project string
    The project for the resource
    RulesetName string
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    UpdateTime string
    Output only. Time the release was updated.
    CreateTime string
    Output only. Time the release was created.
    Disabled bool
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    Name string
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    Project string
    The project for the resource
    RulesetName string
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    UpdateTime string
    Output only. Time the release was updated.
    createTime String
    Output only. Time the release was created.
    disabled Boolean
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    name String
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project String
    The project for the resource
    rulesetName String
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    updateTime String
    Output only. Time the release was updated.
    createTime string
    Output only. Time the release was created.
    disabled boolean
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    name string
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project string
    The project for the resource
    rulesetName string
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    updateTime string
    Output only. Time the release was updated.
    create_time str
    Output only. Time the release was created.
    disabled bool
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    name str
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project str
    The project for the resource
    ruleset_name str
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    update_time str
    Output only. Time the release was updated.
    createTime String
    Output only. Time the release was created.
    disabled Boolean
    Disable the release to keep it from being served. The response code of NOT_FOUND will be given for executables generated from this Release.
    name String
    Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
    project String
    The project for the resource
    rulesetName String
    Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


    updateTime String
    Output only. Time the release was updated.

    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.
    gcp logo
    Google Cloud v8.22.0 published on Thursday, Mar 13, 2025 by Pulumi