Skip to content

Commit 0005201

Browse files
authored
sql: Add consumer_network_status, ip_address, and status fields to google_sql_database_instance (#14643)
1 parent 8819c95 commit 0005201

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

mmv1/third_party/terraform/services/sql/resource_sql_database_instance.go.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,21 @@ API (for read pools, effective_availability_type may differ from availability_ty
561561
Required: true,
562562
Description: `The consumer network of this consumer endpoint. This must be a resource path that includes both the host project and the network name. The consumer host project of this network might be different from the consumer service project.`,
563563
},
564+
"consumer_network_status": {
565+
Type: schema.TypeString,
566+
Computed: true,
567+
Description: `The connection policy status of the consumer network.`,
568+
},
569+
"ip_address": {
570+
Type: schema.TypeString,
571+
Computed: true,
572+
Description: `The IP address of the consumer endpoint.`,
573+
},
574+
"status": {
575+
Type: schema.TypeString,
576+
Computed: true,
577+
Description: `The connection status of the consumer endpoint.`,
578+
},
564579
},
565580
},
566581
Description: `A comma-separated list of networks or a comma-separated list of network-project pairs. Each project in this list is represented by a project number (numeric) or by a project ID (alphanumeric). This allows Private Service Connect connections to be created automatically for the specified networks.`,
@@ -2701,7 +2716,10 @@ func flattenPscAutoConnections(pscAutoConnections []*sqladmin.PscAutoConnectionC
27012716
for _, flag := range pscAutoConnections {
27022717
data := map[string]interface{}{
27032718
"consumer_network": flag.ConsumerNetwork,
2719+
"consumer_network_status": flag.ConsumerNetworkStatus,
27042720
"consumer_service_project_id": flag.ConsumerProject,
2721+
"ip_address": flag.IpAddress,
2722+
"status": flag.Status,
27052723
}
27062724

27072725
flags = append(flags, data)

mmv1/third_party/terraform/services/sql/resource_sql_database_instance_meta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ fields:
100100
- field: 'settings.ip_configuration.private_network'
101101
- field: 'settings.ip_configuration.psc_config.allowed_consumer_projects'
102102
- field: 'settings.ip_configuration.psc_config.psc_auto_connections.consumer_network'
103+
- field: 'settings.ip_configuration.psc_config.psc_auto_connections.consumer_network_status'
103104
- field: 'settings.ip_configuration.psc_config.psc_auto_connections.consumer_service_project_id'
105+
- field: 'settings.ip_configuration.psc_config.psc_auto_connections.ip_address'
106+
- field: 'settings.ip_configuration.psc_config.psc_auto_connections.status'
104107
- field: 'settings.ip_configuration.psc_config.psc_enabled'
105108
- field: 'settings.ip_configuration.server_ca_mode'
106109
- field: 'settings.ip_configuration.server_ca_pool'

mmv1/third_party/terraform/website/docs/r/sql_database_instance.html.markdown

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,12 @@ performing filtering in a Terraform config.
698698

699699
~> **NOTE:** Users can upgrade a read replica instance to a stand-alone Cloud SQL instance with the help of `instance_type`. To promote, users have to set the `instance_type` property as `CLOUD_SQL_INSTANCE` and remove/unset `master_instance_name` and `replica_configuration` from instance configuration. This operation might cause your instance to restart.
700700

701+
* `settings.ip_configuration.psc_config.psc_auto_connections.consumer_network_status` - (Output) The connection policy status of the consumer network.
702+
703+
* `settings.ip_configuration.psc_config.psc_auto_connections.ip_address` - (Output) The IP address of the consumer endpoint.
704+
705+
* `settings.ip_configuration.psc_config.psc_auto_connections.status` - (Output) The connection status of the consumer endpoint.
706+
701707
* `settings.version` - Used to make sure changes to the `settings` block are
702708
atomic.
703709

0 commit comments

Comments
 (0)