Skip to content

Commit

Permalink
Add bucket_name variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
lahuang4 committed Oct 23, 2023
1 parent 55fcc53 commit 4074731
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion examples/cloud_storage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ This example illustrates how to use the `pubsub` module.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| project\_id | The project ID to manage the Pub/Sub resources | `string` | n/a | yes |
| bucket\_name | The name of the GCS bucket name to which to write messages | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| project\_id | The project ID |
| topic\_labels | The labels of the Pub/Sub topic created |
| bucket\_name | The name of the Cloud Storage bucket created |
| topic\_name | The name of the Pub/Sub topic created |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Expand Down
4 changes: 2 additions & 2 deletions examples/cloud_storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module "pubsub" {
cloud_storage_subscriptions = [
{
name = "example_subscription"
bucket = "example_bucket"
bucket = var.bucket_name
},
]

Expand All @@ -38,6 +38,6 @@ module "pubsub" {

resource "google_storage_bucket" "test" {
project = var.project_id
name = "example_bucket"
name = var.bucket_name
location = "europe-west1"
}
10 changes: 5 additions & 5 deletions examples/cloud_storage/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ output "project_id" {
description = "The project ID"
}

output "bucket_name" {
value = var.bucket_name
description = "The name of the Cloud Storage bucket created"
}

output "topic_name" {
value = module.pubsub.topic
description = "The name of the Pub/Sub topic created"
}

output "topic_labels" {
value = module.pubsub.topic_labels
description = "The labels of the Pub/Sub topic created"
}
4 changes: 4 additions & 0 deletions examples/cloud_storage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ variable "project_id" {
type = string
description = "The project ID to manage the Pub/Sub resources"
}
variable "bucket_name" {
type = string
description = "The name of the GCS bucket name to which to write messages"
}

0 comments on commit 4074731

Please sign in to comment.