diff --git a/internal/provider/user_v2_resource_test.go b/internal/provider/user_v2_resource_test.go index 5f8abf1..a89a430 100644 --- a/internal/provider/user_v2_resource_test.go +++ b/internal/provider/user_v2_resource_test.go @@ -69,7 +69,7 @@ func TestAccUserV2Minimal(t *testing.T) { { Config: providerConfig + test.TestAccTestdata(t, "user_v2_resource_minimal.tf"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("conduktor_user_v2.minimal", "name", "angela.martin@dunder.mifflin.com"), + resource.TestCheckResourceAttr("conduktor_user_v2.minimal", "name", "angela.martin@dunder-mifflin.com"), resource.TestCheckResourceAttr("conduktor_user_v2.minimal", "spec.permissions.#", "0"), ), }, diff --git a/internal/schema/resource_user_v2/user_v2_resource_gen.go b/internal/schema/resource_user_v2/user_v2_resource_gen.go index 3fe1171..05e8a8e 100644 --- a/internal/schema/resource_user_v2/user_v2_resource_gen.go +++ b/internal/schema/resource_user_v2/user_v2_resource_gen.go @@ -33,7 +33,7 @@ func UserV2ResourceSchema(ctx context.Context) schema.Schema { stringplanmodifier.RequiresReplace(), }, Validators: []validator.String{ - stringvalidator.RegexMatches(regexp.MustCompile("^([\\w\\-_.]*[^.])(@\\w+)(\\.\\w+(\\.\\w+)?[^.\\W])$"), ""), + stringvalidator.RegexMatches(regexp.MustCompile("^([\\w\\-_.]*[^.])@([\\w-]+\\.)+[\\w-]{2,4}$"), ""), }, }, }, diff --git a/internal/testdata/user_v2_resource_minimal.tf b/internal/testdata/user_v2_resource_minimal.tf index e3e67ca..0161b7e 100644 --- a/internal/testdata/user_v2_resource_minimal.tf +++ b/internal/testdata/user_v2_resource_minimal.tf @@ -1,6 +1,6 @@ resource "conduktor_user_v2" "minimal" { - name = "angela.martin@dunder.mifflin.com" + name = "angela.martin@dunder-mifflin.com" spec { } } diff --git a/provider_code_spec.json b/provider_code_spec.json index 0f41e01..0a6b30c 100644 --- a/provider_code_spec.json +++ b/provider_code_spec.json @@ -98,7 +98,7 @@ "path": "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" } ], - "schema_definition": "stringvalidator.RegexMatches(regexp.MustCompile(\"^([\\\\w\\\\-_.]*[^.])(@\\\\w+)(\\\\.\\\\w+(\\\\.\\\\w+)?[^.\\\\W])$\"), \"\")" + "schema_definition": "stringvalidator.RegexMatches(regexp.MustCompile(\"^([\\\\w\\\\-_.]*[^.])@([\\\\w-]+\\\\.)+[\\\\w-]{2,4}$\"), \"\")" } } ]