Skip to content

Commit

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

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

* Mark the whole replica_configuration as sensitive due to the private keys.
[upstream:ec0b19494cd2de57aed7e2fcb93687917d814cc1]

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored Jan 8, 2024
1 parent 84c66f1 commit dfe5b39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/9684.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
sql: update `replica_configuration`, `ca_cert`, and `server_ca_cert` fields to be flagged sensitive in `google_sql_instance` and `google_sql_ssl_cert` resources
```
8 changes: 5 additions & 3 deletions google/services/sql/resource_sql_database_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,8 @@ is set to true. Defaults to ZONAL.`,
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
2 changes: 2 additions & 0 deletions google/services/sql/resource_sql_ssl_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,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 @@ -89,6 +90,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 dfe5b39

Please sign in to comment.