Skip to content

Commit 9226168

Browse files
committed
Add data_api_access into resource_sql_database_instance
1 parent a3f2786 commit 9226168

File tree

4 files changed

+13
-0
lines changed

4 files changed

+13
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,13 @@ API (for read pools, effective_availability_type may differ from availability_ty
873873
ValidateFunc: validation.StringInSlice([]string{"NOT_REQUIRED", "REQUIRED"}, false),
874874
Description: `Enables the enforcement of Cloud SQL Auth Proxy or Cloud SQL connectors for all the connections. If enabled, all the direct connections are rejected.`,
875875
},
876+
"data_api_access": {
877+
Type: schema.TypeString,
878+
Optional: true,
879+
Computed: true,
880+
ValidateFunc: validation.StringInSlice([]string{"DISALLOW_DATA_API", "ALLOW_DATA_API"}, false),
881+
Description: `Allows using ExecuteSql API to connect to the instance. Disallowed when unspecified.`,
882+
},
876883
"deletion_protection_enabled": {
877884
Type: schema.TypeBool,
878885
Optional: true,
@@ -1743,6 +1750,7 @@ func expandSqlDatabaseInstanceSettings(configured []interface{}, databaseVersion
17431750
AvailabilityType: _settings["availability_type"].(string),
17441751
ConnectorEnforcement: _settings["connector_enforcement"].(string),
17451752
Collation: _settings["collation"].(string),
1753+
DataApiAccess: _settings["data_api_access"].(string),
17461754
DataDiskSizeGb: int64(_settings["disk_size"].(int)),
17471755
DataDiskType: _settings["disk_type"].(string),
17481756
{{- if ne $.TargetVersionName "ga" }}
@@ -2806,6 +2814,7 @@ func flattenSettings(settings *sqladmin.Settings, iType string, d *schema.Resour
28062814
"effective_availability_type": settings.AvailabilityType,
28072815
"collation": settings.Collation,
28082816
"connector_enforcement": settings.ConnectorEnforcement,
2817+
"data_api_access": settings.DataApiAccess,
28092818
"disk_type": settings.DataDiskType,
28102819
"disk_size": settings.DataDiskSizeGb,
28112820
{{- if ne $.TargetVersionName "ga" }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ fields:
110110
- api_field: 'settings.connectionPoolConfig.flags.name'
111111
- api_field: 'settings.connectionPoolConfig.flags.value'
112112
- api_field: 'settings.connectorEnforcement'
113+
- api_field: 'settings.dataApiAccess'
113114
- api_field: 'settings.dataCacheConfig.dataCacheEnabled'
114115
- api_field: 'settings.databaseFlags.name'
115116
- api_field: 'settings.databaseFlags.value'

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7198,6 +7198,7 @@ resource "google_sql_database_instance" "instance" {
71987198
71997199
activation_policy = "ALWAYS"
72007200
connector_enforcement = "REQUIRED"
7201+
data_api_access = "ALLOW_DATA_API"
72017202
}
72027203
}
72037204
`

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ The `settings` block supports:
423423

424424
* `connector_enforcement` - (Optional) Control the enforcement of Cloud SQL Auth Proxy or Cloud SQL connectors for all the connections, can be `REQUIRED` or `NOT_REQUIRED`. If enabled, all the direct connections are rejected.
425425

426+
* `data_api_access` - (Optional) Configures ExecuteSql API's access to the instance. connections, can be `ALLOW_DATA_API` or `DISALLOW_DATA_API` (default). `ALLOW_DATA_API` allows using ExecuteSql API to connect to the instance. For private IP instances, this allows authorized users to access the instance from the public internet using ExecuteSql API.
427+
426428
* `deletion_protection_enabled` - (Optional) Enables deletion protection of an instance at the GCP level. Enabling this protection will guard against accidental deletion across all surfaces (API, gcloud, Cloud Console and Terraform) by enabling the [GCP Cloud SQL instance deletion protection](https://cloud.google.com/sql/docs/postgres/deletion-protection). Terraform provider support was introduced in version 4.48.0. Defaults to `false`.
427429

428430
* `enable_google_ml_integration` - (Optional) Enables [Cloud SQL instances to connect to Vertex AI](https://cloud.google.com/sql/docs/postgres/integrate-cloud-sql-with-vertex-ai) and pass requests for real-time predictions and insights. Defaults to `false`.

0 commit comments

Comments
 (0)