Google Cloud (GCP) Classic

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

Release

The Firebaserules Release resource

Example Usage

Basic_release

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var basic = new Gcp.Firebaserules.Ruleset("basic", 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 = "",
            },
        });
        var primary = new Gcp.Firebaserules.Release("primary", new Gcp.Firebaserules.ReleaseArgs
        {
            Project = "my-project-name",
            RulesetName = basic.Name.Apply(name => $"projects/my-project-name/rulesets/{name}"),
        });
        var minimal = new Gcp.Firebaserules.Ruleset("minimal", 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 (
	"fmt"

	"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 {
		basic, err := firebaserules.NewRuleset(ctx, "basic", &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
		}
		_, err = firebaserules.NewRelease(ctx, "primary", &firebaserules.ReleaseArgs{
			Project: pulumi.String("my-project-name"),
			RulesetName: basic.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("%v%v", "projects/my-project-name/rulesets/", name), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		_, err = firebaserules.NewRuleset(ctx, "minimal", &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 basic = new Ruleset("basic", 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());

        var primary = new Release("primary", ReleaseArgs.builder()        
            .project("my-project-name")
            .rulesetName(basic.name().apply(name -> String.format("projects/my-project-name/rulesets/%s", name)))
            .build());

        var minimal = new Ruleset("minimal", 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

basic = gcp.firebaserules.Ruleset("basic",
    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="",
    ))
primary = gcp.firebaserules.Release("primary",
    project="my-project-name",
    ruleset_name=basic.name.apply(lambda name: f"projects/my-project-name/rulesets/{name}"))
minimal = gcp.firebaserules.Ruleset("minimal",
    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 basic = new gcp.firebaserules.Ruleset("basic", {
    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: "",
    },
});
const primary = new gcp.firebaserules.Release("primary", {
    project: "my-project-name",
    rulesetName: pulumi.interpolate`projects/my-project-name/rulesets/${basic.name}`,
});
const minimal = new gcp.firebaserules.Ruleset("minimal", {
    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:Release
    properties:
      project: my-project-name
      rulesetName: projects/my-project-name/rulesets/${basic.name}
  basic:
    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:
    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

Minimal_release

using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var minimal = new Gcp.Firebaserules.Ruleset("minimal", 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",
                    },
                },
            },
        });
        var primary = new Gcp.Firebaserules.Release("primary", new Gcp.Firebaserules.ReleaseArgs
        {
            Project = "my-project-name",
            RulesetName = minimal.Name.Apply(name => $"projects/my-project-name/rulesets/{name}"),
        });
    }

}
package main

import (
	"fmt"

	"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 {
		minimal, err := firebaserules.NewRuleset(ctx, "minimal", &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{
			Project: pulumi.String("my-project-name"),
			RulesetName: minimal.Name.ApplyT(func(name string) (string, error) {
				return fmt.Sprintf("%v%v", "projects/my-project-name/rulesets/", name), nil
			}).(pulumi.StringOutput),
		})
		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 minimal = new Ruleset("minimal", 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()        
            .project("my-project-name")
            .rulesetName(minimal.name().apply(name -> String.format("projects/my-project-name/rulesets/%s", name)))
            .build());

    }
}
import pulumi
import pulumi_gcp as gcp

minimal = gcp.firebaserules.Ruleset("minimal",
    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",
        )],
    ))
primary = gcp.firebaserules.Release("primary",
    project="my-project-name",
    ruleset_name=minimal.name.apply(lambda name: f"projects/my-project-name/rulesets/{name}"))
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const minimal = new gcp.firebaserules.Ruleset("minimal", {
    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", {
    project: "my-project-name",
    rulesetName: pulumi.interpolate`projects/my-project-name/rulesets/${minimal.name}`,
});
resources:
  primary:
    type: gcp:firebaserules:Release
    properties:
      project: my-project-name
      rulesetName: projects/my-project-name/rulesets/${minimal.name}
  minimal:
    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 Release Resource

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

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.

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

The Release resource accepts the following input properties:

RulesetName string

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

Name string

Format: projects/{project_id}/releases/{release_id}

Project string

The project for the resource

RulesetName string

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

Name string

Format: projects/{project_id}/releases/{release_id}

Project string

The project for the resource

rulesetName String

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

name String

Format: projects/{project_id}/releases/{release_id}

project String

The project for the resource

rulesetName string

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

name string

Format: projects/{project_id}/releases/{release_id}

project string

The project for the resource

ruleset_name str

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

name str

Format: projects/{project_id}/releases/{release_id}

project str

The project for the resource

rulesetName String

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

name String

Format: projects/{project_id}/releases/{release_id}

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 an 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)
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 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}

Project string

The project for the resource

RulesetName string

Name of the Ruleset referred to by this Release. The Ruleset must exist 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}

Project string

The project for the resource

RulesetName string

Name of the Ruleset referred to by this Release. The Ruleset must exist 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}

project String

The project for the resource

rulesetName String

Name of the Ruleset referred to by this Release. The Ruleset must exist 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}

project string

The project for the resource

rulesetName string

Name of the Ruleset referred to by this Release. The Ruleset must exist 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}

project str

The project for the resource

ruleset_name str

Name of the Ruleset referred to by this Release. The Ruleset must exist 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}

project String

The project for the resource

rulesetName String

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

updateTime String

Output only. Time the release was updated.

Import

Release can be imported using any of these accepted formats

 $ pulumi import gcp:firebaserules/release:Release default projects/{{project}}/releases/{{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.