@@ -15,6 +15,7 @@ import (
15
15
"github.com/elastic/terraform-provider-elasticstack/internal/clients/elasticsearch"
16
16
"github.com/elastic/terraform-provider-elasticstack/internal/elasticsearch/security"
17
17
"github.com/elastic/terraform-provider-elasticstack/internal/models"
18
+ "github.com/elastic/terraform-provider-elasticstack/internal/utils"
18
19
"github.com/elastic/terraform-provider-elasticstack/internal/versionutils"
19
20
sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
20
21
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
@@ -41,21 +42,19 @@ func TestAccResourceSecurityApiKey(t *testing.T) {
41
42
return err
42
43
}
43
44
44
- allowRestrictedIndicesF := false
45
- allowRestrictedIndicesT := true
46
45
expectedRoleDescriptor := map [string ]models.ApiKeyRoleDescriptor {
47
46
"role-a" : {
48
47
Cluster : []string {"all" },
49
48
Indices : []models.IndexPerms {{
50
49
Names : []string {"index-a*" },
51
50
Privileges : []string {"read" },
52
- AllowRestrictedIndices : & allowRestrictedIndicesF ,
51
+ AllowRestrictedIndices : utils . Pointer ( false ) ,
53
52
}},
54
53
RemoteIndices : []models.RemoteIndexPerms {{
55
54
Clusters : []string {"*" },
56
55
Names : []string {"index-a*" },
57
56
Privileges : []string {"read" },
58
- AllowRestrictedIndices : & allowRestrictedIndicesT ,
57
+ AllowRestrictedIndices : utils . Pointer ( true ) ,
59
58
}},
60
59
},
61
60
}
@@ -204,8 +203,8 @@ resource "elasticstack_elasticsearch_security_api_key" "test" {
204
203
privileges = ["read"]
205
204
allow_restricted_indices = false
206
205
}],
207
- restriction = {
208
- workflows = [ "search_application_query"]
206
+ restriction = {
207
+ workflows = [ "search_application_query"]
209
208
}
210
209
}
211
210
})
0 commit comments