1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. pubsub
  5. LiteReservation
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

gcp.pubsub.LiteReservation

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi

    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,
    });
    
    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)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
    	"github.com/pulumi/pulumi-gcp/sdk/v7/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, nil, 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
    	})
    }
    
    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,
        });
    
    });
    
    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();
    
            var example = new LiteReservation("example", LiteReservationArgs.builder()        
                .name("example-reservation")
                .project(project.applyValue(getProjectResult -> getProjectResult.number()))
                .throughputCapacity(2)
                .build());
    
        }
    }
    
    resources:
      example:
        type: gcp:pubsub:LiteReservation
        properties:
          name: example-reservation
          project: ${project.number}
          throughputCapacity: 2
    variables:
      project:
        fn::invoke:
          Function: gcp:organizations:getProject
          Arguments: {}
    

    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 string
    The unique name of the resource.
    args LiteReservationArgs
    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 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 string
    The unique name of the resource.
    args LiteReservationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LiteReservationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LiteReservationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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",
    });
    
    example, err := pubsub.NewLiteReservation(ctx, "liteReservationResource", &pubsub.LiteReservationArgs{
    	ThroughputCapacity: pulumi.Int(0),
    	Name:               pulumi.String("string"),
    	Project:            pulumi.String("string"),
    	Region:             pulumi.String("string"),
    })
    
    var liteReservationResource = new LiteReservation("liteReservationResource", LiteReservationArgs.builder()        
        .throughputCapacity(0)
        .name("string")
        .project("string")
        .region("string")
        .build());
    
    lite_reservation_resource = gcp.pubsub.LiteReservation("liteReservationResource",
        throughput_capacity=0,
        name="string",
        project="string",
        region="string")
    
    const liteReservationResource = new gcp.pubsub.LiteReservation("liteReservationResource", {
        throughputCapacity: 0,
        name: "string",
        project: "string",
        region: "string",
    });
    
    type: gcp:pubsub:LiteReservation
    properties:
        name: string
        project: string
        region: string
        throughputCapacity: 0
    

    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

    The LiteReservation resource accepts the following input properties:

    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 string
    Name of the reservation.


    Project 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 string
    Name of the reservation.


    Project 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 String
    Name of the reservation.


    project 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 string
    Name of the reservation.


    project 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 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 str
    Name of the reservation.


    project 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 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 String
    Name of the reservation.


    project 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)
    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:
    Name string
    Name of the reservation.


    Project 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 string
    Name of the reservation.


    Project 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 String
    Name of the reservation.


    project 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 string
    Name of the reservation.


    project 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 str
    Name of the reservation.


    project 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 String
    Name of the reservation.


    project 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}}
    
    $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{project}}/{{region}}/{{name}}
    
    $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{region}}/{{name}}
    
    $ pulumi import gcp:pubsub/liteReservation:LiteReservation default {{name}}
    

    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.
    gcp logo
    Google Cloud Classic v7.20.0 published on Wednesday, Apr 24, 2024 by Pulumi