1. Packages
  2. Google Cloud Native
  3. API Docs
  4. pubsub
  5. pubsub/v1
  6. Snapshot

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

google-native.pubsub/v1.Snapshot

Explore with Pulumi AI

google-native logo

Google Cloud Native is in preview. Google Cloud Classic is fully supported.

Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi

    Creates a snapshot from the requested subscription. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot. If the snapshot already exists, returns ALREADY_EXISTS. If the requested subscription doesn’t exist, returns NOT_FOUND. If the backlog in the subscription is too old – and the resulting snapshot would expire in less than 1 hour – then FAILED_PRECONDITION is returned. See also the Snapshot.expire_time field. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription, conforming to the [resource name format] (https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names). The generated name is populated in the returned Snapshot object. Note that for REST API requests, you must specify a name in the request. Auto-naming is currently not supported for this resource.

    Create Snapshot Resource

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

    Constructor syntax

    new Snapshot(name: string, args: SnapshotArgs, opts?: CustomResourceOptions);
    @overload
    def Snapshot(resource_name: str,
                 args: SnapshotArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Snapshot(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 snapshot_id: Optional[str] = None,
                 subscription: Optional[str] = None,
                 labels: Optional[Mapping[str, str]] = None,
                 project: Optional[str] = None)
    func NewSnapshot(ctx *Context, name string, args SnapshotArgs, opts ...ResourceOption) (*Snapshot, error)
    public Snapshot(string name, SnapshotArgs args, CustomResourceOptions? opts = null)
    public Snapshot(String name, SnapshotArgs args)
    public Snapshot(String name, SnapshotArgs args, CustomResourceOptions options)
    
    type: google-native:pubsub/v1:Snapshot
    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 SnapshotArgs
    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 SnapshotArgs
    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 SnapshotArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SnapshotArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SnapshotArgs
    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 examplesnapshotResourceResourceFromPubsubv1 = new GoogleNative.Pubsub.V1.Snapshot("examplesnapshotResourceResourceFromPubsubv1", new()
    {
        SnapshotId = "string",
        Subscription = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Project = "string",
    });
    
    example, err := pubsub.NewSnapshot(ctx, "examplesnapshotResourceResourceFromPubsubv1", &pubsub.SnapshotArgs{
    SnapshotId: pulumi.String("string"),
    Subscription: pulumi.String("string"),
    Labels: pulumi.StringMap{
    "string": pulumi.String("string"),
    },
    Project: pulumi.String("string"),
    })
    
    var examplesnapshotResourceResourceFromPubsubv1 = new Snapshot("examplesnapshotResourceResourceFromPubsubv1", SnapshotArgs.builder()
        .snapshotId("string")
        .subscription("string")
        .labels(Map.of("string", "string"))
        .project("string")
        .build());
    
    examplesnapshot_resource_resource_from_pubsubv1 = google_native.pubsub.v1.Snapshot("examplesnapshotResourceResourceFromPubsubv1",
        snapshot_id="string",
        subscription="string",
        labels={
            "string": "string",
        },
        project="string")
    
    const examplesnapshotResourceResourceFromPubsubv1 = new google_native.pubsub.v1.Snapshot("examplesnapshotResourceResourceFromPubsubv1", {
        snapshotId: "string",
        subscription: "string",
        labels: {
            string: "string",
        },
        project: "string",
    });
    
    type: google-native:pubsub/v1:Snapshot
    properties:
        labels:
            string: string
        project: string
        snapshotId: string
        subscription: string
    

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

    SnapshotId string
    Subscription string
    The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.
    Labels Dictionary<string, string>
    Optional. See Creating and managing labels.
    Project string
    SnapshotId string
    Subscription string
    The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.
    Labels map[string]string
    Optional. See Creating and managing labels.
    Project string
    snapshotId String
    subscription String
    The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.
    labels Map<String,String>
    Optional. See Creating and managing labels.
    project String
    snapshotId string
    subscription string
    The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.
    labels {[key: string]: string}
    Optional. See Creating and managing labels.
    project string
    snapshot_id str
    subscription str
    The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.
    labels Mapping[str, str]
    Optional. See Creating and managing labels.
    project str
    snapshotId String
    subscription String
    The subscription whose backlog the snapshot retains. Specifically, the created snapshot is guaranteed to retain: (a) The existing backlog on the subscription. More precisely, this is defined as the messages in the subscription's backlog that are unacknowledged upon the successful completion of the CreateSnapshot request; as well as: (b) Any messages published to the subscription's topic following the successful completion of the CreateSnapshot request. Format is projects/{project}/subscriptions/{sub}.
    labels Map<String>
    Optional. See Creating and managing labels.
    project String

    Outputs

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

    ExpireTime string
    Optional. The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Optional. The name of the snapshot.
    Topic string
    Optional. The name of the topic from which this snapshot is retaining messages.
    ExpireTime string
    Optional. The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Optional. The name of the snapshot.
    Topic string
    Optional. The name of the topic from which this snapshot is retaining messages.
    expireTime String
    Optional. The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Optional. The name of the snapshot.
    topic String
    Optional. The name of the topic from which this snapshot is retaining messages.
    expireTime string
    Optional. The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    Optional. The name of the snapshot.
    topic string
    Optional. The name of the topic from which this snapshot is retaining messages.
    expire_time str
    Optional. The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    Optional. The name of the snapshot.
    topic str
    Optional. The name of the topic from which this snapshot is retaining messages.
    expireTime String
    Optional. The snapshot is guaranteed to exist up until this time. A newly-created snapshot expires no later than 7 days from the time of its creation. Its exact lifetime is determined at creation by the existing backlog in the source subscription. Specifically, the lifetime of the snapshot is 7 days - (age of oldest unacked message in the subscription). For example, consider a subscription whose oldest unacked message is 3 days old. If a snapshot is created from this subscription, the snapshot -- which will always capture this 3-day-old backlog as long as the snapshot exists -- will expire in 4 days. The service will refuse to create a snapshot that would expire in less than 1 hour after creation.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    Optional. The name of the snapshot.
    topic String
    Optional. The name of the topic from which this snapshot is retaining messages.

    Package Details

    Repository
    Google Cloud Native pulumi/pulumi-google-native
    License
    Apache-2.0
    google-native logo

    Google Cloud Native is in preview. Google Cloud Classic is fully supported.

    Google Cloud Native v0.32.0 published on Wednesday, Nov 29, 2023 by Pulumi