Skip to content

Commit 3077337

Browse files
Transitioned volumes.cloud_sql_instance.instances to SET from array (#8929) (#15831)
Signed-off-by: Modular Magician <[email protected]>
1 parent 6b2f669 commit 3077337

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.changelog/8929.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:breaking-change
2+
cloudrunv2: transitioned `volumes.cloud_sql_instance.instances` to SET from ARRAY for `google_cloud_run_v2_service`
3+
```

google/services/cloudrunv2/resource_cloud_run_v2_service.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,13 @@ A duration in seconds with up to nine fractional digits, ending with 's'. Exampl
550550
Elem: &schema.Resource{
551551
Schema: map[string]*schema.Schema{
552552
"instances": {
553-
Type: schema.TypeList,
553+
Type: schema.TypeSet,
554554
Optional: true,
555555
Description: `The Cloud SQL instance connection names, as can be found in https://console.cloud.google.com/sql/instances. Visit https://cloud.google.com/sql/docs/mysql/connect-run for more information on how to connect Cloud SQL and Cloud Run. Format: {project}:{location}:{instance}`,
556556
Elem: &schema.Schema{
557557
Type: schema.TypeString,
558558
},
559+
Set: schema.HashString,
559560
},
560561
},
561562
},
@@ -2372,7 +2373,10 @@ func flattenCloudRunV2ServiceTemplateVolumesCloudSqlInstance(v interface{}, d *s
23722373
return []interface{}{transformed}
23732374
}
23742375
func flattenCloudRunV2ServiceTemplateVolumesCloudSqlInstanceInstances(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
2375-
return v
2376+
if v == nil {
2377+
return v
2378+
}
2379+
return schema.NewSet(schema.HashString, v.([]interface{}))
23762380
}
23772381

23782382
func flattenCloudRunV2ServiceTemplateExecutionEnvironment(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
@@ -3826,6 +3830,7 @@ func expandCloudRunV2ServiceTemplateVolumesCloudSqlInstance(v interface{}, d tpg
38263830
}
38273831

38283832
func expandCloudRunV2ServiceTemplateVolumesCloudSqlInstanceInstances(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
3833+
v = v.(*schema.Set).List()
38293834
return v, nil
38303835
}
38313836

0 commit comments

Comments
 (0)