@@ -199,7 +199,7 @@ func TestAccResourceAgentPolicyWithBadGlobalDataTags(t *testing.T) {
199199 Steps : []resource.TestStep {
200200 {
201201 SkipFunc : versionutils .CheckIfVersionIsUnsupported (minVersionGlobalDataTags ),
202- Config : testAccResourceAgentPolicyUpdateWithBadGlobalDataTags (policyName , true ),
202+ Config : testAccResourceAgentPolicyCreateWithBadGlobalDataTags (policyName , true ),
203203 ExpectError : regexp .MustCompile (".*Error: Invalid Attribute Combination.*" ),
204204 },
205205 },
@@ -259,7 +259,7 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" {
259259` , fmt .Sprintf ("Policy %s" , id ), skipDestroy )
260260}
261261
262- func testAccResourceAgentPolicyUpdateWithGlobalDataTags (id string , skipDestroy bool ) string {
262+ func testAccResourceAgentPolicyCreateWithBadGlobalDataTags (id string , skipDestroy bool ) string {
263263 return fmt .Sprintf (`
264264provider "elasticstack" {
265265 elasticsearch {}
@@ -269,13 +269,14 @@ provider "elasticstack" {
269269resource "elasticstack_fleet_agent_policy" "test_policy" {
270270 name = "%s"
271271 namespace = "default"
272- description = "This policy was updated "
272+ description = "This policy was not created due to bad tags "
273273 monitor_logs = false
274274 monitor_metrics = true
275275 skip_destroy = %t
276276 global_data_tags = {
277277 tag1 = {
278278 string_value = "value1a"
279+ number_value = 1.2
279280 }
280281 }
281282}
@@ -286,7 +287,7 @@ data "elasticstack_fleet_enrollment_tokens" "test_policy" {
286287` , fmt .Sprintf ("Updated Policy %s" , id ), skipDestroy )
287288}
288289
289- func testAccResourceAgentPolicyUpdateWithBadGlobalDataTags (id string , skipDestroy bool ) string {
290+ func testAccResourceAgentPolicyUpdateWithGlobalDataTags (id string , skipDestroy bool ) string {
290291 return fmt .Sprintf (`
291292provider "elasticstack" {
292293 elasticsearch {}
@@ -303,7 +304,6 @@ resource "elasticstack_fleet_agent_policy" "test_policy" {
303304 global_data_tags = {
304305 tag1 = {
305306 string_value = "value1a"
306- number_value = 1.2
307307 }
308308 }
309309}
0 commit comments