--- # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # # ---------------------------------------------------------------------------- # # This file is automatically generated by Magic Modules and manual # changes will be clobbered when the file is regenerated. # # Please read more about how to change this file in # .github/CONTRIBUTING.md. # # ---------------------------------------------------------------------------- layout: "google" page_title: "Google: google_pubsub_topic" sidebar_current: "docs-google-pubsub-topic" description: |- A named resource to which messages are sent by publishers. --- # google\_pubsub\_topic A named resource to which messages are sent by publishers. To get more information about Topic, see: * [API documentation](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics) * How-to Guides * [Managing Topics](https://cloud.google.com/pubsub/docs/admin#managing_topics)
Open in Cloud Shell
## Example Usage - Pubsub Topic Basic ```hcl resource "google_pubsub_topic" "example" { name = "example-topic" labels = { foo = "bar" } } ``` ## Argument Reference The following arguments are supported: * `name` - (Required) Name of the topic. - - - * `labels` - (Optional) A set of key/value label pairs to assign to this Topic. * `project` - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used. ## Timeouts This resource provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: - `create` - Default is 4 minutes. - `delete` - Default is 4 minutes. ## Import Topic can be imported using any of these accepted formats: ``` $ terraform import google_pubsub_topic.default projects/{{project}}/topics/{{name}} $ terraform import google_pubsub_topic.default {{project}}/{{name}} $ terraform import google_pubsub_topic.default {{name}} ``` -> If you're importing a resource with beta features, make sure to include `-provider=google-beta` as an argument so that Terraform uses the correct provider to import your resource.