Skip to content

Commit caadd3e

Browse files
Add new fields in QAS resource (#14204) (#10223)
[upstream:f0927d0547ee26934577bdbb234edb6bdd817139] Signed-off-by: Modular Magician <[email protected]>
1 parent 3ff2c3c commit caadd3e

File tree

4 files changed

+43
-8
lines changed

4 files changed

+43
-8
lines changed

.changelog/14204.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
cloudquotas: added `inherited` and `inherited_from` fields to `google_cloud_quotas_quota_adjuster_settings` resource
3+
```

google-beta/services/cloudquotas/resource_cloud_quotas_quota_adjuster_settings.go

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,26 @@ func ResourceCloudQuotasQuotaAdjusterSettings() *schema.Resource {
6565
Description: `The parent of the quota preference. Allowed parent format is "projects/[project-id / number]".`,
6666
},
6767
"effective_container": {
68-
Type: schema.TypeString,
69-
Computed: true,
70-
Description: `The resource container that determines if the quota adjuster is set for this project.
71-
Expect this field to be empty currently.`,
68+
Type: schema.TypeString,
69+
Computed: true,
70+
Description: `The resource container that determines if the quota adjuster is set for this project.`,
7271
},
7372
"effective_enablement": {
73+
Type: schema.TypeString,
74+
Computed: true,
75+
Description: `Based on the effective container's setting above, determines Whether this resource container has the quota adjuster enabled.`,
76+
},
77+
"inherited": {
78+
Type: schema.TypeBool,
79+
Computed: true,
80+
Description: `Indicates whether the setting is inherited or explicitly specified.`,
81+
},
82+
"inherited_from": {
7483
Type: schema.TypeString,
7584
Computed: true,
76-
Description: `Based on the effective container's setting above, determines Whether this resource container has the quota adjuster enabled.
77-
Expect this field to be empty currently.`,
85+
Description: `The resource container from which the setting is inherited. This refers to the nearest ancestor with enablement set (either ENABLED or DISABLED).
86+
The value can be 'organizations/{organization_id}', 'folders/{folder_id}', or can be 'default' if no ancestor exists with enablement set.
87+
The value will be empty when 'enablement' is specified on this resource container.`,
7888
},
7989
},
8090
UseJSONNumber: true,
@@ -177,6 +187,12 @@ func resourceCloudQuotasQuotaAdjusterSettingsRead(d *schema.ResourceData, meta i
177187
if err := d.Set("effective_enablement", flattenCloudQuotasQuotaAdjusterSettingsEffectiveEnablement(res["effectiveEnablement"], d, config)); err != nil {
178188
return fmt.Errorf("Error reading QuotaAdjusterSettings: %s", err)
179189
}
190+
if err := d.Set("inherited", flattenCloudQuotasQuotaAdjusterSettingsInherited(res["inherited"], d, config)); err != nil {
191+
return fmt.Errorf("Error reading QuotaAdjusterSettings: %s", err)
192+
}
193+
if err := d.Set("inherited_from", flattenCloudQuotasQuotaAdjusterSettingsInheritedFrom(res["inheritedFrom"], d, config)); err != nil {
194+
return fmt.Errorf("Error reading QuotaAdjusterSettings: %s", err)
195+
}
180196

181197
return nil
182198
}
@@ -270,6 +286,14 @@ func flattenCloudQuotasQuotaAdjusterSettingsEffectiveEnablement(v interface{}, d
270286
return v
271287
}
272288

289+
func flattenCloudQuotasQuotaAdjusterSettingsInherited(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
290+
return v
291+
}
292+
293+
func flattenCloudQuotasQuotaAdjusterSettingsInheritedFrom(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
294+
return v
295+
}
296+
273297
func expandCloudQuotasQuotaAdjusterSettingsEnablement(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
274298
return v, nil
275299
}

google-beta/services/cloudquotas/resource_cloud_quotas_quota_adjuster_settings_generated_meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ fields:
88
- field: 'effective_container'
99
- field: 'effective_enablement'
1010
- field: 'enablement'
11+
- field: 'inherited'
12+
- field: 'inherited_from'
1113
- field: 'parent'
1214
provider_only: true

website/docs/r/cloud_quotas_quota_adjuster_settings.html.markdown

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,17 @@ In addition to the arguments listed above, the following computed attributes are
7070

7171
* `effective_container` -
7272
The resource container that determines if the quota adjuster is set for this project.
73-
Expect this field to be empty currently.
7473

7574
* `effective_enablement` -
7675
Based on the effective container`s setting above, determines Whether this resource container has the quota adjuster enabled.
77-
Expect this field to be empty currently.
76+
77+
* `inherited` -
78+
Indicates whether the setting is inherited or explicitly specified.
79+
80+
* `inherited_from` -
81+
The resource container from which the setting is inherited. This refers to the nearest ancestor with enablement set (either ENABLED or DISABLED).
82+
The value can be `organizations/{organization_id}`, `folders/{folder_id}`, or can be `default` if no ancestor exists with enablement set.
83+
The value will be empty when `enablement` is specified on this resource container.
7884

7985

8086
## Timeouts

0 commit comments

Comments
 (0)