Skip to content

Commit e2aed76

Browse files
deprecate iam_service_id and profile_id while creation of policies (IBM-Cloud#6345)
Signed-off-by: Rajesh Pirati <[email protected]>
1 parent b486c88 commit e2aed76

8 files changed

+39
-43
lines changed

ibm/service/iampolicy/data_source_ibm_iam_service_policy.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ func DataSourceIBMIAMServicePolicy() *schema.Resource {
2323

2424
Schema: map[string]*schema.Schema{
2525
"iam_service_id": {
26-
Type: schema.TypeString,
27-
Optional: true,
28-
ExactlyOneOf: []string{"iam_service_id", "iam_id"},
29-
Description: "UUID of ServiceID",
26+
Type: schema.TypeString,
27+
Optional: true,
28+
Deprecated: "This field is deprecated and will be removed starting with this 1.82.0 release. Please use iam_id field instead.",
29+
Description: "UUID of ServiceID",
3030
ValidateFunc: validate.InvokeDataSourceValidator("ibm_iam_service_policy",
3131
"iam_service_id"),
3232
},
3333
"iam_id": {
34-
Type: schema.TypeString,
35-
Optional: true,
36-
ExactlyOneOf: []string{"iam_service_id", "iam_id"},
37-
Description: "IAM ID of ServiceID",
34+
Type: schema.TypeString,
35+
Optional: true,
36+
Description: "IAM ID of ServiceID",
3837
},
3938
"sort": {
4039
Description: "Sort query for policies",

ibm/service/iampolicy/data_source_ibm_iam_trusted_profile_policy.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ func DataSourceIBMIAMTrustedProfilePolicy() *schema.Resource {
2323

2424
Schema: map[string]*schema.Schema{
2525
"profile_id": {
26-
Type: schema.TypeString,
27-
Optional: true,
28-
ExactlyOneOf: []string{"profile_id", "iam_id"},
29-
Description: "UUID of trusted profile",
26+
Type: schema.TypeString,
27+
Optional: true,
28+
Deprecated: "This field is deprecated and will be removed starting with this 1.82.0 release. Please use iam_id field instead.",
29+
Description: "UUID of trusted profile",
3030
ValidateFunc: validate.InvokeDataSourceValidator("ibm_iam_trusted_profile_policy",
3131
"profile_id"),
3232
},
3333
"iam_id": {
34-
Type: schema.TypeString,
35-
Optional: true,
36-
ExactlyOneOf: []string{"profile_id", "iam_id"},
37-
Description: "IAM ID of trusted profile",
34+
Type: schema.TypeString,
35+
Optional: true,
36+
Description: "IAM ID of trusted profile",
3837
},
3938
"sort": {
4039
Description: "Sort query for policies",

ibm/service/iampolicy/resource_ibm_iam_service_policy.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,19 @@ func ResourceIBMIAMServicePolicy() *schema.Resource {
3939

4040
Schema: map[string]*schema.Schema{
4141
"iam_service_id": {
42-
Type: schema.TypeString,
43-
Optional: true,
44-
ExactlyOneOf: []string{"iam_service_id", "iam_id"},
45-
Description: "UUID of ServiceID",
46-
ForceNew: true,
42+
Type: schema.TypeString,
43+
Optional: true,
44+
Description: "UUID of ServiceID",
45+
ForceNew: true,
46+
Deprecated: "This field is deprecated and will be removed starting with this 1.82.0 release. Please use iam_id field instead.",
4747
ValidateFunc: validate.InvokeValidator("ibm_iam_service_policy",
4848
"iam_service_id"),
4949
},
5050
"iam_id": {
51-
Type: schema.TypeString,
52-
Optional: true,
53-
ExactlyOneOf: []string{"iam_service_id", "iam_id"},
54-
Description: "IAM ID of ServiceID",
55-
ForceNew: true,
51+
Type: schema.TypeString,
52+
Optional: true,
53+
Description: "IAM ID of ServiceID",
54+
ForceNew: true,
5655
},
5756
"roles": {
5857
Type: schema.TypeList,

ibm/service/iampolicy/resource_ibm_iam_trusted_profile_policy.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,19 @@ func ResourceIBMIAMTrustedProfilePolicy() *schema.Resource {
3939

4040
Schema: map[string]*schema.Schema{
4141
"profile_id": {
42-
Type: schema.TypeString,
43-
Optional: true,
44-
ExactlyOneOf: []string{"profile_id", "iam_id"},
45-
Description: "UUID of Trusted Profile",
46-
ForceNew: true,
42+
Type: schema.TypeString,
43+
Optional: true,
44+
Description: "UUID of Trusted Profile",
45+
ForceNew: true,
46+
Deprecated: "This field is deprecated and will be removed starting with this 1.82.0 release. Please use iam_id field instead.",
4747
ValidateFunc: validate.InvokeValidator("ibm_iam_trusted_profile_policy",
4848
"profile_id"),
4949
},
5050
"iam_id": {
51-
Type: schema.TypeString,
52-
Optional: true,
53-
ExactlyOneOf: []string{"profile_id", "iam_id"},
54-
Description: "IAM ID of Trusted Profile",
55-
ForceNew: true,
51+
Type: schema.TypeString,
52+
Optional: true,
53+
Description: "IAM ID of Trusted Profile",
54+
ForceNew: true,
5655
},
5756
"roles": {
5857
Type: schema.TypeList,

website/docs/d/iam_service_policy.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ data "ibm_iam_service_policy" "testacc_ds_service_policy" {
3535

3636
Review the argument references that you can specify for your data source.
3737

38-
- `iam_service_id` - (Required, String) The UUID of the service ID.
39-
- `iam_id` - (Optional, String) IAM ID of the service ID. One of the `iam_service_id` or `iam_id` is required argument. You can use to get cross account service ID policy.
38+
- `iam_service_id` - (Optional, String) The UUID of the service ID. This field is deprecated and will be removed in future releases. Please use iam_id as a replacement.
39+
- `iam_id` - (Optional, String) IAM ID of the service ID.
4040
- `sort`- Optional - (String) The single field sort query for policies.
4141
- `transaction_id`- (Optional, String) The TransactionID can be passed to your request for the tracking calls.
4242

website/docs/d/iam_trusted_profile_policy.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ data "ibm_iam_trusted_profile_policy" "policy" {
3535

3636
Review the argument references that you can specify for your data source.
3737

38-
- `profile_id` - (Required, String) The UUID of the trusted profile. Either `profile_id` or `iam_id` is required.
39-
- `iam_id` - (Optional, String) IAM ID of the trusted profile. Either `profile_id` or `iam_id` is required.
38+
- `profile_id` - (Optional, String) The UUID of the trusted profile. This field is deprecated and will be removed in future releases. Please use iam_id as a replacement.
39+
- `iam_id` - (Optional, String) IAM ID of the trusted profile.
4040
- `sort`- Optional - (String) The single field sort query for policies.
4141
- `transaction_id`- (Optional, String) The TransactionID can be passed to your request for the tracking calls.
4242

website/docs/r/iam_service_policy.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ Review the argument references that you can specify for your resource.
340340

341341
- `account_management` - (Optional, Bool) Gives access to all account management services if set to **true**. Default value is **false**. If you set this option, do not set `resources` at the same time.**Note** Conflicts with `resources` and `resource_attributes`.
342342
- `description` (Optional, String) The description of the IAM Service Policy.
343-
- `iam_service_id` - (Required, Forces new resource, String) The UUID of the service ID.
343+
- `iam_service_id` - (Optional, Forces new resource, String) The UUID of the service ID. This field is deprecated and will be removed in future releases. Please use iam_id as a replacement.
344344
- `iam_id` - (Optional, Forces new resource, String) IAM ID of the service ID. Used to assign cross account service ID policy. Either `iam_service_id` or `iam_id` is required.
345345
- `resources` - (List of Objects) Optional- A nested block describes the resource of this policy.**Note** Conflicts with `account_management` and `resource_attributes`.
346346

website/docs/r/iam_trusted_profile_policy.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ Review the argument references that you can specify for your resource.
334334

335335
- `account_management` - (Optional, Bool) Gives access to all account management services if set to **true**. Default value is **false**. If you set this option, do not set `resources` at the same time.**Note** Conflicts with `resources` and `resource_attributes`.
336336
- `description` (Optional, String) The description of the IAM Trusted Profile Policy.
337-
- `profile_id` - (Optional, Forces new resource, String) The UUID of the trusted profile. Either `profile_id` or `iam_id` is required.
338-
- `iam_id` - (Optional, Forces new resource, String) IAM ID of the truestedprofile. Either `profile_id` or `iam_id` is required.
337+
- `profile_id` - (Optional, Forces new resource, String) The UUID of the trusted profile. This field is deprecated and will be removed in future releases. Please use iam_id as a replacement.
338+
- `iam_id` - (Optional, Forces new resource, String) IAM ID of the truestedprofile.
339339
- `resources` - (List of Objects) Optional- A nested block describes the resource of this policy.**Note** Conflicts with `account_management` and `resource_attributes`.
340340

341341
Nested scheme for `resources`:

0 commit comments

Comments
 (0)