Skip to content

Commit 68976c0

Browse files
authored
feat(identity): profile link additional param (#6454)
1 parent 85d7a95 commit 68976c0

File tree

6 files changed

+58
-12
lines changed

6 files changed

+58
-12
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ require (
2828
github.com/IBM/logs-router-go-sdk v1.0.8
2929
github.com/IBM/mqcloud-go-sdk v0.3.0
3030
github.com/IBM/networking-go-sdk v0.51.11
31-
github.com/IBM/platform-services-go-sdk v0.86.0
31+
github.com/IBM/platform-services-go-sdk v0.86.1
3232
github.com/IBM/project-go-sdk v0.3.5
3333
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5
3434
github.com/IBM/sarama v1.45.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ github.com/IBM/mqcloud-go-sdk v0.3.0 h1:zuRe+lu6IwIzsBsmoVKZT4JgX+GxH5PJG06r5y5X
149149
github.com/IBM/mqcloud-go-sdk v0.3.0/go.mod h1:7zigCUz6k3eRrNE8KOcDkY72oPppEmoQifF+SB0NPRM=
150150
github.com/IBM/networking-go-sdk v0.51.11 h1:l+yMXcO9GDcb7JU9jl8riUOXjnHTvIKSLnXYFlYlKXo=
151151
github.com/IBM/networking-go-sdk v0.51.11/go.mod h1:TAXWyBUk3C3R7aS1m84EfKdnDcBMZMAClwLfDj/SYZc=
152-
github.com/IBM/platform-services-go-sdk v0.86.0 h1:Uqne0Z/P9e++WfRt1aN8DD55kyo/T15+7EipYktRIDQ=
153-
github.com/IBM/platform-services-go-sdk v0.86.0/go.mod h1:aGD045m6I8pfcB77wft8w2cHqWOJjcM3YSSV55BX0Js=
152+
github.com/IBM/platform-services-go-sdk v0.86.1 h1:ngBpaXvUF3gmLvbU1Z4lX1wowOSYgGoKBEBaR/urt30=
153+
github.com/IBM/platform-services-go-sdk v0.86.1/go.mod h1:aGD045m6I8pfcB77wft8w2cHqWOJjcM3YSSV55BX0Js=
154154
github.com/IBM/project-go-sdk v0.3.5 h1:L+YClFUa14foS0B/hOOY9n7sIdsT5/XQicnXOyJSpyM=
155155
github.com/IBM/project-go-sdk v0.3.5/go.mod h1:FOJM9ihQV3EEAY6YigcWiTNfVCThtdY8bLC/nhQHFvo=
156156
github.com/IBM/push-notifications-go-sdk v0.0.0-20210310100607-5790b96c47f5 h1:NPUhkoOCRuv3OFWt19PmwjXGGTKlvmbuPg9fUrBUNe4=

ibm/service/iamidentity/data_source_ibm_iam_trusted_profile_link.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Mozilla Public License v2.0
33

44
/*
5-
* IBM OpenAPI Terraform Generator Version: 3.98.0-8be2046a-20241205-162752
5+
* IBM OpenAPI Terraform Generator Version: 3.106.0-09823488-20250707-071701
66
*/
77

88
package iamidentity
@@ -62,7 +62,7 @@ func DataSourceIBMIamTrustedProfileLink() *schema.Resource {
6262
"cr_type": &schema.Schema{
6363
Type: schema.TypeString,
6464
Computed: true,
65-
Description: "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.",
65+
Description: "The compute resource type. Valid values are VSI, BMS, IKS_SA, ROKS_SA, CE.",
6666
},
6767
"link": &schema.Schema{
6868
Type: schema.TypeList,
@@ -84,6 +84,16 @@ func DataSourceIBMIamTrustedProfileLink() *schema.Resource {
8484
Computed: true,
8585
Description: "Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.",
8686
},
87+
"component_type": &schema.Schema{
88+
Type: schema.TypeString,
89+
Computed: true,
90+
Description: "Component type of the compute resource, only required if cr_type is CE.",
91+
},
92+
"component_name": &schema.Schema{
93+
Type: schema.TypeString,
94+
Computed: true,
95+
Description: "Component name of the compute resource, only required if cr_type is CE.",
96+
},
8797
},
8898
},
8999
},
@@ -174,5 +184,11 @@ func DataSourceIBMIamTrustedProfileLinkProfileLinkLinkToMap(model *iamidentityv1
174184
if model.Name != nil {
175185
modelMap["name"] = *model.Name
176186
}
187+
if model.ComponentType != nil {
188+
modelMap["component_type"] = *model.ComponentType
189+
}
190+
if model.ComponentName != nil {
191+
modelMap["component_name"] = *model.ComponentName
192+
}
177193
return modelMap, nil
178194
}

ibm/service/iamidentity/resource_ibm_iam_trusted_profile_link.go

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Mozilla Public License v2.0
33

44
/*
5-
* IBM OpenAPI Terraform Generator Version: 3.98.0-8be2046a-20241205-162752
5+
* IBM OpenAPI Terraform Generator Version: 3.106.0-09823488-20250707-071701
66
*/
77

88
package iamidentity
@@ -48,7 +48,7 @@ func ResourceIBMIAMTrustedProfileLink() *schema.Resource {
4848
Type: schema.TypeString,
4949
Required: true,
5050
ForceNew: true,
51-
Description: "The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.",
51+
Description: "The compute resource type. Valid values are VSI, BMS, IKS_SA, ROKS_SA, CE.",
5252
},
5353
"link": &schema.Schema{
5454
Type: schema.TypeList,
@@ -74,6 +74,16 @@ func ResourceIBMIAMTrustedProfileLink() *schema.Resource {
7474
Optional: true,
7575
Description: "Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.",
7676
},
77+
"component_type": &schema.Schema{
78+
Type: schema.TypeString,
79+
Optional: true,
80+
Description: "Component type of the compute resource, only required if cr_type is CE.",
81+
},
82+
"component_name": &schema.Schema{
83+
Type: schema.TypeString,
84+
Optional: true,
85+
Description: "Component name of the compute resource, only required if cr_type is CE.",
86+
},
7787
},
7888
},
7989
},
@@ -253,10 +263,18 @@ func resourceIBMIamTrustedProfileLinkDelete(context context.Context, d *schema.R
253263
func ResourceIBMIamTrustedProfileLinkMapToCreateProfileLinkRequestLink(modelMap map[string]interface{}) (*iamidentityv1.CreateProfileLinkRequestLink, error) {
254264
model := &iamidentityv1.CreateProfileLinkRequestLink{}
255265
model.CRN = core.StringPtr(modelMap["crn"].(string))
256-
model.Namespace = core.StringPtr(modelMap["namespace"].(string))
266+
if modelMap["namespace"] != nil && modelMap["namespace"].(string) != "" {
267+
model.Namespace = core.StringPtr(modelMap["namespace"].(string))
268+
}
257269
if modelMap["name"] != nil && modelMap["name"].(string) != "" {
258270
model.Name = core.StringPtr(modelMap["name"].(string))
259271
}
272+
if modelMap["component_type"] != nil && modelMap["component_type"].(string) != "" {
273+
model.ComponentType = core.StringPtr(modelMap["component_type"].(string))
274+
}
275+
if modelMap["component_name"] != nil && modelMap["component_name"].(string) != "" {
276+
model.ComponentName = core.StringPtr(modelMap["component_name"].(string))
277+
}
260278
return model, nil
261279
}
262280

@@ -271,5 +289,11 @@ func ResourceIBMIamTrustedProfileLinkProfileLinkLinkToMap(model *iamidentityv1.P
271289
if model.Name != nil {
272290
modelMap["name"] = *model.Name
273291
}
292+
if model.ComponentType != nil {
293+
modelMap["component_type"] = *model.ComponentType
294+
}
295+
if model.ComponentName != nil {
296+
modelMap["component_name"] = *model.ComponentName
297+
}
274298
return modelMap, nil
275299
}

website/docs/d/iam_trusted_profile_link.html.markdown

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Provides a read-only data source to retrieve information about an iam_trusted_pr
1414

1515
```hcl
1616
data "ibm_iam_trusted_profile_link" "iam_trusted_profile_link" {
17-
link_id = "link_id"
18-
profile_id = "profile_id"
17+
link_id = ibm_iam_trusted_profile_link.iam_trusted_profile_link_instance.link_id
18+
profile_id = ibm_iam_trusted_profile_link.iam_trusted_profile_link_instance.profile_id
1919
}
2020
```
2121

@@ -31,11 +31,13 @@ You can specify the following arguments for this data source.
3131
After your data source is created, you can read values from the following attributes.
3232

3333
* `id` - The unique identifier of the iam_trusted_profile_link.
34-
* `cr_type` - (String) The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.
34+
* `cr_type` - (String) The compute resource type. Valid values are VSI, BMS, IKS_SA, ROKS_SA, CE.
3535
* `created_at` - (String) If set contains a date time string of the creation date in ISO format.
3636
* `entity_tag` - (String) version of the link.
3737
* `link` - (List)
3838
Nested schema for **link**:
39+
* `component_name` - (String) Component name of the compute resource, only required if cr_type is CE.
40+
* `component_type` - (String) Component type of the compute resource, only required if cr_type is CE.
3941
* `crn` - (String) The CRN of the compute resource.
4042
* `name` - (String) Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.
4143
* `namespace` - (String) The compute resource namespace, only required if cr_type is IKS_SA or ROKS_SA.

website/docs/r/iam_trusted_profile_link.html.markdown

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ resource "ibm_iam_trusted_profile_link" "iam_trusted_profile_link_instance" {
1919
crn = "crn"
2020
namespace = "namespace"
2121
name = "name"
22+
component_type = "component_type"
23+
component_name = "component_name"
2224
}
2325
profile_id = "profile_id"
2426
}
@@ -28,9 +30,11 @@ resource "ibm_iam_trusted_profile_link" "iam_trusted_profile_link_instance" {
2830

2931
You can specify the following arguments for this resource.
3032

31-
* `cr_type` - (Required, Forces new resource, String) The compute resource type. Valid values are VSI, IKS_SA, ROKS_SA.
33+
* `cr_type` - (Required, Forces new resource, String) The compute resource type. Valid values are VSI, BMS, IKS_SA, ROKS_SA, CE.
3234
* `link` - (Required, Forces new resource, List) Link details.
3335
Nested schema for **link**:
36+
* `component_name` - (Optional, String) Component name of the compute resource, only required if cr_type is CE.
37+
* `component_type` - (Optional, String) Component type of the compute resource, only required if cr_type is CE.
3438
* `crn` - (Optional, String) The CRN of the compute resource.
3539
* `name` - (Optional, String) Name of the compute resource, only required if cr_type is IKS_SA or ROKS_SA.
3640
* `namespace` - (Optional, String) The compute resource namespace, only required if cr_type is IKS_SA or ROKS_SA.

0 commit comments

Comments
 (0)