-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
43 lines (37 loc) · 923 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
provider "google" {
credentials = file(var.gcp_credentials)
project = var.gcp_project
region = var.gcp_region
}
resource "google_project_service" "secretmanager" {
provider = google
service = "secretmanager.googleapis.com"
}
resource "google_secret_manager_secret" "secrets" {
for_each = var.secrets_gcp
provider = google
secret_id = each.key
replication {
user_managed {
replicas {
location = "us-central1"
}
replicas {
location = "us-east1"
}
}
}
depends_on = [google_project_service.secretmanager]
}
resource "google_secret_manager_secret_version" "secrets" {
for_each = var.secrets_gcp
provider = google
secret = google_secret_manager_secret.secrets[each.key].id
secret_data = var.secrets_gcp[each.key]
}
terraform {
backend "gcs" {
bucket = "fluentci-tf-state"
prefix = "state/secrets.tfstate"
}
}