Skip to content

Use CLOUD_IAM_SERVICE_ACCOUNT for MySQL variation #151

@NimJay

Description

@NimJay

Background:

  • There are two variations of this Three-tier web app:
    • PostgreSQL
    • MySQL
  • The CLOUD_IAM_SERVICE_ACCOUNT for each variation looks different:
resource "google_sql_user" "main" {
...
  name            = var.database_type == "postgresql" ? "${google_service_account.runsa.account_id}@${var.project_id}.iam" : "foo"
  type            = var.database_type == "postgresql" ? "CLOUD_IAM_SERVICE_ACCOUNT" : null
  password        = var.database_type == "mysql" ? "bar" : null
  • This discussion thread states that type = "CLOUD_IAM_SERVICE_ACCOUNT" didn't work for MySQL right out of the box.
  • This CLOUD_IAM_SERVICE_ACCOUNT option allows us to use Cloud Run's service account to access the database in CloudSQL.

Feature request:

  • Use CLOUD_IAM_SERVICE_ACCOUNT for the MySQL variation too. According to the docs, CLOUD_IAM_SERVICE_ACCOUNT is supported for both PostgreSQL an MySQL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions