Skip to content

Commit 53304c0

Browse files
committed
fix(cloudrunv2): Resolve persistent diff on WorkerPool scaling_mode
The `google_cloud_run_v2_worker_pool` resource showed a perpetual diff on the `scaling.scaling_mode` field. When the `scaling` block was configured (e.g., with `manual_instance_count`) but `scaling_mode` was omitted, Terraform would try to remove the `scaling_mode` attribute on subsequent plans. This occurred because the Cloud Run API defaults `scaling_mode` to "MANUAL" if not specified, but the Terraform resource schema did not account for this server-side default. This commit adds `default_from_api: true` to the `scaling.scaling_mode` field in the magic-modules YAML definition. This informs the provider that the API may return a default value for this field, preventing Terraform from detecting a diff when the API provides the "MANUAL" value that isn't explicitly in the configuration.
1 parent 04f00cb commit 53304c0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mmv1/products/cloudrunv2/WorkerPool.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ properties:
294294
type: Enum
295295
description: |
296296
The scaling mode for the worker pool. It defaults to MANUAL.
297+
default_from_api: true
297298
enum_values:
298299
- 'AUTOMATIC'
299300
- 'MANUAL'

0 commit comments

Comments
 (0)