Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(iam-identity):trusted profile templates TypeList to TypeSet #5440

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ package iamidentity
import (
"context"
"fmt"
"log"

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"log"

"github.com/IBM-Cloud/terraform-provider-ibm/ibm/conns"
"github.com/IBM-Cloud/terraform-provider-ibm/ibm/flex"
Expand Down Expand Up @@ -152,7 +153,7 @@ func ResourceIBMTrustedProfileTemplate() *schema.Resource {
},
},
"policy_template_references": {
Type: schema.TypeList,
Type: schema.TypeSet,
Optional: true,
Description: "Existing policy templates that you can reference to assign access in the trusted profile component.",
Elem: &schema.Resource{
Expand Down Expand Up @@ -291,7 +292,7 @@ func resourceIBMTrustedProfileTemplateCreate(context context.Context, d *schema.
}
if _, ok := d.GetOk("policy_template_references"); ok {
var policyTemplateReferences []iamidentityv1.PolicyTemplateReference
for _, v := range d.Get("policy_template_references").([]interface{}) {
for _, v := range d.Get("policy_template_references").(*schema.Set).List() {
value := v.(map[string]interface{})
policyTemplateReferencesItem, err := resourceIBMTrustedProfileTemplateMapToPolicyTemplateReference(value)
if err != nil {
Expand Down Expand Up @@ -356,7 +357,7 @@ func resourceIBMTrustedProfileTemplateCreateVersion(context context.Context, d *
}
if _, ok := d.GetOk("policy_template_references"); ok {
var policyTemplateReferences []iamidentityv1.PolicyTemplateReference
for _, v := range d.Get("policy_template_references").([]interface{}) {
for _, v := range d.Get("policy_template_references").(*schema.Set).List() {
value := v.(map[string]interface{})
policyTemplateReferencesItem, err := resourceIBMTrustedProfileTemplateMapToPolicyTemplateReference(value)
if err != nil {
Expand Down Expand Up @@ -553,7 +554,7 @@ func resourceIBMTrustedProfileTemplateUpdate(context context.Context, d *schema.
}
if d.HasChange("policy_template_references") {
var policyTemplateReferences []iamidentityv1.PolicyTemplateReference
for _, v := range d.Get("policy_template_references").([]interface{}) {
for _, v := range d.Get("policy_template_references").(*schema.Set).List() {
value := v.(map[string]interface{})
policyTemplateReferencesItem, err := resourceIBMTrustedProfileTemplateMapToPolicyTemplateReference(value)
if err != nil {
Expand Down
Loading