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

Migrate: IAM Client to new SDK in accessgroupmembers resource #2850

Merged
merged 2 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
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
21 changes: 0 additions & 21 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@ github.com/IBM/go-sdk-core v1.1.0/go.mod h1:2pcx9YWsIsZ3I7kH+1amiAkXvLTZtAq9kbxs
github.com/IBM/go-sdk-core/v3 v3.0.0/go.mod h1:JI5NS2+iCoY/D8Oq3JNEZNA7qO42agu6fnaUmDsRcJA=
github.com/IBM/go-sdk-core/v3 v3.2.4 h1:WKYJYYKlZnw1y/gM+Qbf5EQVAL9xaoD54+ooJZz/iBQ=
github.com/IBM/go-sdk-core/v3 v3.2.4/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0=
github.com/IBM/go-sdk-core/v3 v3.3.1 h1:DoXjP1+Wm8Yd4XJsvBMRcYLvQwSLFnzKlMjSrg3Rzpw=
github.com/IBM/go-sdk-core/v3 v3.3.1/go.mod h1:lk9eOzNbNltPf3CBpcg1Ewkhw4qC3u2QCCKDRsUA2M0=
github.com/IBM/go-sdk-core/v4 v4.5.1/go.mod h1:lTUXbqIX6/aAbSCkP6q59+dyFsTwZAc0ewRS2vJWVbg=
github.com/IBM/go-sdk-core/v4 v4.8.1/go.mod h1:GECJ/p0r9Hs0XcOnCiGjZrt6M/rQc+gW8YkCsGJ+j5U=
github.com/IBM/go-sdk-core/v4 v4.9.0 h1:OkSg5kaEfVoNuBA4IsIOz8Ur5rbGHbWxmWCZ7nK/oc0=
github.com/IBM/go-sdk-core/v4 v4.9.0/go.mod h1:DbQ+3pFoIjxGGTEiA9zQ2V0cemMNmFMkLBBnR729HKg=
github.com/IBM/go-sdk-core/v4 v4.10.0 h1:aLoKusSFVsxMJeKHf8csj9tBWt4Y50kVvfxoKh6scN0=
github.com/IBM/go-sdk-core/v4 v4.10.0/go.mod h1:0uz2ca0MZ2DwsBRGl9Jp3EaCTqxmKZTdvV/CkCB7JnI=
Expand Down Expand Up @@ -111,9 +108,7 @@ github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE=
github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0=
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
Expand Down Expand Up @@ -206,16 +201,10 @@ github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw=
github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8=
github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw=
github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4=
github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -383,8 +372,6 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
Expand Down Expand Up @@ -432,8 +419,6 @@ github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39
github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o=
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0=
github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A=
github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ=
github.com/hashicorp/go-plugin v1.4.1 h1:6UltRQlLN9iZO513VveELp5xyaFxVD2+1OVylE+2E+w=
github.com/hashicorp/go-plugin v1.4.1/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ=
github.com/hashicorp/go-retryablehttp v0.6.2/go.mod h1:gEx6HMUGxYYhJScX7W1Il64m6cc2C1mDaW3NQ9sY1FY=
Expand All @@ -455,18 +440,12 @@ github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352
github.com/hashicorp/hil v0.0.0-20200423225030-a18a1cd20038/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE=
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/hashicorp/terraform-exec v0.13.3 h1:R6L2mNpDGSEqtLrSONN8Xth0xYwNrnEVzDz6LF/oJPk=
github.com/hashicorp/terraform-exec v0.13.3/go.mod h1:SSg6lbUsVB3DmFyCPjBPklqf6EYGX0TlQ6QTxOlikDU=
github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEXPiqaHL9r+w=
github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA=
github.com/hashicorp/terraform-json v0.10.0 h1:9syPD/Y5t+3uFjG8AiWVPu1bklJD8QB8iTCaJASc8oQ=
github.com/hashicorp/terraform-json v0.10.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE=
github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw=
github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI=
github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA=
github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.6.1 h1:OZ+Q7irJBDhb71XzMSPGJvTIW101sOmbDg5i5qV1odY=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.6.1/go.mod h1:72j8cKfs9IirGhPMXJJWLTvRUK4zATtrCOvs2avDlo8=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 h1:SuI59MqNjYDrL7EfqHX9V6P/24isgqYx/FdglwVs9bg=
github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0/go.mod h1:grseeRo9g3yNkYW09iFlV8LG78jTa1ssBgouogQg/RU=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
Expand Down
38 changes: 26 additions & 12 deletions ibm/data_source_ibm_iam_access_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"log"

