Module pubsub

@pulumi/gcp > pubsub

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-gcp repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-google repo.

class Subscription

extends CustomResource

A named resource representing the stream of messages from a single, specific topic, to be delivered to the subscribing application.

To get more information about Subscription, see:

Example Usage - Pubsub Subscription Push

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

const exampleTopic = new gcp.pubsub.Topic("example", {});
const exampleSubscription = new gcp.pubsub.Subscription("example", {
    ackDeadlineSeconds: 20,
    labels: {
        foo: "bar",
    },
    pushConfig: {
        attributes: {
            "x-goog-version": "v1",
        },
        pushEndpoint: "https://example.com/push",
    },
    topic: exampleTopic.name,
});

Example Usage - Pubsub Subscription Pull

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

const exampleTopic = new gcp.pubsub.Topic("example", {});
const exampleSubscription = new gcp.pubsub.Subscription("example", {
    ackDeadlineSeconds: 20,
    expirationPolicy: {
        ttl: "300000.5s",
    },
    labels: {
        foo: "bar",
    },
    // 20 minutes
    messageRetentionDuration: "1200s",
    retainAckedMessages: true,
    topic: exampleTopic.name,
});

Example Usage - Pubsub Subscription Different Project

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

const exampleTopic = new gcp.pubsub.Topic("example", {
    project: "topic-project",
});
const exampleSubscription = new gcp.pubsub.Subscription("example", {
    project: "subscription-project",
    topic: exampleTopic.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_subscription.html.markdown.

constructor

new Subscription(name: string, args: SubscriptionArgs, opts?: pulumi.CustomResourceOptions)

Create a Subscription resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubscriptionState, opts?: pulumi.CustomResourceOptions): Subscription

Get an existing Subscription resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Subscription. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property ackDeadlineSeconds

public ackDeadlineSeconds: pulumi.Output<number>;

property expirationPolicy

public expirationPolicy: pulumi.Output<{
    ttl: undefined | string;
}>;

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property messageRetentionDuration

public messageRetentionDuration: pulumi.Output<string | undefined>;

property name

public name: pulumi.Output<string>;

property path

public path: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property pushConfig

public pushConfig: pulumi.Output<{
    attributes: undefined | {[key: string]: string};
    pushEndpoint: string;
} | undefined>;

property retainAckedMessages

public retainAckedMessages: pulumi.Output<boolean | undefined>;

property topic

public topic: pulumi.Output<string>;

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SubscriptionIAMBinding

extends CustomResource

Three different resources help you manage your IAM policy for pubsub subscription. Each of these resources serves a different use case:

  • gcp.pubsub.SubscriptionIAMPolicy: Authoritative. Sets the IAM policy for the subscription and replaces any existing policy already attached.
  • gcp.pubsub.SubscriptionIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the subscription are preserved.
  • gcp.pubsub.SubscriptionIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subscription are preserved.

Note: gcp.pubsub.SubscriptionIAMPolicy cannot be used in conjunction with gcp.pubsub.SubscriptionIAMBinding and gcp.pubsub.SubscriptionIAMMember or they will fight over what your policy should be.

Note: gcp.pubsub.SubscriptionIAMBinding resources can be used in conjunction with gcp.pubsub.SubscriptionIAMMember resources only if they do not grant privilege to the same role.

google_pubsub_subscription_iam_policy

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

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const editor = new gcp.pubsub.SubscriptionIAMPolicy("editor", {
    policyData: admin.policyData,
    subscription: "your-subscription-name",
});

google_pubsub_subscription_iam_binding

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

const editor = new gcp.pubsub.SubscriptionIAMBinding("editor", {
    members: ["user:jane@example.com"],
    role: "roles/editor",
    subscription: "your-subscription-name",
});

google_pubsub_subscription_iam_member

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

const editor = new gcp.pubsub.SubscriptionIAMMember("editor", {
    member: "user:jane@example.com",
    role: "roles/editor",
    subscription: "your-subscription-name",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_subscription_iam_binding.html.markdown.

constructor

new SubscriptionIAMBinding(name: string, args: SubscriptionIAMBindingArgs, opts?: pulumi.CustomResourceOptions)

Create a SubscriptionIAMBinding resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubscriptionIAMBindingState, opts?: pulumi.CustomResourceOptions): SubscriptionIAMBinding

Get an existing SubscriptionIAMBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of SubscriptionIAMBinding. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the subscription’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property members

public members: pulumi.Output<string[]>;

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

public role: pulumi.Output<string>;

The role that should be applied. Only one gcp.pubsub.SubscriptionIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subscription

public subscription: pulumi.Output<string>;

The subscription name or id to bind to attach IAM policy to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SubscriptionIAMMember

extends CustomResource

Three different resources help you manage your IAM policy for pubsub subscription. Each of these resources serves a different use case:

  • gcp.pubsub.SubscriptionIAMPolicy: Authoritative. Sets the IAM policy for the subscription and replaces any existing policy already attached.
  • gcp.pubsub.SubscriptionIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the subscription are preserved.
  • gcp.pubsub.SubscriptionIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subscription are preserved.

Note: gcp.pubsub.SubscriptionIAMPolicy cannot be used in conjunction with gcp.pubsub.SubscriptionIAMBinding and gcp.pubsub.SubscriptionIAMMember or they will fight over what your policy should be.

Note: gcp.pubsub.SubscriptionIAMBinding resources can be used in conjunction with gcp.pubsub.SubscriptionIAMMember resources only if they do not grant privilege to the same role.

google_pubsub_subscription_iam_policy

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

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const editor = new gcp.pubsub.SubscriptionIAMPolicy("editor", {
    policyData: admin.policyData,
    subscription: "your-subscription-name",
});

google_pubsub_subscription_iam_binding

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

const editor = new gcp.pubsub.SubscriptionIAMBinding("editor", {
    members: ["user:jane@example.com"],
    role: "roles/editor",
    subscription: "your-subscription-name",
});

google_pubsub_subscription_iam_member

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

const editor = new gcp.pubsub.SubscriptionIAMMember("editor", {
    member: "user:jane@example.com",
    role: "roles/editor",
    subscription: "your-subscription-name",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_subscription_iam_member.html.markdown.

constructor

new SubscriptionIAMMember(name: string, args: SubscriptionIAMMemberArgs, opts?: pulumi.CustomResourceOptions)

Create a SubscriptionIAMMember resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubscriptionIAMMemberState, opts?: pulumi.CustomResourceOptions): SubscriptionIAMMember

Get an existing SubscriptionIAMMember resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of SubscriptionIAMMember. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the subscription’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property member

public member: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

public role: pulumi.Output<string>;

The role that should be applied. Only one gcp.pubsub.SubscriptionIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subscription

public subscription: pulumi.Output<string>;

The subscription name or id to bind to attach IAM policy to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class SubscriptionIAMPolicy

extends CustomResource

Three different resources help you manage your IAM policy for pubsub subscription. Each of these resources serves a different use case:

  • gcp.pubsub.SubscriptionIAMPolicy: Authoritative. Sets the IAM policy for the subscription and replaces any existing policy already attached.
  • gcp.pubsub.SubscriptionIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the subscription are preserved.
  • gcp.pubsub.SubscriptionIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the subscription are preserved.

Note: gcp.pubsub.SubscriptionIAMPolicy cannot be used in conjunction with gcp.pubsub.SubscriptionIAMBinding and gcp.pubsub.SubscriptionIAMMember or they will fight over what your policy should be.

Note: gcp.pubsub.SubscriptionIAMBinding resources can be used in conjunction with gcp.pubsub.SubscriptionIAMMember resources only if they do not grant privilege to the same role.

google_pubsub_subscription_iam_policy

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

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const editor = new gcp.pubsub.SubscriptionIAMPolicy("editor", {
    policyData: admin.policyData,
    subscription: "your-subscription-name",
});

google_pubsub_subscription_iam_binding

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

const editor = new gcp.pubsub.SubscriptionIAMBinding("editor", {
    members: ["user:jane@example.com"],
    role: "roles/editor",
    subscription: "your-subscription-name",
});

google_pubsub_subscription_iam_member

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

const editor = new gcp.pubsub.SubscriptionIAMMember("editor", {
    member: "user:jane@example.com",
    role: "roles/editor",
    subscription: "your-subscription-name",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_subscription_iam_policy.html.markdown.

constructor

new SubscriptionIAMPolicy(name: string, args: SubscriptionIAMPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a SubscriptionIAMPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: SubscriptionIAMPolicyState, opts?: pulumi.CustomResourceOptions): SubscriptionIAMPolicy

Get an existing SubscriptionIAMPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of SubscriptionIAMPolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the subscription’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property policyData

public policyData: pulumi.Output<string>;

The policy data generated by a gcp.organizations.getIAMPolicy data source.

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property subscription

public subscription: pulumi.Output<string>;

The subscription name or id to bind to attach IAM policy to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Topic

extends CustomResource

A named resource to which messages are sent by publishers.

To get more information about Topic, see:

Example Usage - Pubsub Topic Basic

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

const example = new gcp.pubsub.Topic("example", {
    labels: {
        foo: "bar",
    },
});

Example Usage - Pubsub Topic Cmek

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

const keyRing = new gcp.kms.KeyRing("keyRing", {
    location: "global",
});
const cryptoKey = new gcp.kms.CryptoKey("cryptoKey", {
    keyRing: keyRing.selfLink,
});
const example = new gcp.pubsub.Topic("example", {
    kmsKeyName: cryptoKey.selfLink,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_topic.html.markdown.

constructor

new Topic(name: string, args?: TopicArgs, opts?: pulumi.CustomResourceOptions)

Create a Topic resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TopicState, opts?: pulumi.CustomResourceOptions): Topic

Get an existing Topic resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Topic. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

method onMessagePublished

onMessagePublished(name: string, handler: TopicEventHandler | TopicEventCallbackFunctionArgs, args?: TopicMessagePublishedArgs, opts?: pulumi.ComponentResourceOptions): cloudfunctions.CallbackFunction

Creates and publishes a Cloud Functions that will be triggered by messages published to Cloud Pub/Sub topics in the same GCP project as the Function. Cloud Pub/Sub is a globally distributed message bus that automatically scales as you need it and provides a foundation for building your own robust, global services.

See https://cloud.google.com/functions/docs/calling/pubsub for more details.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property kmsKeyName

public kmsKeyName: pulumi.Output<string | undefined>;

property labels

public labels: pulumi.Output<{[key: string]: string} | undefined>;

property name

public name: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TopicIAMBinding

extends CustomResource

Three different resources help you manage your IAM policy for Pubsub Topic. Each of these resources serves a different use case:

  • gcp.pubsub.TopicIAMPolicy: Authoritative. Sets the IAM policy for the topic and replaces any existing policy already attached.
  • gcp.pubsub.TopicIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the topic are preserved.
  • gcp.pubsub.TopicIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the topic are preserved.

Note: gcp.pubsub.TopicIAMPolicy cannot be used in conjunction with gcp.pubsub.TopicIAMBinding and gcp.pubsub.TopicIAMMember or they will fight over what your policy should be.

Note: gcp.pubsub.TopicIAMBinding resources can be used in conjunction with gcp.pubsub.TopicIAMMember resources only if they do not grant privilege to the same role.

google_pubsub_topic_iam_policy

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

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const editor = new gcp.pubsub.TopicIAMPolicy("editor", {
    policyData: admin.policyData,
    topic: "projects/{{project}}/topics/{{topic}}",
});

google_pubsub_topic_iam_binding

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

const editor = new gcp.pubsub.TopicIAMBinding("editor", {
    members: ["user:jane@example.com"],
    role: "roles/editor",
    topic: "projects/{{project}}/topics/{{topic}}",
});

google_pubsub_topic_iam_member

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

const editor = new gcp.pubsub.TopicIAMMember("editor", {
    member: "user:jane@example.com",
    role: "roles/editor",
    topic: "projects/{{project}}/topics/{{topic}}",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_topic_iam_binding.html.markdown.

constructor

new TopicIAMBinding(name: string, args: TopicIAMBindingArgs, opts?: pulumi.CustomResourceOptions)

Create a TopicIAMBinding resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TopicIAMBindingState, opts?: pulumi.CustomResourceOptions): TopicIAMBinding

Get an existing TopicIAMBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of TopicIAMBinding. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the topic’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property members

public members: pulumi.Output<string[]>;

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

public role: pulumi.Output<string>;

The role that should be applied. Only one gcp.pubsub.TopicIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property topic

public topic: pulumi.Output<string>;

The topic name or id to bind to attach IAM policy to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TopicIAMMember

extends CustomResource

Three different resources help you manage your IAM policy for Pubsub Topic. Each of these resources serves a different use case:

  • gcp.pubsub.TopicIAMPolicy: Authoritative. Sets the IAM policy for the topic and replaces any existing policy already attached.
  • gcp.pubsub.TopicIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the topic are preserved.
  • gcp.pubsub.TopicIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the topic are preserved.

Note: gcp.pubsub.TopicIAMPolicy cannot be used in conjunction with gcp.pubsub.TopicIAMBinding and gcp.pubsub.TopicIAMMember or they will fight over what your policy should be.

Note: gcp.pubsub.TopicIAMBinding resources can be used in conjunction with gcp.pubsub.TopicIAMMember resources only if they do not grant privilege to the same role.

google_pubsub_topic_iam_policy

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

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const editor = new gcp.pubsub.TopicIAMPolicy("editor", {
    policyData: admin.policyData,
    topic: "projects/{{project}}/topics/{{topic}}",
});

google_pubsub_topic_iam_binding

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

const editor = new gcp.pubsub.TopicIAMBinding("editor", {
    members: ["user:jane@example.com"],
    role: "roles/editor",
    topic: "projects/{{project}}/topics/{{topic}}",
});

google_pubsub_topic_iam_member

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

const editor = new gcp.pubsub.TopicIAMMember("editor", {
    member: "user:jane@example.com",
    role: "roles/editor",
    topic: "projects/{{project}}/topics/{{topic}}",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_topic_iam_member.html.markdown.

constructor

new TopicIAMMember(name: string, args: TopicIAMMemberArgs, opts?: pulumi.CustomResourceOptions)

Create a TopicIAMMember resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TopicIAMMemberState, opts?: pulumi.CustomResourceOptions): TopicIAMMember

Get an existing TopicIAMMember resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of TopicIAMMember. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the topic’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property member

public member: pulumi.Output<string>;

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

public role: pulumi.Output<string>;

The role that should be applied. Only one gcp.pubsub.TopicIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property topic

public topic: pulumi.Output<string>;

The topic name or id to bind to attach IAM policy to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class TopicIAMPolicy

extends CustomResource

Three different resources help you manage your IAM policy for Pubsub Topic. Each of these resources serves a different use case:

  • gcp.pubsub.TopicIAMPolicy: Authoritative. Sets the IAM policy for the topic and replaces any existing policy already attached.
  • gcp.pubsub.TopicIAMBinding: Authoritative for a given role. Updates the IAM policy to grant a role to a list of members. Other roles within the IAM policy for the topic are preserved.
  • gcp.pubsub.TopicIAMMember: Non-authoritative. Updates the IAM policy to grant a role to a new member. Other members for the role for the topic are preserved.

Note: gcp.pubsub.TopicIAMPolicy cannot be used in conjunction with gcp.pubsub.TopicIAMBinding and gcp.pubsub.TopicIAMMember or they will fight over what your policy should be.

Note: gcp.pubsub.TopicIAMBinding resources can be used in conjunction with gcp.pubsub.TopicIAMMember resources only if they do not grant privilege to the same role.

google_pubsub_topic_iam_policy

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

const admin = pulumi.output(gcp.organizations.getIAMPolicy({
    bindings: [{
        members: ["user:jane@example.com"],
        role: "roles/editor",
    }],
}));
const editor = new gcp.pubsub.TopicIAMPolicy("editor", {
    policyData: admin.policyData,
    topic: "projects/{{project}}/topics/{{topic}}",
});

google_pubsub_topic_iam_binding

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

const editor = new gcp.pubsub.TopicIAMBinding("editor", {
    members: ["user:jane@example.com"],
    role: "roles/editor",
    topic: "projects/{{project}}/topics/{{topic}}",
});

google_pubsub_topic_iam_member

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

const editor = new gcp.pubsub.TopicIAMMember("editor", {
    member: "user:jane@example.com",
    role: "roles/editor",
    topic: "projects/{{project}}/topics/{{topic}}",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/r/pubsub_topic_iam_policy.html.markdown.

constructor

new TopicIAMPolicy(name: string, args: TopicIAMPolicyArgs, opts?: pulumi.CustomResourceOptions)

Create a TopicIAMPolicy resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TopicIAMPolicyState, opts?: pulumi.CustomResourceOptions): TopicIAMPolicy

Get an existing TopicIAMPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of TopicIAMPolicy. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property etag

public etag: pulumi.Output<string>;

(Computed) The etag of the topic’s IAM policy.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property policyData

public policyData: pulumi.Output<string>;

The policy data generated by a gcp.organizations.getIAMPolicy data source.

property project

public project: pulumi.Output<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property topic

public topic: pulumi.Output<string>;

The topic name or id to bind to attach IAM policy to.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface SubscriptionArgs

The set of arguments for constructing a Subscription resource.

property ackDeadlineSeconds

ackDeadlineSeconds?: pulumi.Input<number>;

property expirationPolicy

expirationPolicy?: pulumi.Input<{
    ttl: pulumi.Input<string>;
}>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property messageRetentionDuration

messageRetentionDuration?: pulumi.Input<string>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property pushConfig

pushConfig?: pulumi.Input<{
    attributes: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    pushEndpoint: pulumi.Input<string>;
}>;

property retainAckedMessages

retainAckedMessages?: pulumi.Input<boolean>;

property topic

topic: pulumi.Input<string>;

interface SubscriptionIAMBindingArgs

The set of arguments for constructing a SubscriptionIAMBinding resource.

property members

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.SubscriptionIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subscription

subscription: pulumi.Input<string>;

The subscription name or id to bind to attach IAM policy to.

interface SubscriptionIAMBindingState

Input properties used for looking up and filtering SubscriptionIAMBinding resources.

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the subscription’s IAM policy.

property members

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role?: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.SubscriptionIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subscription

subscription?: pulumi.Input<string>;

The subscription name or id to bind to attach IAM policy to.

interface SubscriptionIAMMemberArgs

The set of arguments for constructing a SubscriptionIAMMember resource.

property member

member: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.SubscriptionIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subscription

subscription: pulumi.Input<string>;

The subscription name or id to bind to attach IAM policy to.

interface SubscriptionIAMMemberState

Input properties used for looking up and filtering SubscriptionIAMMember resources.

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the subscription’s IAM policy.

property member

member?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role?: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.SubscriptionIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property subscription

subscription?: pulumi.Input<string>;

The subscription name or id to bind to attach IAM policy to.

interface SubscriptionIAMPolicyArgs

The set of arguments for constructing a SubscriptionIAMPolicy resource.

property policyData

policyData: pulumi.Input<string>;

The policy data generated by a gcp.organizations.getIAMPolicy data source.

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property subscription

subscription: pulumi.Input<string>;

The subscription name or id to bind to attach IAM policy to.

interface SubscriptionIAMPolicyState

Input properties used for looking up and filtering SubscriptionIAMPolicy resources.

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the subscription’s IAM policy.

property policyData

policyData?: pulumi.Input<string>;

The policy data generated by a gcp.organizations.getIAMPolicy data source.

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property subscription

subscription?: pulumi.Input<string>;

The subscription name or id to bind to attach IAM policy to.

interface SubscriptionState

Input properties used for looking up and filtering Subscription resources.

property ackDeadlineSeconds

ackDeadlineSeconds?: pulumi.Input<number>;

property expirationPolicy

expirationPolicy?: pulumi.Input<{
    ttl: pulumi.Input<string>;
}>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property messageRetentionDuration

messageRetentionDuration?: pulumi.Input<string>;

property name

name?: pulumi.Input<string>;

property path

path?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

property pushConfig

pushConfig?: pulumi.Input<{
    attributes: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
    pushEndpoint: pulumi.Input<string>;
}>;

property retainAckedMessages

retainAckedMessages?: pulumi.Input<boolean>;

property topic

topic?: pulumi.Input<string>;

interface TopicArgs

The set of arguments for constructing a Topic resource.

property kmsKeyName

kmsKeyName?: pulumi.Input<string>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

interface TopicContext

extends Context

Shape of the [context] object passed to a Cloud Function when a topic event fires.

property eventId

eventId: string;

A unique ID for the event. For example: “70172329041928”.

property eventType

eventType: “google.pubsub.topic.publish”;

property resource

resource: {
    name: string;
    service: “pubsub.googleapis.com”;
    type: “type.googleapis.com/google.pubsub.v1.PubsubMessage”;
};

property timestamp

timestamp: string;

The date/time this event was created. For example: “2018-04-09T07:56:12.975Z”.

interface TopicData

Shape of the [data] object passed to a Cloud Function when a topic event fires.

See https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage for more details.

property @type

@type: “type.googleapis.com/google.pubsub.v1.PubsubMessage”;

property attributes

attributes: Record<string, string>;

key/value pairs included with the topic even.

property data

data: string;

Base64 encoded data. Use Buffer.from(pubSubMessage.data, 'base64') to get raw bytes of the message.

interface TopicEventCallbackFunctionArgs

extends CallbackFunctionArgs

Arguments that can be provided to control the Cloud Function created as the serverless endpoint for a topic event.

property availableMemoryMb

availableMemoryMb?: pulumi.Input<number>;

Memory (in MB), available to the function. Default value is 256MB. Allowed values are: 128MB, 256MB, 512MB, 1024MB, and 2048MB.

property bucket

bucket?: storage.Bucket;

The bucket to use as the sourceArchiveBucket for the generated CloudFunctions Function source to be placed in. A fresh [storage.BucketObject] will be made there containing the serialized code.

property callback

callback?: TopicEventHandler;

property callbackFactory

callbackFactory?: undefined | () => TopicEventHandler;

property codePathOptions

codePathOptions?: pulumi.runtime.CodePathOptions;

Options to control which paths/packages should be included or excluded in the zip file containing the code for the GCP Function.

property description

description?: pulumi.Input<string>;

Description of the function.

property environmentVariables

environmentVariables?: pulumi.Input<{[key: string]: any}>;

A set of key/value environment variable pairs to assign to the function.

property eventTrigger

eventTrigger?: undefined;

property httpsTriggerUrl

httpsTriggerUrl?: undefined;

property labels

labels?: pulumi.Input<{[key: string]: any}>;

A set of key/value label pairs to assign to the function.

property project

project?: pulumi.Input<string>;

Project of the function. If it is not provided, the provider project is used.

property region

region?: pulumi.Input<string>;

Region of function. Currently can be only “us-central1”. If it is not provided, the provider region is used.

property serviceAccountEmail

serviceAccountEmail?: pulumi.Input<string>;

If provided, the self-provided service account to run the function with.

property timeout

timeout?: pulumi.Input<number>;

Timeout (in seconds) for the function. Default value is 60 seconds. Cannot be more than 540 seconds.

property triggerHttp

triggerHttp?: undefined;

interface TopicIAMBindingArgs

The set of arguments for constructing a TopicIAMBinding resource.

property members

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.TopicIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property topic

topic: pulumi.Input<string>;

The topic name or id to bind to attach IAM policy to.

interface TopicIAMBindingState

Input properties used for looking up and filtering TopicIAMBinding resources.

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the topic’s IAM policy.

property members

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role?: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.TopicIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property topic

topic?: pulumi.Input<string>;

The topic name or id to bind to attach IAM policy to.

interface TopicIAMMemberArgs

The set of arguments for constructing a TopicIAMMember resource.

property member

member: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.TopicIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property topic

topic: pulumi.Input<string>;

The topic name or id to bind to attach IAM policy to.

interface TopicIAMMemberState

Input properties used for looking up and filtering TopicIAMMember resources.

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the topic’s IAM policy.

property member

member?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property role

role?: pulumi.Input<string>;

The role that should be applied. Only one gcp.pubsub.TopicIAMBinding can be used per role. Note that custom roles must be of the format [projects|organizations]/{parent-name}/roles/{role-name}.

property topic

topic?: pulumi.Input<string>;

The topic name or id to bind to attach IAM policy to.

interface TopicIAMPolicyArgs

The set of arguments for constructing a TopicIAMPolicy resource.

property policyData

policyData: pulumi.Input<string>;

The policy data generated by a gcp.organizations.getIAMPolicy data source.

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property topic

topic: pulumi.Input<string>;

The topic name or id to bind to attach IAM policy to.

interface TopicIAMPolicyState

Input properties used for looking up and filtering TopicIAMPolicy resources.

property etag

etag?: pulumi.Input<string>;

(Computed) The etag of the topic’s IAM policy.

property policyData

policyData?: pulumi.Input<string>;

The policy data generated by a gcp.organizations.getIAMPolicy data source.

property project

project?: pulumi.Input<string>;

The project in which the resource belongs. If it is not provided, the provider project is used.

property topic

topic?: pulumi.Input<string>;

The topic name or id to bind to attach IAM policy to.

interface TopicMessagePublishedArgs

Arguments to control how GCP will respond if the Cloud Function fails. Currently, the only specialized behavior supported is to attempt retrying the Cloud Function. See [cloudfunctions.FailurePolicy] for more information on this.

property failurePolicy

failurePolicy?: cloudfunctions.FailurePolicy;

interface TopicState

Input properties used for looking up and filtering Topic resources.

property kmsKeyName

kmsKeyName?: pulumi.Input<string>;

property labels

labels?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;

property name

name?: pulumi.Input<string>;

property project

project?: pulumi.Input<string>;

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

type TopicEventHandler

type TopicEventHandler = cloudfunctions.Callback<TopicData, TopicContext, void>;