FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects

allow webapp service account id to be customised and SQL instance to be blank

Merged Dr Rich Wareham requested to merge issue-6-custom-service-account-id into master
All threads resolved!
2 files
+ 18
2
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 27dd7ccd
    As noted in #6, we were hard-coding the service account id used for the
    webapp to "webapp-run". This meant it was impossible to deploy more than
    one webapp in a project.
    
    Form a better default from the "name" variable. For existing deployments
    the service account id will be unchanged if the "name" variable is at
    its default value.
    
    Allow the service account id to be specified explicitly via the
    optional "service_account_id" variable.
    
    Closes #6
+ 2
2
@@ -3,8 +3,8 @@
# A service account which the webapp runs in the context of.
resource "google_service_account" "webapp" {
project = var.project
account_id = "webapp-run"
display_name = "Web application Cloud Run service account"
account_id = coalesce(var.service_account_id, "${var.name}-run")
display_name = coalesce(var.service_account_display_name, "Web application Cloud Run service account")
}
# The webapp service account has the ability to connect to the SQL instance.
Loading