Skip to content

Commit

Permalink
terraformで使うsecretをgoogle secret managerに保存する
Browse files Browse the repository at this point in the history
  • Loading branch information
piny940 committed Oct 16, 2024
1 parent 7f77553 commit 87a0e05
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aws/production/locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
locals {
slack_channel = "C06CB9RUP3J"
gcp_project = "prd-piny940"
env = "production"
}
8 changes: 8 additions & 0 deletions aws/production/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
provider "aws" {
region = "ap-northeast-1"
}
provider "google" {
project = local.gcp_project
default_labels = {
service = "home-cluster"
environment = local.env
}
}

2 changes: 2 additions & 0 deletions aws/staging/locals.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
locals {
slack_channel = "C07655VCH9P"
gcp_project = "stg-piny940"
env = "staging"
}
7 changes: 7 additions & 0 deletions aws/staging/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
provider "aws" {
region = "ap-northeast-1"
}
provider "google" {
project = local.gcp_project
default_labels = {
service = "home-cluster"
environment = local.env
}
}
10 changes: 10 additions & 0 deletions aws/staging/service-monitor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ data "archive_file" "dummy" {
filename = "dummy.txt"
}
}
resource "google_secret_manager_secret" "service_monitor" {
secret_id = "stg-service-monitor"
replication {
auto {}
}
}
# data "google_secret_manager_secret_version" "service_monitor" {
# secret = google_secret_manager_secret.service_monitor.secret_id
# version = "1"
# }
resource "aws_lambda_function" "service-monitor" {
function_name = "stg-service-monitor"
description = "Service monitor of staging home cluster"
Expand Down

0 comments on commit 87a0e05

Please sign in to comment.