Skip to content

Commit 982cf1d

Browse files
Revert " provider: eliminated the need to manually add *_wo and `*_… (#14942) (#24081)
[upstream:c4a23a80951f1790dee041960a96646eed28ed44] Signed-off-by: Modular Magician <[email protected]>
1 parent 86f9d5d commit 982cf1d

8 files changed

+69
-68
lines changed

google/services/bigquerydatatransfer/resource_bigquery_data_transfer_config.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -287,24 +287,25 @@ to a different credential configuration in the config will require an apply to u
287287
Elem: &schema.Resource{
288288
Schema: map[string]*schema.Schema{
289289
"secret_access_key": {
290-
Type: schema.TypeString,
291-
Optional: true,
292-
Description: `The Secret Access Key of the AWS account transferring data from.`,
293-
Sensitive: true,
290+
Type: schema.TypeString,
291+
Optional: true,
292+
Description: `The Secret Access Key of the AWS account transferring data from.`,
293+
Sensitive: true,
294+
ConflictsWith: []string{"sensitive_params.0.secret_access_key_wo"},
295+
AtLeastOneOf: []string{"sensitive_params.0.secret_access_key", "sensitive_params.0.secret_access_key_wo"},
294296
},
295297
"secret_access_key_wo": {
296-
Type: schema.TypeString,
297-
Optional: true,
298-
Description: `The Secret Access Key of the AWS account transferring data from.
299-
Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
300-
WriteOnly: true,
301-
ExactlyOneOf: []string{"sensitive_params.0.secret_access_key", "sensitive_params.0.secret_access_key_wo"},
302-
RequiredWith: []string{"sensitive_params.0.secret_access_key_wo_version"},
298+
Type: schema.TypeString,
299+
Optional: true,
300+
Description: `The Secret Access Key of the AWS account transferring data from.`,
301+
WriteOnly: true,
302+
ConflictsWith: []string{"sensitive_params.0.secret_access_key"},
303+
AtLeastOneOf: []string{"sensitive_params.0.secret_access_key_wo", "sensitive_params.0.secret_access_key"},
303304
},
304305
"secret_access_key_wo_version": {
305-
Type: schema.TypeString,
306+
Type: schema.TypeInt,
306307
Optional: true,
307-
Description: `Triggers update of secret_access_key_wo write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
308+
Description: `The version of the sensitive params - used to trigger updates of the write-only params. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
308309
RequiredWith: []string{"sensitive_params.0.secret_access_key_wo"},
309310
},
310311
},

google/services/monitoring/resource_monitoring_uptime_check_config.go

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -172,23 +172,25 @@ func ResourceMonitoringUptimeCheckConfig() *schema.Resource {
172172
Description: `The username to authenticate.`,
173173
},
174174
"password": {
175-
Type: schema.TypeString,
176-
Optional: true,
177-
Description: `The password to authenticate.`,
178-
Sensitive: true,
175+
Type: schema.TypeString,
176+
Optional: true,
177+
Description: `The password to authenticate.`,
178+
Sensitive: true,
179+
ExactlyOneOf: []string{},
179180
},
180181
"password_wo": {
181182
Type: schema.TypeString,
182183
Optional: true,
183-
Description: `The password to authenticate. Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
184+
Description: `The password to authenticate.`,
184185
WriteOnly: true,
185-
ExactlyOneOf: []string{"http_check.0.auth_info.0.password", "http_check.0.auth_info.0.password_wo"},
186+
ExactlyOneOf: []string{},
186187
RequiredWith: []string{"http_check.0.auth_info.0.password_wo_version"},
187188
},
188189
"password_wo_version": {
189190
Type: schema.TypeString,
190191
Optional: true,
191-
Description: `Triggers update of password_wo write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
192+
ForceNew: true,
193+
Description: `The password write-only version.`,
192194
RequiredWith: []string{"http_check.0.auth_info.0.password_wo"},
193195
},
194196
},
@@ -1091,24 +1093,24 @@ func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d *schem
10911093
transformed := make(map[string]interface{})
10921094
transformed["password"] =
10931095
flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(original["password"], d, config)
1094-
transformed["username"] =
1095-
flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(original["username"], d, config)
10961096
transformed["password_wo_version"] =
10971097
flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWoVersion(original["passwordWoVersion"], d, config)
1098+
transformed["username"] =
1099+
flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(original["username"], d, config)
10981100
return []interface{}{transformed}
10991101
}
11001102
func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
11011103
return d.Get("http_check.0.auth_info.0.password")
11021104
}
11031105

1104-
func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1105-
return v
1106-
}
1107-
11081106
func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWoVersion(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
11091107
return d.Get("http_check.0.auth_info.0.password_wo_version")
11101108
}
11111109

1110+
func flattenMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
1111+
return v
1112+
}
1113+
11121114
func flattenMonitoringUptimeCheckConfigHttpCheckServiceAgentAuthentication(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
11131115
if v == nil {
11141116
return nil
@@ -1627,18 +1629,11 @@ func expandMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d tpgreso
16271629
transformed["password"] = transformedPassword
16281630
}
16291631

1630-
transformedUsername, err := expandMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(original["username"], d, config)
1631-
if err != nil {
1632-
return nil, err
1633-
} else if val := reflect.ValueOf(transformedUsername); val.IsValid() && !tpgresource.IsEmptyValue(val) {
1634-
transformed["username"] = transformedUsername
1635-
}
1636-
16371632
transformedPasswordWo, err := expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWo(original["password_wo"], d, config)
16381633
if err != nil {
16391634
return nil, err
16401635
} else if val := reflect.ValueOf(transformedPasswordWo); val.IsValid() && !tpgresource.IsEmptyValue(val) {
1641-
transformed["password"] = transformedPasswordWo
1636+
transformed["passwordWo"] = transformedPasswordWo
16421637
}
16431638

16441639
transformedPasswordWoVersion, err := expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWoVersion(original["password_wo_version"], d, config)
@@ -1648,22 +1643,29 @@ func expandMonitoringUptimeCheckConfigHttpCheckAuthInfo(v interface{}, d tpgreso
16481643
transformed["passwordWoVersion"] = transformedPasswordWoVersion
16491644
}
16501645

1646+
transformedUsername, err := expandMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(original["username"], d, config)
1647+
if err != nil {
1648+
return nil, err
1649+
} else if val := reflect.ValueOf(transformedUsername); val.IsValid() && !tpgresource.IsEmptyValue(val) {
1650+
transformed["username"] = transformedUsername
1651+
}
1652+
16511653
return transformed, nil
16521654
}
16531655

16541656
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPassword(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
16551657
return v, nil
16561658
}
16571659

1658-
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1660+
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWo(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
16591661
return v, nil
16601662
}
16611663

1662-
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWo(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1664+
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWoVersion(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
16631665
return v, nil
16641666
}
16651667

1666-
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoPasswordWoVersion(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
1668+
func expandMonitoringUptimeCheckConfigHttpCheckAuthInfoUsername(v interface{}, d tpgresource.TerraformResourceData, config *transport_tpg.Config) (interface{}, error) {
16671669
return v, nil
16681670
}
16691671

google/services/monitoring/resource_monitoring_uptime_check_config_generated_meta.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ fields:
1515
- field: 'http_check.accepted_response_status_codes.status_value'
1616
- field: 'http_check.auth_info.password'
1717
- field: 'http_check.auth_info.password_wo'
18-
api_field: 'http_check.auth_info.password'
1918
- field: 'http_check.auth_info.password_wo_version'
20-
provider_only: true
2119
- field: 'http_check.auth_info.username'
2220
- field: 'http_check.body'
2321
- field: 'http_check.content_type'

google/services/monitoring/resource_monitoring_uptime_check_config_generated_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpExample(t *testing.
5151
ResourceName: "google_monitoring_uptime_check_config.http",
5252
ImportState: true,
5353
ImportStateVerify: true,
54-
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo"},
54+
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo_version"},
5555
},
5656
},
5757
})
@@ -121,7 +121,7 @@ func TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpPasswordWoExample(t
121121
ResourceName: "google_monitoring_uptime_check_config.http",
122122
ImportState: true,
123123
ImportStateVerify: true,
124-
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo"},
124+
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo_version"},
125125
},
126126
},
127127
})
@@ -195,7 +195,7 @@ func TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigStatusCodeExample(t *te
195195
ResourceName: "google_monitoring_uptime_check_config.status_code",
196196
ImportState: true,
197197
ImportStateVerify: true,
198-
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo"},
198+
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo_version"},
199199
},
200200
},
201201
})
@@ -267,7 +267,7 @@ func TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigHttpsExample(t *testing
267267
ResourceName: "google_monitoring_uptime_check_config.https",
268268
ImportState: true,
269269
ImportStateVerify: true,
270-
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo"},
270+
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo_version"},
271271
},
272272
},
273273
})
@@ -328,7 +328,7 @@ func TestAccMonitoringUptimeCheckConfig_uptimeCheckTcpExample(t *testing.T) {
328328
ResourceName: "google_monitoring_uptime_check_config.tcp_group",
329329
ImportState: true,
330330
ImportStateVerify: true,
331-
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo"},
331+
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo_version"},
332332
},
333333
},
334334
})
@@ -381,7 +381,7 @@ func TestAccMonitoringUptimeCheckConfig_uptimeCheckConfigSyntheticMonitorExample
381381
ResourceName: "google_monitoring_uptime_check_config.synthetic_monitor",
382382
ImportState: true,
383383
ImportStateVerify: true,
384-
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo"},
384+
ImportStateVerifyIgnore: []string{"http_check.0.auth_info.0.password_wo_version"},
385385
},
386386
},
387387
})

google/services/secretmanager/resource_secret_manager_secret_version.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,27 +90,28 @@ func ResourceSecretManagerSecretVersion() *schema.Resource {
9090
},
9191

9292
Schema: map[string]*schema.Schema{
93-
"secret_data": {
94-
Type: schema.TypeString,
93+
"secret_data_wo_version": {
94+
Type: schema.TypeInt,
9595
Optional: true,
9696
ForceNew: true,
97-
Description: `The secret data. Must be no larger than 64KiB.`,
98-
Sensitive: true,
97+
Description: `Triggers update of secret data write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
98+
Default: 0,
99+
},
100+
"secret_data": {
101+
Type: schema.TypeString,
102+
Optional: true,
103+
ForceNew: true,
104+
Description: `The secret data. Must be no larger than 64KiB.`,
105+
Sensitive: true,
106+
ConflictsWith: []string{},
99107
},
100108
"secret_data_wo": {
101109
Type: schema.TypeString,
102110
Optional: true,
103-
Description: `The secret data. Must be no larger than 64KiB. Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
111+
Description: `The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
104112
WriteOnly: true,
105113
ConflictsWith: []string{"secret_data"},
106-
RequiredWith: []string{"secret_data_wo_version"},
107-
},
108-
"secret_data_wo_version": {
109-
Type: schema.TypeString,
110-
Optional: true,
111-
ForceNew: true,
112-
Description: `Triggers update of secret_data_wo write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)`,
113-
RequiredWith: []string{"secret_data_wo"},
114+
RequiredWith: []string{},
114115
},
115116

116117
"secret": {

google/services/secretmanager/resource_secret_manager_secret_version_generated_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestAccSecretManagerSecretVersion_secretVersionBasicExample(t *testing.T) {
4949
ResourceName: "google_secret_manager_secret_version.secret-version-basic",
5050
ImportState: true,
5151
ImportStateVerify: true,
52-
ImportStateVerifyIgnore: []string{"secret", "secret_data_wo"},
52+
ImportStateVerifyIgnore: []string{"secret"},
5353
},
5454
},
5555
})
@@ -97,7 +97,7 @@ func TestAccSecretManagerSecretVersion_secretVersionBasicWriteOnlyExample(t *tes
9797
ResourceName: "google_secret_manager_secret_version.secret-version-basic-write-only",
9898
ImportState: true,
9999
ImportStateVerify: true,
100-
ImportStateVerifyIgnore: []string{"secret", "secret_data_wo"},
100+
ImportStateVerifyIgnore: []string{"secret"},
101101
},
102102
},
103103
})
@@ -145,7 +145,7 @@ func TestAccSecretManagerSecretVersion_secretVersionDeletionPolicyAbandonExample
145145
ResourceName: "google_secret_manager_secret_version.secret-version-deletion-policy",
146146
ImportState: true,
147147
ImportStateVerify: true,
148-
ImportStateVerifyIgnore: []string{"deletion_policy", "secret", "secret_data_wo"},
148+
ImportStateVerifyIgnore: []string{"deletion_policy", "secret"},
149149
},
150150
},
151151
})
@@ -193,7 +193,7 @@ func TestAccSecretManagerSecretVersion_secretVersionDeletionPolicyDisableExample
193193
ResourceName: "google_secret_manager_secret_version.secret-version-deletion-policy",
194194
ImportState: true,
195195
ImportStateVerify: true,
196-
ImportStateVerifyIgnore: []string{"deletion_policy", "secret", "secret_data_wo"},
196+
ImportStateVerifyIgnore: []string{"deletion_policy", "secret"},
197197
},
198198
},
199199
})
@@ -242,7 +242,7 @@ func TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataEx
242242
ResourceName: "google_secret_manager_secret_version.secret-version-base64",
243243
ImportState: true,
244244
ImportStateVerify: true,
245-
ImportStateVerifyIgnore: []string{"is_secret_data_base64", "secret", "secret_data_wo"},
245+
ImportStateVerifyIgnore: []string{"is_secret_data_base64", "secret"},
246246
},
247247
},
248248
})
@@ -291,7 +291,7 @@ func TestAccSecretManagerSecretVersion_secretVersionWithBase64StringSecretDataWr
291291
ResourceName: "google_secret_manager_secret_version.secret-version-base64-write-only",
292292
ImportState: true,
293293
ImportStateVerify: true,
294-
ImportStateVerifyIgnore: []string{"is_secret_data_base64", "secret", "secret_data_wo"},
294+
ImportStateVerifyIgnore: []string{"is_secret_data_base64", "secret"},
295295
},
296296
},
297297
})

