-
Notifications
You must be signed in to change notification settings - Fork 4
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Require specifying the Google Service Account to run as. #20
Conversation
main.tf
Outdated
# Service accounts can be 30 characters long, so truncate var.name to 23 chars. | ||
account_id = "${substr(var.name, 0, 23)}-prober" | ||
# Service accounts can be 30 characters long, so truncate var.name to 26 chars. | ||
account_id = "${substr(var.name, 0, 26)}-prb" |
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.
The count
change will trigger a delete/create, so this change is intentional in order to avoid a name collision with the tombstoned service account, since I don't believe TF is smart enough to simple bring back the tombstoned GSA.
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.
Hmm, I am tempted to just mail this required moving forward since the most simple case of feeding a GSA .email
in here leads to:
Error: Invalid count argument
on .terraform/.../main.tf line 25, in resource "google_service_account" "prober":
25: count = var.service-account != "" ? 0 : 1
The "count" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the resources that the
count depends on.
} | ||
|
||
// Build the prober into an image we can run on Cloud Run. | ||
resource "ko_image" "image" { | ||
repo = local.repo |
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.
This is an improvement in newer releases of tf-ko :)
153ba95
to
fdcca9a
Compare
- name: Dump README | ||
if: failure() | ||
run: | | ||
cat README.md |
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.
This makes it easy to [ab]use CI to generate what the README should look like.
e107ff2
to
6215d43
Compare
6215d43
to
51a1052
Compare
馃巵 This changes the module to require the caller to specify the google service account as which to run. This allows the caller to have greater control over the service account name, and to authorize the service account to take actions prior to invoking the module to spin up the Cloud Run service. /kind feature
51a1052
to
9c2863b
Compare
Going to merge this, since I believe it satisfies our needs, but will hold off on cutting a release until sometime next week. |
馃巵 This changes the module to allow the caller to specify the google service account as which to run.
This allows the caller to have greater control over the service account name, and to authorize the service account to take actions prior to invoking the module to spin up the Cloud Run service.
/kind feature