Skip to content

Conversation

@syedrakib
Copy link
Contributor

@syedrakib syedrakib commented Dec 18, 2020

Allows declaring secrets without having to repeat the namespace name for every single secret that is declared. This also reduces chances of typos and mistakes.

OLD WAY:

module "gke_cluster" {
  source = "airasia/gke_cluster/google"
  ......
  ......
  ......
  ......
  ......
  namespaces = [
    {
      name   = "myns"
      labels = {}
    }
  ]
  secrets = {
    "myns:mysqldb" = {
      username = module.mysql_db.root_user_name
      password = module.mysql_db.root_user_password
    }
    "myns:postgresdb" = {
      username = module.postgres_db.root_user_name
      password = module.postgres_db.root_user_password
    }
    "myns:sqlserverdb" = {
      username = module.sqlserver_db.root_user_name
      password = module.sqlserver_db.root_user_password
    }
  }
}

NEW WAY

module "gke_cluster" {
  source = "airasia/gke_cluster/google"
  ......
  ......
  ......
  ......
  ......
  namespaces = [
    {
      name   = "myns"
      labels = {}
      secrets = {
        mysqldb = {
          username = module.mysql_db.root_user_name
          password = module.mysql_db.root_user_password
        }
        postgresdb = {
          username = module.postgres_db.root_user_name
          password = module.postgres_db.root_user_password
        }
        sqlserverdb = {
          username = module.sqlserver_db.root_user_name
          password = module.sqlserver_db.root_user_password
        }
      }
    }
  ]
}

@syedrakib syedrakib force-pushed the move_var_secrets_into_var_namespaces branch from 8c9f163 to a4ef1e9 Compare December 22, 2020 10:15
@syedrakib syedrakib changed the title Move var secrets into var namespaces Move var.secrets into var.namespaces Dec 23, 2020
Copy link
Contributor

@itsmunim itsmunim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@syedrakib syedrakib merged commit f57c8cc into master Dec 24, 2020
@syedrakib syedrakib deleted the move_var_secrets_into_var_namespaces branch December 24, 2020 04:19
@airasia airasia deleted a comment from itsmunim Dec 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants