【发布时间】:2022-07-27 23:20:59
【问题描述】:
我正在尝试切换到GCP pubsub module,但在 terraform 计划中显示主题资源将被重新创建,即使变量完全相同。这些资源是否可能至少主题不需要重新创建?
新方式
module "pubsub" {
source = "terraform-google-modules/pubsub/google"
version = "~> 1.8"
topic = "topic_name"
create_topic = false
project_id = local.project_id
pull_subscriptions = [
{
name = "sub_name"
ack_deadline_seconds = 10
}
]
topic_labels = {
app = "l1"
}
subscription_labels = {
app = "l1"
}
}
老办法
resource "google_pubsub_topic" "topic" {
name = "topic_name"
labels = {
app = "l1"
}
}
resource "google_pubsub_subscription" "sub" {
name = "sub_name"
topic = google_pubsub_topic.topic.name
labels = {
app = "l1"
}
ack_deadline_seconds = 10
}
【问题讨论】:
标签: google-cloud-platform terraform terraform-provider-gcp