Skip to content

Commit 627043c

Browse files
authored
Merge pull request #7103 from ameukam/release-bucket-store-hmac-key
Store credentials for Fastly service account
2 parents 55535f4 + c5e04a6 commit 627043c

File tree

3 files changed

+45
-9
lines changed

3 files changed

+45
-9
lines changed

infra/gcp/terraform/k8s-infra-releases-prod/.terraform.lock.hcl

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/gcp/terraform/k8s-infra-releases-prod/main.tf

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ resource "google_project" "project" {
3333
}
3434

3535
module "k8s_releases_prod" {
36-
source = "../modules/k8s-releases"
37-
project_id = google_project.project.project_id
38-
bucket_name = "767373bbdcb8270361b96548387bf2a9ad0d48758c35"
36+
source = "../modules/k8s-releases"
37+
project_id = google_project.project.project_id
38+
bucket_name = "767373bbdcb8270361b96548387bf2a9ad0d48758c35"
3939
}
4040

4141
resource "google_service_account" "fastly_reader" {
42-
project = google_project.project.project_id
43-
account_id = "fastly-reader"
42+
project = google_project.project.project_id
43+
account_id = "fastly-reader"
4444
description = "Used by Fastly for read-only actions against the bucket"
4545
}
4646

4747
resource "google_storage_hmac_key" "fastly_reader_key" {
48-
project = google_project.project.project_id
48+
project = google_project.project.project_id
4949
service_account_email = google_service_account.fastly_reader.email
5050
}
5151

5252
resource "google_storage_bucket_iam_member" "fastly_reader" {
5353
bucket = module.k8s_releases_prod.bucket_name
54-
role = "roles/storage.objectViewer"
55-
member = "serviceAccount:${google_service_account.fastly_reader.email}"
54+
role = "roles/storage.objectViewer"
55+
member = "serviceAccount:${google_service_account.fastly_reader.email}"
5656
depends_on = [module.k8s_releases_prod]
5757
}
5858

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
Copyright 2024 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
module "secrets" {
18+
source = "GoogleCloudPlatform/secret-manager/google"
19+
version = "~> 0.3"
20+
21+
project_id = google_project.project.project_id
22+
23+
secrets = [
24+
{
25+
name = "fastly_reader_sa_access_key"
26+
secret_data = google_storage_hmac_key.fastly_reader_key.access_id
27+
},
28+
{
29+
name = "fastly_reader_sa_secret_key"
30+
secret_data = google_storage_hmac_key.fastly_reader_key.secret
31+
},
32+
]
33+
}

0 commit comments

Comments
 (0)