"github.com/IBM-Cloud/bluemix-go/crn"
"github.com/IBM-Cloud/bluemix-go/models"
"github.com/IBM/platform-services-go-sdk/iamidentityv1"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down Expand Up @@ -130,27 +130,41 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error {
return err
}

iamClient, err := meta.(ClientSession).IAMAPI()
iamClient, err := meta.(ClientSession).IAMIdentityV1API()
if err != nil {
return err
}

boundTo := crn.New(userDetails.cloudName, userDetails.cloudType)
boundTo.ScopeType = crn.ScopeAccount
boundTo.Scope = userDetails.userAccount
start := ""
allrecs := []iamidentityv1.ServiceID{}
var pg int64 = 100
for {
listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{
AccountID: &userDetails.userAccount,
Pagesize: &pg,
}
if start != "" {
listServiceIDOptions.Pagetoken = &start
}

serviceIDs, err := iamClient.ServiceIds().List(boundTo.String())
if err != nil {
return err
serviceIDs, resp, err := iamClient.ListServiceIds(&listServiceIDOptions)
if err != nil {
return fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp)
}
start = GetNextIAM(serviceIDs.Next)
allrecs = append(allrecs, serviceIDs.Serviceids...)
if start == "" {
break
}
}

retreivedGroups, err := iamuumClient.AccessGroup().List(accountID)
if err != nil {
return fmt.Errorf("Error retrieving access groups: %s", err)
return fmt.Errorf("[ERROR] Error retrieving access groups: %s", err)
}

if len(retreivedGroups) == 0 {
return fmt.Errorf("No access group in account")
return fmt.Errorf("[ERROR] No access group in account")
}
var agName string
var matchGroups []models.AccessGroupV2
Expand All @@ -165,7 +179,7 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error {
matchGroups = retreivedGroups
}
if len(matchGroups) == 0 {
return fmt.Errorf("No Access Groups with name %s in Account", agName)
return fmt.Errorf("[ERROR] No Access Groups with name %s in Account", agName)
}

