1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. pubsub
  5. LiteReservation
Google Cloud v8.26.0 published on Thursday, Apr 10, 2025 by Pulumi

gcp.pubsub.LiteReservation

Explore with Pulumi AI

A named resource representing a shared pool of capacity.

To get more information about Reservation, see:

Example Usage

Pubsub Lite Reservation Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const project = gcp.organizations.getProject({});
const example = new gcp.pubsub.LiteReservation("example", {
    name: "example-reservation",
    project: project.then(project => project.number),
    throughputCapacity: 2,
});
Copy
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.get_project()
example = gcp.pubsub.LiteReservation("example",
    name="example-reservation",
    project=project.number,
    throughput_capacity=2)
Copy
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/pubsub"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := organizations.LookupProject(ctx, &organizations.LookupProjectArgs{}, nil)
		if err != nil {
			return err
		}
		_, err = pubsub.NewLiteReservation(ctx, "example", &pubsub.LiteReservationArgs{
			Name:               pulumi.String("example-reservation"),
			Project:            pulumi.String(project.Number),
			ThroughputCapacity: pulumi.Int(2),
		})
		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 project = Gcp.Organizations.GetProject.Invoke();

    var example = new Gcp.PubSub.LiteReservation("example", new()
    {
        Name = "example-reservation",
        Project = project.Apply(getProjectResult => getProjectResult.Number),
        ThroughputCapacity = 2,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.organizations.inputs.GetProjectArgs;
import com.pulumi.gcp.pubsub.LiteReservation;
import com.pulumi.gcp.pubsub.LiteReservationArgs;
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) {
        final var project = OrganizationsFunctions.getProject(GetProjectArgs.builder()
            .build());

        var example = new LiteReservation("example", LiteReservationArgs.builder()
            .name("example-reservation")
            .project(project.number())
            .throughputCapacity(2)
            .build());

    }
}
Copy
resources:
  example:
    type: gcp:pubsub:LiteReservation
    properties:
      name: example-reservation
      project: ${project.number}
      throughputCapacity: 2
variables:
  project:
    fn::invoke:
      function: gcp:organizations:getProject
      arguments: {}
Copy

Create LiteReservation Resource

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

Constructor syntax

new LiteReservation(name: string, args: LiteReservationArgs, opts?: CustomResourceOptions);
@overload
def LiteReservation(resource_name: str,
                    args: LiteReservationArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def LiteReservation(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    throughput_capacity: Optional[int] = None,
                    name: Optional[str] = None,
                    project: Optional[str] = None,
                    region: Optional[str] = None)
func NewLiteReservation(ctx *Context, name string, args LiteReservationArgs, opts ...ResourceOption) (*LiteReservation, error)
public LiteReservation(string name, LiteReservationArgs args, CustomResourceOptions? opts = null)
public LiteReservation(String name, LiteReservationArgs args)
public LiteReservation(String name, LiteReservationArgs args, CustomResourceOptions options)
type: gcp:pubsub:LiteReservation
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. LiteReservationArgs
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. LiteReservationArgs
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. LiteReservationArgs
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. LiteReservationArgs
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. LiteReservationArgs
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 liteReservationResource = new Gcp.PubSub.LiteReservation("liteReservationResource", new()
{
    ThroughputCapacity = 0,
    Name = "string",
    Project = "string",
    Region = "string",
});
Copy
example, err := pubsub.NewLiteReservation(ctx, "liteReservationResource", &pubsub.LiteReservationArgs{
	ThroughputCapacity: pulumi.Int(0),
	Name:               pulumi.String("string"),
	Project:            pulumi.String("string"),
	Region:             pulumi.String("string"),
})
Copy
var liteReservationResource = new LiteReservation("liteReservationResource", LiteReservationArgs.builder()
    .throughputCapacity(0)
    .name("string")
    .project("string")
    .region("string")
    .build());
Copy
lite_reservation_resource = gcp.pubsub.LiteReservation("liteReservationResource",
    throughput_capacity=0,
    name="string",
    project="string",
    region="string")
Copy
const liteReservationResource = new gcp.pubsub.LiteReservation("liteReservationResource", {
    throughputCapacity: 0,
    name: "string",
    project: "string",
    region: "string",
});
Copy
type: gcp:pubsub:LiteReservation
properties:
    name: string
    project: string
    region: string
    throughputCapacity: 0
Copy

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

ThroughputCapacity This property is required. int
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
Name Changes to this property will trigger replacement. string
Name of the reservation.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
The region of the pubsub lite reservation.
ThroughputCapacity This property is required. int
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
Name Changes to this property will trigger replacement. string
Name of the reservation.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
The region of the pubsub lite reservation.
throughputCapacity This property is required. Integer
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. String
Name of the reservation.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
The region of the pubsub lite reservation.
throughputCapacity This property is required. number
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. string
Name of the reservation.


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region string
The region of the pubsub lite reservation.
throughput_capacity This property is required. int
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. str
Name of the reservation.


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region str
The region of the pubsub lite reservation.
throughputCapacity This property is required. Number
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. String
Name of the reservation.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
The region of the pubsub lite reservation.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing LiteReservation Resource

Get an existing LiteReservation 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?: LiteReservationState, opts?: CustomResourceOptions): LiteReservation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        project: Optional[str] = None,
        region: Optional[str] = None,
        throughput_capacity: Optional[int] = None) -> LiteReservation
func GetLiteReservation(ctx *Context, name string, id IDInput, state *LiteReservationState, opts ...ResourceOption) (*LiteReservation, error)
public static LiteReservation Get(string name, Input<string> id, LiteReservationState? state, CustomResourceOptions? opts = null)
public static LiteReservation get(String name, Output<String> id, LiteReservationState state, CustomResourceOptions options)
resources:  _:    type: gcp:pubsub:LiteReservation    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:
Name Changes to this property will trigger replacement. string
Name of the reservation.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
The region of the pubsub lite reservation.
ThroughputCapacity int
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
Name Changes to this property will trigger replacement. string
Name of the reservation.


Project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Region string
The region of the pubsub lite reservation.
ThroughputCapacity int
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. String
Name of the reservation.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
The region of the pubsub lite reservation.
throughputCapacity Integer
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. string
Name of the reservation.


project Changes to this property will trigger replacement. string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region string
The region of the pubsub lite reservation.
throughputCapacity number
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. str
Name of the reservation.


project Changes to this property will trigger replacement. str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region str
The region of the pubsub lite reservation.
throughput_capacity int
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.
name Changes to this property will trigger replacement. String
Name of the reservation.


project Changes to this property will trigger replacement. String
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
region String
The region of the pubsub lite reservation.
throughputCapacity Number
The reserved throughput capacity. Every unit of throughput capacity is equivalent to 1 MiB/s of published messages or 2 MiB/s of subscribed messages.

Import

Reservation can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{region}}/reservations/{{name}}

  • {{project}}/{{region}}/{{name}}

  • {{region}}/{{name}}

  • {{name}}

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

$ pulumi import gcp:pubsub/liteReservation:LiteReservation default projects/{{project}}/locations/{{region}}/reservations/{{name}}
Copy
$ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{project}}/{{region}}/{{name}}
Copy
$ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{region}}/{{name}}
Copy
$ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{name}}
Copy

To learn more about importing existing cloud resources, see Importing resources.

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.