@@ -19,6 +19,7 @@ func TestAccResourceKibanaSecurityRole(t *testing.T) {
1919 roleName := sdkacctest .RandStringFromCharSet (10 , sdkacctest .CharSetAlphaNum )
2020 roleNameRemoteIndices := sdkacctest .RandStringFromCharSet (10 , sdkacctest .CharSetAlphaNum )
2121 minSupportedRemoteIndicesVersion := version .Must (version .NewSemver ("8.10.0" ))
22+ minSupportedDescriptionVersion := version .Must (version .NewVersion ("8.15.0" ))
2223
2324 resource .Test (t , resource.TestCase {
2425 PreCheck : func () { acctest .PreCheck (t ) },
@@ -48,6 +49,16 @@ func TestAccResourceKibanaSecurityRole(t *testing.T) {
4849 utils .TestCheckResourceListAttr ("elasticstack_kibana_security_role.test" , "kibana.0.spaces" , []string {"default" }),
4950 ),
5051 },
52+ {
53+ SkipFunc : versionutils .CheckIfVersionIsUnsupported (minSupportedDescriptionVersion ),
54+ Config : testAccResourceSecurityRoleWithDescription (roleName ),
55+ Check : resource .ComposeTestCheckFunc (
56+ resource .TestCheckResourceAttr ("elasticstack_kibana_security_role.test" , "name" , roleName ),
57+ resource .TestCheckNoResourceAttr ("elasticstack_kibana_security_role.test" , "kibana.0.feature.#" ),
58+ resource .TestCheckNoResourceAttr ("elasticstack_kibana_security_role.test" , "elasticsearch.0.indices.0.field_security.#" ),
59+ resource .TestCheckResourceAttr ("elasticstack_kibana_security_role.test" , "description" , "Role description" ),
60+ ),
61+ },
5162 {
5263 SkipFunc : versionutils .CheckIfVersionIsUnsupported (minSupportedRemoteIndicesVersion ),
5364 Config : testAccResourceSecurityRoleRemoteIndicesCreate (roleNameRemoteIndices ),
@@ -174,6 +185,32 @@ resource "elasticstack_kibana_security_role" "test" {
174185 ` , roleName )
175186}
176187
188+ func testAccResourceSecurityRoleWithDescription (roleName string ) string {
189+ return fmt .Sprintf (`
190+ provider "elasticstack" {
191+ elasticsearch {}
192+ kibana {}
193+ }
194+
195+ resource "elasticstack_kibana_security_role" "test" {
196+ name = "%s"
197+ description = "Role description"
198+ elasticsearch {
199+ cluster = [ "create_snapshot" ]
200+ indices {
201+ names = ["sample"]
202+ privileges = ["create", "read", "write"]
203+ }
204+ run_as = ["kibana", "elastic"]
205+ }
206+ kibana {
207+ base = [ "all" ]
208+ spaces = ["default"]
209+ }
210+ }
211+ ` , roleName )
212+ }
213+
177214func testAccResourceSecurityRoleRemoteIndicesCreate (roleName string ) string {
178215 return fmt .Sprintf (`
179216provider "elasticstack" {
0 commit comments