grpMap := make([]map[string]interface{}, 0, len(matchGroups))
Expand All @@ -179,7 +193,7 @@ func dataIBMIAMAccessGroupRead(d *schema.ResourceData, meta interface{}) error {
if err != nil {
log.Println("Error retrieving access group rules: ", err)
}
ibmID, serviceID := flattenMembersData(members, res, serviceIDs)
ibmID, serviceID := flattenMembersData(members, res, allrecs)

grpInstance := map[string]interface{}{
"id": grp.ID,
Expand Down
2 changes: 1 addition & 1 deletion ibm/data_source_ibm_iam_access_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccIBMIAMAccessGroupDataSource_Basic(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccCheckIBMIAMAccessGroupDataSourceConfig(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ibm_iam_access_group.accgroupdata", "access_group_name", name),
Expand Down
53 changes: 35 additions & 18 deletions ibm/data_source_ibm_iam_service_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package ibm
import (
"fmt"

"github.com/IBM-Cloud/bluemix-go/crn"
"github.com/IBM/platform-services-go-sdk/iamidentityv1"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

Expand Down Expand Up @@ -35,6 +35,7 @@ func dataSourceIBMIAMServiceID() *schema.Resource {
Description: "bound to of the serviceID",
Type: schema.TypeString,
Computed: true,
Deprecated: "bound_to attribute in service_ids list has been deprecated",
},

"crn": {
Expand Down Expand Up @@ -74,41 +75,57 @@ func dataSourceIBMIAMServiceID() *schema.Resource {
}

func dataSourceIBMIAMServiceIDRead(d *schema.ResourceData, meta interface{}) error {
iamClient, err := meta.(ClientSession).IAMAPI()
if err != nil {
return err
}

name := d.Get("name").(string)

userDetails, err := meta.(ClientSession).BluemixUserDetails()
if err != nil {
return err
}

boundTo := crn.New(userDetails.cloudName, userDetails.cloudType)
boundTo.ScopeType = crn.ScopeAccount
boundTo.Scope = userDetails.userAccount

serviceIDS, err := iamClient.ServiceIds().FindByName(boundTo.String(), name)
iamClient, err := meta.(ClientSession).IAMIdentityV1API()
if err != nil {
return err
}

if len(serviceIDS) == 0 {
return fmt.Errorf("No serviceID found with name [%s]", name)
start := ""
allrecs := []iamidentityv1.ServiceID{}
var pg int64 = 100
for {
listServiceIDOptions := iamidentityv1.ListServiceIdsOptions{
AccountID: &userDetails.userAccount,
Pagesize: &pg,
Name: &name,
}
if start != "" {
listServiceIDOptions.Pagetoken = &start
}

serviceIDs, resp, err := iamClient.ListServiceIds(&listServiceIDOptions)
if err != nil {
return fmt.Errorf("[ERROR] Error listing Service Ids %s %s", err, resp)
}
start = GetNextIAM(serviceIDs.Next)
allrecs = append(allrecs, serviceIDs.Serviceids...)
if start == "" {
break
}
}
if len(allrecs) == 0 {
return fmt.Errorf("[ERROR] No serviceID found with name [%s]", name)

}

serviceIDListMap := make([]map[string]interface{}, 0, len(serviceIDS))
for _, serviceID := range serviceIDS {
serviceIDListMap := make([]map[string]interface{}, 0, len(allrecs))
for _, serviceID := range allrecs {
l := map[string]interface{}{
"id": serviceID.UUID,
"bound_to": serviceID.BoundTo,
"version": serviceID.Version,
"id": serviceID.ID,
// "bound_to": serviceID.BoundTo,
"version": serviceID.EntityTag,
"description": serviceID.Description,
"crn": serviceID.CRN,
"locked": serviceID.Locked,
"iam_id": serviceID.IAMID,
"iam_id": serviceID.IamID,
}
serviceIDListMap = append(serviceIDListMap, l)
}
Expand Down
4 changes: 2 additions & 2 deletions ibm/data_source_ibm_iam_service_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccIBMIAMServiceIDDataSource_basic(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccCheckIBMIAMServiceIDDataSourceConfig(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ibm_iam_service_id.testacc_ds_service_id", "name", name),
Expand All @@ -37,7 +37,7 @@ func TestAccIBMIAMServiceIDDataSource_same_name(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccCheckIBMIAMServiceIDDataSourceSameName(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ibm_iam_service_id.testacc_ds_service_id", "name", name),
Expand Down
12 changes: 8 additions & 4 deletions ibm/data_source_ibm_iam_service_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

"github.com/IBM/go-sdk-core/v5/core"
"github.com/IBM/platform-services-go-sdk/iamidentityv1"
"github.com/IBM/platform-services-go-sdk/iampolicymanagementv1"
)

Expand Down Expand Up @@ -102,15 +103,18 @@ func dataSourceIBMIAMServicePolicyRead(d *schema.ResourceData, meta interface{})
if v, ok := d.GetOk("iam_service_id"); ok && v != nil {

serviceIDUUID := v.(string)
iamClient, err := meta.(ClientSession).IAMAPI()
iamClient, err := meta.(ClientSession).IAMIdentityV1API()
if err != nil {
return err
}
serviceID, err := iamClient.ServiceIds().Get(serviceIDUUID)
getServiceIDOptions := iamidentityv1.GetServiceIDOptions{
ID: &serviceIDUUID,
}
serviceID, resp, err := iamClient.GetServiceID(&getServiceIDOptions)
if err != nil {
return err
return fmt.Errorf("[ERROR] Error] Error Getting Service Id %s %s", err, resp)
}
iamID = serviceID.IAMID
iamID = *serviceID.IamID
}
if v, ok := d.GetOk("iam_id"); ok && v != nil {
iamID = v.(string)
Expand Down
4 changes: 2 additions & 2 deletions ibm/data_source_ibm_iam_service_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccIBMIAMServicePolicyDataSource_Basic(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccCheckIBMIAMServicePolicyDataSourceConfig(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ibm_iam_service_policy.testacc_ds_service_policy", "policies.#", "1"),
Expand All @@ -35,7 +35,7 @@ func TestAccIBMIAMServicePolicyDataSource_Multiple_Policies(t *testing.T) {
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
resource.TestStep{
{
Config: testAccCheckIBMIAMServicePolicyDataSourceMultiplePolicies(name),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.ibm_iam_service_policy.testacc_ds_service_policy", "policies.#", "2"),
Expand Down
Loading