Skip to content

Commit

Permalink
do not show sensitive certificate details in sql instance and cert (G…
Browse files Browse the repository at this point in the history
…oogleCloudPlatform#9684)

* chore: do not show sensitive certificate details in Terraform cmd output.

* Mark the whole replica_configuration as sensitive due to the private keys.
  • Loading branch information
feng-zhe authored and balanaguharsha committed May 2, 2024
1 parent d2e1117 commit c827fe1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -775,11 +775,12 @@ is set to true. Defaults to ZONAL.`,
},

"replica_configuration": {
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
Type: schema.TypeList,
Optional: true,
MaxItems: 1,
// Returned from API on all replicas
Computed: true,
Computed: true,
Sensitive: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ca_certificate": {
Expand Down Expand Up @@ -865,8 +866,9 @@ is set to true. Defaults to ZONAL.`,
Description: `The configuration for replication.`,
},
"server_ca_cert": {
Type: schema.TypeList,
Computed: true,
Type: schema.TypeList,
Computed: true,
Sensitive: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"cert": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func ResourceSqlSslCert() *schema.Resource {
"cert": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
Description: `The actual certificate data for this client certificate.`,
},

Expand Down Expand Up @@ -87,6 +88,7 @@ func ResourceSqlSslCert() *schema.Resource {
"server_ca_cert": {
Type: schema.TypeString,
Computed: true,
Sensitive: true,
Description: `The CA cert of the server this client cert was generated from.`,
},

Expand Down

0 comments on commit c827fe1

Please sign in to comment.