1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. firebaserules
  5. Release
Google Cloud v8.25.1 published on Wednesday, Apr 9, 2025 by Pulumi

gcp.firebaserules.Release

Explore with Pulumi AI

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}`,
});
Copy
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}"))
Copy
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
	})
}
Copy
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}"),
    });

});
Copy
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());

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

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}`,
});
Copy
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}"))
Copy
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
	})
}
Copy
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}"),
    });

});
Copy
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());

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

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

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 This property is required. string
The unique name of the resource.
args This property is required. ReleaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. ReleaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ReleaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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",
});
Copy
example, err := firebaserules.NewRelease(ctx, "releaseResource", &firebaserules.ReleaseArgs{
	RulesetName: pulumi.String("string"),
	Name:        pulumi.String("string"),
	Project:     pulumi.String("string"),
})
Copy
var releaseResource = new Release("releaseResource", ReleaseArgs.builder()
    .rulesetName("string")
    .name("string")
    .project("string")
    .build());
Copy
release_resource = gcp.firebaserules.Release("releaseResource",
    ruleset_name="string",
    name="string",
    project="string")
Copy
const releaseResource = new gcp.firebaserules.Release("releaseResource", {
    rulesetName: "string",
    name: "string",
    project: "string",
});
Copy
type: gcp:firebaserules:Release
properties:
    name: string
    project: string
    rulesetName: string
Copy

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
This property is required.
Changes to this property will trigger replacement.
string
Name of the Ruleset referred to by this Release. The Ruleset must exist for the Release to be created.


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


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


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


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


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


name Changes to this property will trigger replacement. String
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
project Changes to this property will trigger replacement. 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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 Changes to this property will trigger replacement. string
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
Project Changes to this property will trigger replacement. string
The project for the resource
RulesetName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
Project Changes to this property will trigger replacement. string
The project for the resource
RulesetName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
project Changes to this property will trigger replacement. String
The project for the resource
rulesetName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
project Changes to this property will trigger replacement. string
The project for the resource
rulesetName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
project Changes to this property will trigger replacement. str
The project for the resource
ruleset_name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
Format: projects/{project_id}/releases/{release_id}\Firestore Rules Releases will always have the name 'cloud.firestore'
project Changes to this property will trigger replacement. String
The project for the resource
rulesetName Changes to this property will trigger replacement. 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.