-
Notifications
You must be signed in to change notification settings - Fork 841
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
Add service account to k8s-infra-ii-coop #2262
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,41 @@ | ||||||
|
||||||
/** | ||||||
* Copyright 2021 The Kubernetes Authors | ||||||
* | ||||||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
* you may not use this file except in compliance with the License. | ||||||
* You may obtain a copy of the License at | ||||||
* | ||||||
* http://www.apache.org/licenses/LICENSE-2.0 | ||||||
* | ||||||
* Unless required by applicable law or agreed to in writing, software | ||||||
* distributed under the License is distributed on an "AS IS" BASIS, | ||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
* See the License for the specific language governing permissions and | ||||||
* limitations under the License. | ||||||
*/ | ||||||
|
||||||
locals { | ||||||
project_id = "k8s-infra-ii-sandbox" | ||||||
} | ||||||
|
||||||
resource "google_project" "project" { | ||||||
name = local.project_id | ||||||
project_id = local.project_id | ||||||
} | ||||||
|
||||||
#Create service account | ||||||
resource "google_service_account" "ii-logs-sa@k8s-infra-ii-sandbox.iam.gserviceaccount.com" { | ||||||
account_id = "ii-logs-sa-id" | ||||||
display_name = "ii logs service account" | ||||||
description = "service-account-to-facilitate-ii-log-analysis" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
project = google_project.project.id | ||||||
} | ||||||
|
||||||
resource "google_project_iam_binding" "k8s-infra-ii-sandbox" { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/google_project_iam
Are you sure you want this behavior? It means nobody else gets What you might want instead want is to say "this service account should get this role, regardless of who else has the role" Which would be
Suggested change
|
||||||
project = google_project.project.id | ||||||
role = "roles/storage.objectViewer" | ||||||
members = [ | ||||||
"user:ii-logs-sa@k8s-infra-ii-sandbox.iam.gserviceaccount.com", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
] | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.