Skip to content

Commit 268ed93

Browse files
committed
fix(identity) iam_id as compute in profile of TP template
1 parent fa8866f commit 268ed93

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

ibm/service/iamidentity/resource_ibm_iam_trusted_profile_template.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func ResourceIBMTrustedProfileTemplate() *schema.Resource {
122122
Schema: map[string]*schema.Schema{
123123
"iam_id": {
124124
Type: schema.TypeString,
125-
Required: true,
125+
Computed: true,
126126
Description: "IAM ID of the identity.",
127127
},
128128
"identifier": {
@@ -789,7 +789,9 @@ func resourceIBMTrustedProfileTemplateProfileClaimRuleConditionsToMap(model *iam
789789

790790
func resourceIBMTrustedProfileTemplateProfileIdentityResponseToMap(model *iamidentityv1.ProfileIdentityResponse) (map[string]interface{}, error) {
791791
modelMap := make(map[string]interface{})
792-
modelMap["iam_id"] = model.IamID
792+
if model.IamID != nil {
793+
modelMap["iam_id"] = model.IamID
794+
}
793795
modelMap["identifier"] = model.Identifier
794796
modelMap["type"] = model.Type
795797
if model.Accounts != nil {

ibm/service/iamidentity/resource_ibm_iam_trusted_profile_template_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ func testAccCheckIBMTrustedProfileTemplateConfig(name string, description string
170170
}
171171
}
172172
identities {
173-
iam_id = "crn-crn:v1:staging:public:iam-identity::a/684e0f537b4548eb8d2c9593881a6b03:::"
174173
identifier = "crn:v1:staging:public:iam-identity::a/684e0f537b4548eb8d2c9593881a6b03:::"
175174
type = "crn"
176175
}

website/docs/r/trusted_profile_template.html.markdown renamed to website/docs/r/iam_trusted_profile_template.html.markdown

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
layout: "ibm"
3-
page_title: "IBM : ibm_trusted_profile_template"
3+
page_title: "IBM : ibm_iam_trusted_profile_template"
44
description: |-
5-
Manages IAM trusted profile templates
5+
Manages iam_trusted_profile_template
66
subcategory: "Identity & Access Management (IAM)"
77
---
88

9-
# ibm_trusted_profile_template
9+
# ibm_iam_trusted_profile_template
1010

1111
Create, update, commit, and delete trusted profile templates with this resource.
1212

@@ -31,7 +31,6 @@ resource "ibm_iam_trusted_profile_template" "trusted_profile_template_instance"
3131
}
3232
}
3333
identities {
34-
iam_id = "IBMid-123456789"
3534
identifier = "IBMid-123456789"
3635
type = "user"
3736
accounts = ["3213asv21s3d2vsd6bv54sfb321dfb"]
@@ -50,7 +49,6 @@ resource "ibm_iam_trusted_profile_template" "trusted_profile_template_instance"
5049
name = "Profile from Template"
5150
description = "description of profile from template"
5251
identities {
53-
iam_id = "iam-ServiceId-abcd83bd-e218-48af-8073-c0c1b3980001"
5452
identifier = "ServiceId-abcd83bd-e218-48af-8073-c0c1b3980001"
5553
type = "serviceid"
5654
}
@@ -77,7 +75,6 @@ resource "ibm_iam_trusted_profile_template" "trusted_profile_template_instance"
7775
name = "Profile from Template"
7876
description = "description of profile from template"
7977
identities {
80-
iam_id = format("crn-%s", var.instance_crn)
8178
identifier = var.instance_crn
8279
type = "crn"
8380
}
@@ -100,7 +97,6 @@ resource "ibm_iam_trusted_profile_template" "trusted_profile_template_instance"
10097
name = "Profile from Template"
10198
description = "description of profile from template"
10299
identities {
103-
iam_id = "iam-ServiceId-abcd83bd-e218-48af-8073-c0c1b3980001"
104100
identifier = "ServiceId-abcd83bd-e218-48af-8073-c0c1b3980001"
105101
type = "serviceid"
106102
}
@@ -124,7 +120,6 @@ resource "ibm_iam_trusted_profile_template" "trusted_profile_template_v2" {
124120
name = "Profile from Template"
125121
description = "description of profile from template"
126122
identities {
127-
iam_id = "iam-ServiceId-abcd83bd-e218-48af-8073-c0c1b3980001"
128123
identifier = "ServiceId-abcd83bd-e218-48af-8073-c0c1b3980001"
129124
type = "serviceid"
130125
}
@@ -163,7 +158,6 @@ Nested schema for **profile**:
163158
Nested schema for **identities**:
164159
* `accounts` - (Optional, List) Only valid for the type user. Accounts from which a user can assume the trusted profile.
165160
* `description` - (Optional, String) Description of the identity that can assume the trusted profile. This is optional field for all the types of identities. When this field is not set for the identity type 'serviceid' then the description of the service id is used. Description is recommended for the identity type 'crn' E.g. 'Instance 1234 of IBM Cloud Service project'.
166-
* `iam_id` - (Required, String) IAM ID of the identity.
167161
* `identifier` - (Required, String) Identifier of the identity that can assume the trusted profiles. This can be a user identifier (IAM id), serviceid or crn. Internally it uses account id of the service id for the identifier 'serviceid' and for the identifier 'crn' it uses account id contained in the CRN.
168162
* `type` - (Required, String) Type of the identity.
169163
* Constraints: Allowable values are: `user`, `serviceid`, `crn`.

0 commit comments

Comments
 (0)