Topic
A named resource to which messages are sent by publishers.
To get more information about Topic, see:
- API documentation
- How-to Guides
Create a Topic Resource
new Topic(name: string, args?: TopicArgs, opts?: CustomResourceOptions);def Topic(resource_name, opts=None, kms_key_name=None, labels=None, message_storage_policy=None, name=None, project=None, __props__=None);public Topic(string name, TopicArgs? args = null, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TopicArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Topic Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Topic resource accepts the following input properties:
- Kms
Key stringName The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- Labels Dictionary<string, string>
A set of key/value label pairs to assign to this Topic.
- Message
Storage TopicPolicy Message Storage Policy Args Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
Name of the topic.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Kms
Key stringName The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- Labels map[string]string
A set of key/value label pairs to assign to this Topic.
- Message
Storage TopicPolicy Message Storage Policy Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
Name of the topic.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- kms
Key stringName The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- labels {[key: string]: string}
A set of key/value label pairs to assign to this Topic.
- message
Storage TopicPolicy Message Storage Policy Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name string
Name of the topic.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- kms_
key_ strname The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- labels Dict[str, str]
A set of key/value label pairs to assign to this Topic.
- message_
storage_ Dict[Topicpolicy Message Storage Policy] Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name str
Name of the topic.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the Topic resource produces the following output properties:
Look up an Existing Topic Resource
Get an existing Topic 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?: TopicState, opts?: CustomResourceOptions): Topicstatic get(resource_name, id, opts=None, kms_key_name=None, labels=None, message_storage_policy=None, name=None, project=None, __props__=None);func GetTopic(ctx *Context, name string, id IDInput, state *TopicState, opts ...ResourceOption) (*Topic, error)public static Topic Get(string name, Input<string> id, TopicState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Kms
Key stringName The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- Labels Dictionary<string, string>
A set of key/value label pairs to assign to this Topic.
- Message
Storage TopicPolicy Message Storage Policy Args Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
Name of the topic.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Kms
Key stringName The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- Labels map[string]string
A set of key/value label pairs to assign to this Topic.
- Message
Storage TopicPolicy Message Storage Policy Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- Name string
Name of the topic.
- Project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- kms
Key stringName The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- labels {[key: string]: string}
A set of key/value label pairs to assign to this Topic.
- message
Storage TopicPolicy Message Storage Policy Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name string
Name of the topic.
- project string
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- kms_
key_ strname The resource name of the Cloud KMS CryptoKey to be used to protect access to messages published on this topic. Your project’s PubSub service account (
service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com) must haveroles/cloudkms.cryptoKeyEncrypterDecrypterto use this feature. The expected format isprojects/*/locations/*/keyRings/*/cryptoKeys/*- labels Dict[str, str]
A set of key/value label pairs to assign to this Topic.
- message_
storage_ Dict[Topicpolicy Message Storage Policy] Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored. If not present, then no constraints are in effect. Structure is documented below.
- name str
Name of the topic.
- project str
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Supporting Types
TopicMessageStoragePolicy
- Allowed
Persistence List<string>Regions A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- Allowed
Persistence []stringRegions A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence string[]Regions A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
- allowed
Persistence List[str]Regions A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage. Messages published by publishers running in non-allowed GCP regions (or running outside of GCP altogether) will be routed for storage in one of the allowed regions. An empty list means that no regions are allowed, and is not a valid configuration.
Package Details
- Repository
- https://github.com/pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-betaTerraform Provider.