|
| 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 | +data "google_iam_policy" "releng_access" { |
| 18 | + binding { |
| 19 | + role = "roles/storage.objectViewer" |
| 20 | + members = [ |
| 21 | + |
| 22 | + "serviceAccount:${google_service_account.fastly_reader.email}" |
| 23 | + ] |
| 24 | + } |
| 25 | + |
| 26 | + // TODO: remove this after https://github.com/kubernetes/release/issues/3425 |
| 27 | + binding { |
| 28 | + role = "roles/storage.objectAdmin" |
| 29 | + members = [ "serviceAccount:[email protected]"] |
| 30 | + } |
| 31 | + |
| 32 | + binding { |
| 33 | + role = "roles/storage.legacyBucketOwner" |
| 34 | + members = [ |
| 35 | + "projectOwner:${google_project.project.project_id}", |
| 36 | + "projectEditor:${google_project.project.project_id}" |
| 37 | + ] |
| 38 | + } |
| 39 | + |
| 40 | + binding { |
| 41 | + role = "roles/storage.legacyBucketReader" |
| 42 | + members = [ |
| 43 | + "projectViewer:${google_project.project.project_id}", |
| 44 | + |
| 45 | + ] |
| 46 | + } |
| 47 | +} |
| 48 | + |
| 49 | +resource "google_storage_bucket_iam_policy" "releng_access_policy" { |
| 50 | + bucket = module.k8s_releases_prod.bucket_name |
| 51 | + policy_data = data.google_iam_policy.releng_access.policy_data |
| 52 | +} |
0 commit comments