website/docs/r/bigquery_data_transfer_config.html.markdown

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ The following write-only attributes are supported:
296296
* `secret_access_key_wo` -
297297
(Optional)
298298
The Secret Access Key of the AWS account transferring data from.
299-
Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
300299
**Note**: This property is write-only and will not be read from the API.
301300

302301
## Attributes Reference

website/docs/r/secret_manager_secret_version.html.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ The following arguments are supported:
234234

235235
* `secret_data_wo_version` -
236236
(Optional)
237-
Triggers update of secret_data_wo write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
237+
Triggers update of secret data write-only. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
238238

239239
* `deletion_policy` - (Optional) The deletion policy for the secret version. Setting `ABANDON` allows the resource
240240
to be abandoned rather than deleted. Setting `DISABLE` allows the resource to be
@@ -252,15 +252,15 @@ The following write-only attributes are supported:
252252

253253
* `secret_data_wo` -
254254
(Optional)
255-
The secret data. Must be no larger than 64KiB. Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
255+
The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
256256
**Note**: This property is write-only and will not be read from the API.
257257

258258

259259
<a name="nested_payload"></a>The `payload` block supports:
260260

261261
* `secret_data_wo` -
262262
(Optional)
263-
The secret data. Must be no larger than 64KiB. Note: This property is write-only and will not be read from the API. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
263+
The secret data. Must be no larger than 64KiB. For more info see [updating write-only attributes](/docs/providers/google/guides/using_write_only_attributes.html#updating-write-only-attributes)
264264
**Note**: This property is write-only and will not be read from the API.
265265

266266
## Attributes Reference

0 commit comments

Comments
 (0)