Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use topics and rotation period in google_secret_manager_secret? #9726

Closed
arimaverick opened this issue Aug 5, 2021 · 3 comments
Closed
Assignees
Labels

Comments

@arimaverick
Copy link

arimaverick commented Aug 5, 2021

How can I use pub sub topics in google_secret_manager as it seems cannot recognize the topics block? I am trying to implement the following link: https://cloud.google.com/secret-manager/docs/event-notifications#add_topics

resource "google_secret_manager_secret" "secret_1" {
secret_id = "secret_1"
project = var.project_id
replication {
user_managed {
replicas {
location = var.region
}
}
}
topics {
name = google_pubsub_topic.token_topic.id
}
}

Error: Unsupported block type

on functions.tf line 126, in resource "google_secret_manager_secret" "regtoken_secret_1":
126: topics {

Blocks of type "topics" are not expected here.

@ScottSuarez
Copy link
Collaborator

topics block is working for me fine.

Which version of the terraform google provider are you using?
I would recommend updating

resource "google_secret_manager_secret" "secret_1" {
  secret_id = "secret_1"
  replication {
    user_managed {
      replicas {
        location = "us-central1"
      }
    }
  }
  rotation {
    next_rotation_time = "2014-10-02T15:01:23Z"
    rotation_period = "3153600000s"
  }
  topics {
    name = "beep"
  }
}

@ScottSuarez
Copy link
Collaborator

ScottSuarez commented Aug 16, 2021

closing for now, feel free to make a new issue or comment if this is still a point of contention for you

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants