From ccf02d2ba1e64b8215ab2069b4e3407585f2a044 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Mon, 8 Apr 2024 15:45:40 -0700 Subject: [PATCH 01/23] Generates configs for tagging tests from template --- internal/generate/common/generator.go | 24 +++- internal/generate/tagstests/file.tmpl | 47 ++++++++ internal/generate/tagstests/main.go | 33 +++++- .../certificate_authority_tags_gen_test.go | 87 ++++++++++++++ .../acmpca/certificate_authority_test.go | 85 -------------- .../tmpl/certificate_authority_tags.tmpl | 14 +++ .../batch/job_definition_tags_gen_test.go | 75 ++++++++++++ internal/service/batch/job_definition_test.go | 73 ------------ .../batch/scheduling_policy_tags_gen_test.go | 67 +++++++++++ .../service/batch/scheduling_policy_test.go | 65 ----------- .../testdata/tmpl/job_definition_tags.tmpl | 11 ++ .../testdata/tmpl/scheduling_policy_tags.tmpl | 9 ++ .../openid_connect_provider_tags_gen_test.go | 71 ++++++++++++ .../iam/openid_connect_provider_test.go | 69 ----------- internal/service/iam/policy_tags_gen_test.go | 107 ++++++++++++++++++ internal/service/iam/policy_test.go | 105 ----------------- internal/service/iam/role_tags_gen_test.go | 103 +++++++++++++++++ internal/service/iam/role_test.go | 101 ----------------- .../iam/service_linked_role_tags_gen_test.go | 51 +++++++++ .../service/iam/service_linked_role_test.go | 51 --------- .../tmpl/openid_connect_provider_tags.tmpl | 10 ++ .../iam/testdata/tmpl/policy_tags.tmpl | 19 ++++ .../service/iam/testdata/tmpl/role_tags.tmpl | 18 +++ .../tmpl/service_linked_role_tags.tmpl | 5 + .../service/iam/testdata/tmpl/user_tags.tmpl | 4 + .../tmpl/virtual_mfa_device_tags.tmpl | 4 + internal/service/iam/user_tags_gen_test.go | 47 ++++++++ internal/service/iam/user_test.go | 45 -------- .../iam/virtual_mfa_device_tags_gen_test.go | 47 ++++++++ .../service/iam/virtual_mfa_device_test.go | 45 -------- internal/service/xray/group_tags_gen_test.go | 51 +++++++++ internal/service/xray/group_test.go | 49 -------- .../xray/sampling_rule_tags_gen_test.go | 103 +++++++++++++++++ internal/service/xray/sampling_rule_test.go | 101 ----------------- .../xray/testdata/tmpl/group_tags.tmpl | 5 + .../testdata/tmpl/sampling_rule_tags.tmpl | 18 +++ 36 files changed, 1025 insertions(+), 794 deletions(-) create mode 100644 internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl create mode 100644 internal/service/batch/testdata/tmpl/job_definition_tags.tmpl create mode 100644 internal/service/batch/testdata/tmpl/scheduling_policy_tags.tmpl create mode 100644 internal/service/iam/testdata/tmpl/openid_connect_provider_tags.tmpl create mode 100644 internal/service/iam/testdata/tmpl/policy_tags.tmpl create mode 100644 internal/service/iam/testdata/tmpl/role_tags.tmpl create mode 100644 internal/service/iam/testdata/tmpl/service_linked_role_tags.tmpl create mode 100644 internal/service/iam/testdata/tmpl/user_tags.tmpl create mode 100644 internal/service/iam/testdata/tmpl/virtual_mfa_device_tags.tmpl create mode 100644 internal/service/xray/testdata/tmpl/group_tags.tmpl create mode 100644 internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl diff --git a/internal/generate/common/generator.go b/internal/generate/common/generator.go index 8c5cc5c127a..5a4698edf42 100644 --- a/internal/generate/common/generator.go +++ b/internal/generate/common/generator.go @@ -57,6 +57,7 @@ type Destination interface { Write() error WriteBytes(body []byte) error WriteTemplate(templateName, templateBody string, templateData any) error + WriteTemplateSet(templates *template.Template, templateData any) error } func (g *Generator) NewGoFileDestination(filename string) Destination { @@ -142,8 +143,7 @@ func (d *baseDestination) WriteTemplate(templateName, templateBody string, templ } } - _, err = d.buffer.Write(body) - return err + return d.WriteBytes(body) } func parseTemplate(templateName, templateBody string, templateData any) ([]byte, error) { @@ -156,8 +156,12 @@ func parseTemplate(templateName, templateBody string, templateData any) ([]byte, return nil, fmt.Errorf("parsing function template: %w", err) } + return executeTemplate(tmpl, templateData) +} + +func executeTemplate(tmpl *template.Template, templateData any) ([]byte, error) { var buffer bytes.Buffer - err = tmpl.Execute(&buffer, templateData) + err := tmpl.Execute(&buffer, templateData) if err != nil { return nil, fmt.Errorf("executing template: %w", err) @@ -165,3 +169,17 @@ func parseTemplate(templateName, templateBody string, templateData any) ([]byte, return buffer.Bytes(), nil } + +func (d *fileDestination) WriteTemplateSet(templates *template.Template, templateData any) error { + unformattedBody, err := executeTemplate(templates, templateData) + if err != nil { + return err + } + + body, err := d.formatter(unformattedBody) + if err != nil { + return fmt.Errorf("formatting parsed template:\n%s\n%w", unformattedBody, err) + } + + return d.WriteBytes(body) +} diff --git a/internal/generate/tagstests/file.tmpl b/internal/generate/tagstests/file.tmpl index 972794fa2a9..82e63e924c9 100644 --- a/internal/generate/tagstests/file.tmpl +++ b/internal/generate/tagstests/file.tmpl @@ -37,9 +37,30 @@ {{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ProviderNameUpper }}{{ .Name }} {{- end }} +{{ define "tags" }} +{{ if eq . "tags0" -}} +{{- else if eq . "tags1" }} + tags = { + %[2]q = %[3]q + } +{{- else if eq . "tags2" }} + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +{{- else if eq . "tagsNull" }} + tags = { + %[2]q = null + } +{{- end -}} +{{ end }} + package {{ .ProviderPackage }}_test import ( + {{ if .GenerateConfig -}} + "fmt" + {{- end }} "testing" {{ if .ExistsTypePackage -}} @@ -589,3 +610,29 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( }, }) } + +{{ if .GenerateConfig }} +func testAcc{{ .Name }}Config_tags0(rName string) string { + return fmt.Sprintf(` +{{ template "config" "tags0" -}} +`, rName) +} + +func testAcc{{ .Name }}Config_tags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +{{ template "config" "tags1" -}} +`, rName, tagKey1, tagValue1) +} + +func testAcc{{ .Name }}Config_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +{{ template "config" "tags2" -}} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAcc{{ .Name }}Config_tagsNull(rName, tagKey1 string) string { + return fmt.Sprintf(` +{{ template "config" "tagsNull" -}} +`, rName, tagKey1) +} +{{ end }} diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 68d85fe0d15..824a14daadd 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -14,9 +14,11 @@ import ( "go/parser" "go/token" "os" + "path" "path/filepath" "strconv" "strings" + "text/template" "github.com/YakDriver/regexache" "github.com/hashicorp/terraform-provider-aws/internal/generate/common" @@ -81,8 +83,34 @@ func main() { foo.ProviderNameUpper = serviceRecord.ProviderNameUpper() foo.ProviderPackage = servicePackage - if err := d.WriteTemplate("taggingtests", tmpl, foo); err != nil { - g.Fatalf("error generating XXX service package data: %s", err) + templates, err := template.New("taggingtests").Parse(tmpl) + if err != nil { + g.Fatalf("parsing base template: %w", err) + } + + configTmplFile := path.Join("testdata", "tmpl", fmt.Sprintf("%s_tags.tmpl", sourceName)) + var configTmpl string + if _, err := os.Stat(configTmplFile); err == nil { + b, err := os.ReadFile(configTmplFile) + if err != nil { + g.Fatalf("reading %q: %w", configTmplFile, err) + } + configTmpl = string(b) + foo.GenerateConfig = true + } else if errors.Is(err, os.ErrNotExist) { + // TODO: This will be an error when composed configurations are implemented. + g.Warnf("no tags template found for %s at %q", sourceName, configTmplFile) + } else { + g.Fatalf("opening config template %q: %w", configTmplFile, err) + } + + _, err = templates.New("config").Parse(configTmpl) + if err != nil { + g.Fatalf("parsing config template %q: %w", configTmplFile, err) + } + + if err := d.WriteTemplateSet(templates, foo); err != nil { + g.Fatalf("error generating %q service package data: %s", servicePackage, err) } if err := d.Write(); err != nil { @@ -113,6 +141,7 @@ type ResourceDatum struct { PreCheck bool SkipEmptyTags bool // TODO: Remove when we have a strategy for resources that have a minimum tag value length of 1 GoImports []goImport + GenerateConfig bool } type goImport struct { diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index 2481eadf4f9..4364940c80a 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -3,6 +3,7 @@ package acmpca_test import ( + "fmt" "testing" "github.com/aws/aws-sdk-go-v2/service/acmpca/types" @@ -768,3 +769,89 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour }, }) } + +func testAccCertificateAuthorityConfig_tags0(rName string) string { + return fmt.Sprintf(` +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = %[1]q + } + } + +} +`, rName) +} + +func testAccCertificateAuthorityConfig_tags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = %[1]q + } + } + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccCertificateAuthorityConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = %[1]q + } + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccCertificateAuthorityConfig_tagsNull(rName, tagKey1 string) string { + return fmt.Sprintf(` +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = %[1]q + } + } + + tags = { + %[2]q = null + } +} +`, rName, tagKey1) +} diff --git a/internal/service/acmpca/certificate_authority_test.go b/internal/service/acmpca/certificate_authority_test.go index b1b55db9c8c..c4400e8a178 100644 --- a/internal/service/acmpca/certificate_authority_test.go +++ b/internal/service/acmpca/certificate_authority_test.go @@ -1091,91 +1091,6 @@ resource "aws_s3_bucket_policy" "test" { `, rName) } -func testAccCertificateAuthorityConfig_tags0(commonName string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } -} -`, commonName) -} - -func testAccCertificateAuthorityConfig_tags1(commonName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - - tags = { - %[2]q = %[3]q - } -} -`, commonName, tagKey1, tagValue1) -} - -func testAccCertificateAuthorityConfig_tags2(commonName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, commonName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccCertificateAuthorityConfig_tagsNull(commonName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - - tags = { - %[2]q = null - } -} -`, commonName, tagKey1) -} - func testAccCertificateAuthorityConfig_keyStorageSecurityStandard(commonName, certificateAuthorityType, keyStorageSecurityStandard string) string { return fmt.Sprintf(` resource "aws_acmpca_certificate_authority" "test" { diff --git a/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl b/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl new file mode 100644 index 00000000000..f9e0b0d47e9 --- /dev/null +++ b/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl @@ -0,0 +1,14 @@ +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = %[1]q + } + } +{{- template "tags" . }} +} diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index c7125793794..52aa85b9e9b 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -3,6 +3,7 @@ package batch_test import ( + "fmt" "testing" "github.com/aws/aws-sdk-go/service/batch" @@ -769,3 +770,77 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t }, }) } + +func testAccJobDefinitionConfig_tags0(rName string) string { + return fmt.Sprintf(` +resource "aws_batch_job_definition" "test" { + container_properties = jsonencode({ + command = ["echo", "test"] + image = "busybox" + memory = 128 + vcpus = 1 + }) + name = %[1]q + type = "container" + +} +`, rName) +} + +func testAccJobDefinitionConfig_tags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_batch_job_definition" "test" { + container_properties = jsonencode({ + command = ["echo", "test"] + image = "busybox" + memory = 128 + vcpus = 1 + }) + name = %[1]q + type = "container" + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccJobDefinitionConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_batch_job_definition" "test" { + container_properties = jsonencode({ + command = ["echo", "test"] + image = "busybox" + memory = 128 + vcpus = 1 + }) + name = %[1]q + type = "container" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccJobDefinitionConfig_tagsNull(rName, tagKey1 string) string { + return fmt.Sprintf(` +resource "aws_batch_job_definition" "test" { + container_properties = jsonencode({ + command = ["echo", "test"] + image = "busybox" + memory = 128 + vcpus = 1 + }) + name = %[1]q + type = "container" + + tags = { + %[2]q = null + } +} +`, rName, tagKey1) +} diff --git a/internal/service/batch/job_definition_test.go b/internal/service/batch/job_definition_test.go index 8eca5f35a28..6f696b708c1 100644 --- a/internal/service/batch/job_definition_test.go +++ b/internal/service/batch/job_definition_test.go @@ -1226,79 +1226,6 @@ CONTAINER_PROPERTIES `, rName) } -func testAccJobDefinitionConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" -} -`, rName) -} - -func testAccJobDefinitionConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccJobDefinitionConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccJobDefinitionConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} - func testAccJobDefinitionConfig_propagateTags(rName string) string { return fmt.Sprintf(` resource "aws_batch_job_definition" "test" { diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 24a00d4dcfc..481dea3ebe6 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -3,6 +3,7 @@ package batch_test import ( + "fmt" "testing" "github.com/aws/aws-sdk-go/service/batch" @@ -691,3 +692,69 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag }, }) } + +func testAccSchedulingPolicyConfig_tags0(rName string) string { + return fmt.Sprintf(` +resource "aws_batch_scheduling_policy" "test" { + name = %[1]q + + fair_share_policy { + compute_reservation = 0 + share_decay_seconds = 0 + } + +} +`, rName) +} + +func testAccSchedulingPolicyConfig_tags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_batch_scheduling_policy" "test" { + name = %[1]q + + fair_share_policy { + compute_reservation = 0 + share_decay_seconds = 0 + } + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccSchedulingPolicyConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_batch_scheduling_policy" "test" { + name = %[1]q + + fair_share_policy { + compute_reservation = 0 + share_decay_seconds = 0 + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccSchedulingPolicyConfig_tagsNull(rName, tagKey1 string) string { + return fmt.Sprintf(` +resource "aws_batch_scheduling_policy" "test" { + name = %[1]q + + fair_share_policy { + compute_reservation = 0 + share_decay_seconds = 0 + } + + tags = { + %[2]q = null + } +} +`, rName, tagKey1) +} diff --git a/internal/service/batch/scheduling_policy_test.go b/internal/service/batch/scheduling_policy_test.go index 3b8174a6581..bf0161cf9e1 100644 --- a/internal/service/batch/scheduling_policy_test.go +++ b/internal/service/batch/scheduling_policy_test.go @@ -188,68 +188,3 @@ resource "aws_batch_scheduling_policy" "test" { } `, rName) } - -func testAccSchedulingPolicyConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } -} -`, rName) -} - -func testAccSchedulingPolicyConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccSchedulingPolicyConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccSchedulingPolicyConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/batch/testdata/tmpl/job_definition_tags.tmpl b/internal/service/batch/testdata/tmpl/job_definition_tags.tmpl new file mode 100644 index 00000000000..2e1ecdce055 --- /dev/null +++ b/internal/service/batch/testdata/tmpl/job_definition_tags.tmpl @@ -0,0 +1,11 @@ +resource "aws_batch_job_definition" "test" { + container_properties = jsonencode({ + command = ["echo", "test"] + image = "busybox" + memory = 128 + vcpus = 1 + }) + name = %[1]q + type = "container" +{{- template "tags" . }} +} diff --git a/internal/service/batch/testdata/tmpl/scheduling_policy_tags.tmpl b/internal/service/batch/testdata/tmpl/scheduling_policy_tags.tmpl new file mode 100644 index 00000000000..bc0434ad6a5 --- /dev/null +++ b/internal/service/batch/testdata/tmpl/scheduling_policy_tags.tmpl @@ -0,0 +1,9 @@ +resource "aws_batch_scheduling_policy" "test" { + name = %[1]q + + fair_share_policy { + compute_reservation = 0 + share_decay_seconds = 0 + } +{{- template "tags" . }} +} diff --git a/internal/service/iam/openid_connect_provider_tags_gen_test.go b/internal/service/iam/openid_connect_provider_tags_gen_test.go index 69f6d944111..6138a7d528f 100644 --- a/internal/service/iam/openid_connect_provider_tags_gen_test.go +++ b/internal/service/iam/openid_connect_provider_tags_gen_test.go @@ -3,6 +3,7 @@ package iam_test import ( + "fmt" "testing" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" @@ -676,3 +677,73 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource }, }) } + +func testAccOpenIDConnectProviderConfig_tags0(rName string) string { + return fmt.Sprintf(` +resource "aws_iam_openid_connect_provider" "test" { + url = "https://accounts.testle.com/%[1]s" + + client_id_list = [ + "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", + ] + + thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] + +} +`, rName) +} + +func testAccOpenIDConnectProviderConfig_tags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_iam_openid_connect_provider" "test" { + url = "https://accounts.testle.com/%[1]s" + + client_id_list = [ + "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", + ] + + thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccOpenIDConnectProviderConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_iam_openid_connect_provider" "test" { + url = "https://accounts.testle.com/%[1]s" + + client_id_list = [ + "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", + ] + + thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccOpenIDConnectProviderConfig_tagsNull(rName, tagKey1 string) string { + return fmt.Sprintf(` +resource "aws_iam_openid_connect_provider" "test" { + url = "https://accounts.testle.com/%[1]s" + + client_id_list = [ + "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", + ] + + thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] + + tags = { + %[2]q = null + } +} +`, rName, tagKey1) +} diff --git a/internal/service/iam/openid_connect_provider_test.go b/internal/service/iam/openid_connect_provider_test.go index 9d20cbe4d9f..1118f866abe 100644 --- a/internal/service/iam/openid_connect_provider_test.go +++ b/internal/service/iam/openid_connect_provider_test.go @@ -191,75 +191,6 @@ resource "aws_iam_openid_connect_provider" "test" { `, rName) } -func testAccOpenIDConnectProviderConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] -} -`, rName) -} - -func testAccOpenIDConnectProviderConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccOpenIDConnectProviderConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccOpenIDConnectProviderConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} - func testAccOpenIDConnectProviderConfig_clientIDList_first(rName string) string { return fmt.Sprintf(` resource "aws_iam_openid_connect_provider" "test" { diff --git a/internal/service/iam/policy_tags_gen_test.go b/internal/service/iam/policy_tags_gen_test.go index c6bb182ddb9..edd96f01224 100644 --- a/internal/service/iam/policy_tags_gen_test.go +++ b/internal/service/iam/policy_tags_gen_test.go @@ -3,6 +3,7 @@ package iam_test import ( + "fmt" "testing" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -691,3 +692,109 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. }, }) } + +func testAccPolicyConfig_tags0(rName string) string { + return fmt.Sprintf(` +resource "aws_iam_policy" "test" { + name = %q + + policy = < Date: Thu, 18 Apr 2024 11:00:40 -0700 Subject: [PATCH 02/23] Updates tag tests for `xray` --- internal/generate/common/generator.go | 32 +- internal/generate/tagstests/file.tmpl | 638 ------------ internal/generate/tagstests/main.go | 72 +- internal/generate/tagstests/test.go.tmpl | 939 ++++++++++++++++++ internal/generate/tagstests/test.tf.tmpl | 104 ++ internal/service/xray/group_tags_gen_test.go | 582 +++++++---- .../xray/sampling_rule_tags_gen_test.go | 634 ++++++++---- .../xray/testdata/Group/tags0_default1_gen.tf | 33 + .../xray/testdata/Group/tags0_default2_gen.tf | 45 + .../service/xray/testdata/Group/tags0_gen.tf | 16 + .../xray/testdata/Group/tags1_default1_gen.tf | 46 + .../service/xray/testdata/Group/tags1_gen.tf | 29 + .../xray/testdata/Group/tags2_default1_gen.tf | 57 ++ .../xray/testdata/Group/tags2_default2_gen.tf | 69 ++ .../service/xray/testdata/Group/tags2_gen.tf | 40 + .../testdata/Group/tagsNull_default1_gen.tf | 41 + .../xray/testdata/Group/tagsNull_gen.tf | 24 + .../SamplingRule/tags0_default1_gen.tf | 46 + .../SamplingRule/tags0_default2_gen.tf | 58 ++ .../xray/testdata/SamplingRule/tags0_gen.tf | 29 + .../SamplingRule/tags1_default1_gen.tf | 59 ++ .../xray/testdata/SamplingRule/tags1_gen.tf | 42 + .../SamplingRule/tags2_default1_gen.tf | 70 ++ .../SamplingRule/tags2_default2_gen.tf | 82 ++ .../xray/testdata/SamplingRule/tags2_gen.tf | 53 + .../SamplingRule/tagsNull_default1_gen.tf | 54 + .../testdata/SamplingRule/tagsNull_gen.tf | 37 + .../xray/testdata/tmpl/group_tags.tmpl | 2 +- .../testdata/tmpl/sampling_rule_tags.tmpl | 2 +- 29 files changed, 2896 insertions(+), 1039 deletions(-) delete mode 100644 internal/generate/tagstests/file.tmpl create mode 100644 internal/generate/tagstests/test.go.tmpl create mode 100644 internal/generate/tagstests/test.tf.tmpl create mode 100644 internal/service/xray/testdata/Group/tags0_default1_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags0_default2_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags0_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags1_default1_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags1_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags2_default1_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags2_default2_gen.tf create mode 100644 internal/service/xray/testdata/Group/tags2_gen.tf create mode 100644 internal/service/xray/testdata/Group/tagsNull_default1_gen.tf create mode 100644 internal/service/xray/testdata/Group/tagsNull_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags0_default1_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags0_default2_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags0_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags1_default1_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags1_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags2_default1_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags2_default2_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tags2_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf create mode 100644 internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf diff --git a/internal/generate/common/generator.go b/internal/generate/common/generator.go index 5a4698edf42..1754e78fa2b 100644 --- a/internal/generate/common/generator.go +++ b/internal/generate/common/generator.go @@ -134,13 +134,9 @@ func (d *baseDestination) WriteTemplate(templateName, templateBody string, templ return err } - if d.formatter != nil { - unformattedBody := body - body, err = d.formatter(unformattedBody) - - if err != nil { - return fmt.Errorf("formatting parsed template:\n%s\n%w", unformattedBody, err) - } + body, err = d.format(body) + if err != nil { + return err } return d.WriteBytes(body) @@ -170,16 +166,30 @@ func executeTemplate(tmpl *template.Template, templateData any) ([]byte, error) return buffer.Bytes(), nil } -func (d *fileDestination) WriteTemplateSet(templates *template.Template, templateData any) error { - unformattedBody, err := executeTemplate(templates, templateData) +func (d *baseDestination) WriteTemplateSet(templates *template.Template, templateData any) error { + body, err := executeTemplate(templates, templateData) if err != nil { return err } - body, err := d.formatter(unformattedBody) + body, err = d.format(body) if err != nil { - return fmt.Errorf("formatting parsed template:\n%s\n%w", unformattedBody, err) + return err } return d.WriteBytes(body) } + +func (d *baseDestination) format(body []byte) ([]byte, error) { + if d.formatter == nil { + return body, nil + } + + unformattedBody := body + body, err := d.formatter(unformattedBody) + if err != nil { + return nil, fmt.Errorf("formatting parsed template:\n%s\n%w", unformattedBody, err) + } + + return body, nil +} diff --git a/internal/generate/tagstests/file.tmpl b/internal/generate/tagstests/file.tmpl deleted file mode 100644 index 82e63e924c9..00000000000 --- a/internal/generate/tagstests/file.tmpl +++ /dev/null @@ -1,638 +0,0 @@ -// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. - -{{ define "Init" }} - ctx := acctest.Context(t) - {{ if .ExistsTypeName -}} - var v {{ .ExistsTypeName }} - {{ end -}} - resourceName := "{{ .TypeName}}.test" - {{ if .Generator -}} - rName := {{ .Generator }} - {{ else -}} - rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - {{- end }} -{{ end }} - -{{ define "TestCaseSetup" -}} - PreCheck: func() { acctest.PreCheck(ctx, t){{ if .PreCheck }}; testAccPreCheck(ctx, t){{ end }} }, - ErrorCheck: acctest.ErrorCheck(t, names.{{ .ProviderNameUpper }}ServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheck{{ .Name }}Destroy(ctx), -{{- end }} - -{{ define "Import" }} -{ - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - {{ if gt (len .) 0 -}} - ImportStateVerifyIgnore: []string{ - {{ range $i, $v := . }}"{{ $v }}",{{ end }} - }, - {{- end }} -}, -{{ end }} - -{{ define "testname" -}} -{{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ProviderNameUpper }}{{ .Name }} -{{- end }} - -{{ define "tags" }} -{{ if eq . "tags0" -}} -{{- else if eq . "tags1" }} - tags = { - %[2]q = %[3]q - } -{{- else if eq . "tags2" }} - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -{{- else if eq . "tagsNull" }} - tags = { - %[2]q = null - } -{{- end -}} -{{ end }} - -package {{ .ProviderPackage }}_test - -import ( - {{ if .GenerateConfig -}} - "fmt" - {{- end }} - "testing" - - {{ if .ExistsTypePackage -}} - "{{ .ExistsTypePackage }}" - {{- end }} - {{- if eq .Generator "" }} - sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" - {{- end }} - "github.com/hashicorp/terraform-plugin-testing/helper/resource" - "github.com/hashicorp/terraform-provider-aws/internal/acctest" - "github.com/hashicorp/terraform-provider-aws/names" - {{ range .GoImports -}} - {{ if .Alias }}{{ .Alias }} {{ end }}"{{ .Path }}" - {{ end }} -) - -{{ if .Serialize }} -func {{ template "testname" . }}_tagsSerial(t *testing.T) { - t.Helper() - - t.Run("basic", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags) - t.Run("null", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_null) - t.Run("AddOnUpdate", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_AddOnUpdate) - t.Run("EmptyTag_OnCreate", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_EmptyTag_OnCreate) - t.Run("EmptyTag_OnUpdate_Add", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_EmptyTag_OnUpdate_Add) - t.Run("EmptyTag_OnUpdate_Replace", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_EmptyTag_OnUpdate_Replace) - t.Run("DefaultTags_providerOnly", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_providerOnly) - t.Run("DefaultTags_nonOverlapping", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_nonOverlapping) - t.Run("DefaultTags_overlapping", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_overlapping) - t.Run("DefaultTags_updateToProviderOnly", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_updateToProviderOnly) - t.Run("DefaultTags_updateToResourceOnly", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_updateToResourceOnly) - t.Run("DefaultTags_emptyResourceTag", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_emptyResourceTag) - t.Run("DefaultTags_nullOverlappingResourceTag", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_nullOverlappingResourceTag) - t.Run("DefaultTags_nullNonOverlappingResourceTag", testAcc{{ .ProviderNameUpper }}{{ .Name }}_tags_DefaultTags_nullNonOverlappingResourceTag) -} -{{ end }} - -func {{ template "testname" . }}_tags(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: testAcc{{ .Name }}Config_tags2(rName, "key1", "value1updated", "key2", "value2"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), - resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key2", "value2"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: testAcc{{ .Name }}Config_tags0(rName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_null(t *testing.T) { -{{- if eq .Implementation "framework" }} - t.Skip("Tags with null values are not correctly handled with the Plugin Framework") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tagsNull(rName, "key1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: testAcc{{ .Name }}Config_tags0(rName), - PlanOnly: true, - ExpectNonEmptyPlan: false, - }, - }, - }) -} - -func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tags0(rName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - ), - }, - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { -{{- if .SkipEmptyTags }} - t.Skip("Resource {{ .Name }} does not support empty tags") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", ""), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: testAcc{{ .Name }}Config_tags0(rName), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { -{{- if .SkipEmptyTags }} - t.Skip("Resource {{ .Name }} does not support empty tags") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - ), - }, - { - Config: testAcc{{ .Name }}Config_tags2(rName, "key1", "value1", "key2", ""), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - resource.TestCheckResourceAttr(resourceName, "tags.key2", ""), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { -{{- if .SkipEmptyTags }} - t.Skip("Resource {{ .Name }} does not support empty tags") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - ), - }, - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", ""), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1updated"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key2", "value2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key2", "value2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAcc{{ .Name }}Config_tags1(rName, "resourcekey1", "resourcevalue1"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAcc{{ .Name }}Config_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1updated"), - resource.TestCheckResourceAttr(resourceName, "tags.resourcekey2", "resourcevalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "3"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1updated"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1updated"), - resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey2", "resourcevalue2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAcc{{ .Name }}Config_tags1(rName, "overlapkey1", "resourcevalue1"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAcc{{ .Name }}Config_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey2", "resourcevalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey2", "resourcevalue2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAcc{{ .Name }}Config_tags1(rName, "overlapkey1", "resourcevalue2"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue2"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue2"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testing.T) { - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAcc{{ .Name }}Config_tags0(rName), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - { - Config: testAcc{{ .Name }}Config_tags1(rName, "key1", "value1"), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) { -{{- if .SkipEmptyTags }} - t.Skip("Resource {{ .Name }} does not support empty tags") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAcc{{ .Name }}Config_tags1(rName, "key1", ""), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", ""), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { -{{- if eq .Implementation "framework" }} - t.Skip("Tags with null values are not correctly handled with the Plugin Framework") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAcc{{ .Name }}Config_tagsNull(rName, "key1"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "providervalue1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { -{{- if eq .Implementation "framework" }} - t.Skip("Tags with null values are not correctly handled with the Plugin Framework") -{{ end }} - {{- template "Init" . }} - - resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ - {{ template "TestCaseSetup" . }} - Steps: []resource.TestStep{ - { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAcc{{ .Name }}Config_tagsNull(rName, "resourcekey1"), - ), - Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), - ), - }, - {{- template "Import" .ImportIgnore -}} - }, - }) -} - -{{ if .GenerateConfig }} -func testAcc{{ .Name }}Config_tags0(rName string) string { - return fmt.Sprintf(` -{{ template "config" "tags0" -}} -`, rName) -} - -func testAcc{{ .Name }}Config_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -{{ template "config" "tags1" -}} -`, rName, tagKey1, tagValue1) -} - -func testAcc{{ .Name }}Config_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -{{ template "config" "tags2" -}} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAcc{{ .Name }}Config_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -{{ template "config" "tagsNull" -}} -`, rName, tagKey1) -} -{{ end }} diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 824a14daadd..8a53cfe898c 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -83,9 +83,9 @@ func main() { foo.ProviderNameUpper = serviceRecord.ProviderNameUpper() foo.ProviderPackage = servicePackage - templates, err := template.New("taggingtests").Parse(tmpl) + templates, err := template.New("taggingtests").Parse(testGoTmpl) if err != nil { - g.Fatalf("parsing base template: %w", err) + g.Fatalf("parsing base Go test template: %w", err) } configTmplFile := path.Join("testdata", "tmpl", fmt.Sprintf("%s_tags.tmpl", sourceName)) @@ -116,6 +116,25 @@ func main() { if err := d.Write(); err != nil { g.Fatalf("generating file (%s): %s", filename, err) } + + if foo.GenerateConfig { + testDirPath := path.Join("testdata", foo.Name) + err = os.MkdirAll(testDirPath, 0755) + if err != nil { + g.Fatalf("creating test directory %q: %w", testDirPath, err) + } + + generateTestConfig(g, testDirPath, "tags0", 0, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags1", 0, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags2", 0, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tagsNull", 0, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags0", 1, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags0", 2, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags1", 1, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags2", 1, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags2", 2, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tagsNull", 1, configTmplFile, configTmpl) + } } } @@ -142,6 +161,7 @@ type ResourceDatum struct { SkipEmptyTags bool // TODO: Remove when we have a strategy for resources that have a minimum tag value length of 1 GoImports []goImport GenerateConfig bool + Tags string } type goImport struct { @@ -149,8 +169,17 @@ type goImport struct { Alias string } -//go:embed file.tmpl -var tmpl string +type ConfigDatum struct { + Name string + Tags string + DefaultTags int +} + +//go:embed test.go.tmpl +var testGoTmpl string + +//go:embed test.tf.tmpl +var testTfTmpl string // Annotation processing. var ( @@ -339,3 +368,38 @@ func (v *visitor) Visit(node ast.Node) ast.Visitor { return v } + +func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount int, configTmplFile, configTmpl string) { + var fileName string + if defaultCount > 0 { + fileName = fmt.Sprintf("%s_default%d_gen.tf", test, defaultCount) + } else { + fileName = fmt.Sprintf("%s_gen.tf", test) + } + + mainPath := path.Join(dirPath, fileName) + tf := g.NewUnformattedFileDestination(mainPath) + + tfTemplates, err := template.New("taggingtests").Parse(testTfTmpl) + if err != nil { + g.Fatalf("parsing base Terraform config template: %s", err) + } + + _, err = tfTemplates.New("body").Parse(configTmpl) + if err != nil { + g.Fatalf("parsing config template %q: %s", configTmplFile, err) + } + + configData := ConfigDatum{ + // Name: foo.Name, + Tags: test, + DefaultTags: defaultCount, + } + if err := tf.WriteTemplateSet(tfTemplates, configData); err != nil { + g.Fatalf("error generating Terraform file %q: %s", mainPath, err) + } + + if err := tf.Write(); err != nil { + g.Fatalf("generating file (%s): %s", mainPath, err) + } +} diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl new file mode 100644 index 00000000000..a50d150032a --- /dev/null +++ b/internal/generate/tagstests/test.go.tmpl @@ -0,0 +1,939 @@ +// Code generated by internal/generate/tagstests/main.go; DO NOT EDIT. + +{{ define "Init" }} + ctx := acctest.Context(t) + {{ if .ExistsTypeName -}} + var v {{ .ExistsTypeName }} + {{ end -}} + resourceName := "{{ .TypeName}}.test" + {{ if .Generator -}} + rName := {{ .Generator }} + {{ else -}} + rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) + {{- end }} +{{ end }} + +{{ define "TestCaseSetup" -}} +{{ template "TestCaseSetupNoProviders" . }} + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, +{{- end }} + +{{ define "TestCaseSetupNoProviders" -}} + PreCheck: func() { acctest.PreCheck(ctx, t){{ if .PreCheck }}; testAccPreCheck(ctx, t){{ end }} }, + ErrorCheck: acctest.ErrorCheck(t, names.{{ .ProviderNameUpper }}ServiceID), + CheckDestroy: testAccCheck{{ .Name }}Destroy(ctx), +{{- end }} + +{{ define "ImportBody" }} + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + {{ if gt (len .) 0 -}} + ImportStateVerifyIgnore: []string{ + {{ range $i, $v := . }}"{{ $v }}",{{ end }} + }, + {{- end }} +{{ end }} + +{{ define "testname" -}} +{{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ProviderNameUpper }}{{ .Name }} +{{- end }} + +package {{ .ProviderPackage }}_test + +import ( + "testing" + + {{ if .ExistsTypePackage -}} + "{{ .ExistsTypePackage }}" + {{- end }} + {{- if eq .Generator "" }} + "github.com/hashicorp/terraform-plugin-testing/config" + sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" + {{- end }} + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-provider-aws/internal/acctest" + "github.com/hashicorp/terraform-provider-aws/names" +) + +{{ if .Serialize }} +func {{ template "testname" . }}_tagsSerial(t *testing.T) { + t.Helper() + + t.Run("basic", {{ template "testname" . }}_tags) + t.Run("null", {{ template "testname" . }}_tags_null) + t.Run("AddOnUpdate", {{ template "testname" . }}_tags_AddOnUpdate) + t.Run("EmptyTag_OnCreate", {{ template "testname" . }}_tags_EmptyTag_OnCreate) + t.Run("EmptyTag_OnUpdate_Add", {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add) + t.Run("EmptyTag_OnUpdate_Replace", {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace) + t.Run("DefaultTags_providerOnly", {{ template "testname" . }}_tags_DefaultTags_providerOnly) + t.Run("DefaultTags_nonOverlapping", {{ template "testname" . }}_tags_DefaultTags_nonOverlapping) + t.Run("DefaultTags_overlapping", {{ template "testname" . }}_tags_DefaultTags_overlapping) + t.Run("DefaultTags_updateToProviderOnly", {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly) + t.Run("DefaultTags_updateToResourceOnly", {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly) + t.Run("DefaultTags_emptyResourceTag", {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag) + t.Run("DefaultTags_nullOverlappingResourceTag", {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag) + t.Run("DefaultTags_nullNonOverlappingResourceTag", {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag) +} +{{ end }} + +func {{ template "testname" . }}_tags(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetup" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_null(t *testing.T) { +{{- if eq .Implementation "framework" }} + t.Skip("Tags with null values are not correctly handled with the Plugin Framework") +{{ end }} + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetup" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + PlanOnly: true, + ExpectNonEmptyPlan: false, + }, + }, + }) +} + +func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetup" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetup" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetup" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", ""), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetup" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key2", "value2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key2", "value2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey2", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1updated"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1updated"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey2", "resourcevalue2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey2", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey2", "resourcevalue2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue2"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) { + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", ""), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { +{{- if eq .Implementation "framework" }} + t.Skip("Tags with null values are not correctly handled with the Plugin Framework") +{{ end }} + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "providervalue1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} + +func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) { +{{- if eq .Implementation "framework" }} + t.Skip("Tags with null values are not correctly handled with the Plugin Framework") +{{ end }} + {{- template "Init" . }} + + resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ + {{ template "TestCaseSetupNoProviders" . }} + Steps: []resource.TestStep{ + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + ), + }, + { + ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, + {{- template "ImportBody" .ImportIgnore -}} + }, + }, + }) +} diff --git a/internal/generate/tagstests/test.tf.tmpl b/internal/generate/tagstests/test.tf.tmpl new file mode 100644 index 00000000000..d4cae794688 --- /dev/null +++ b/internal/generate/tagstests/test.tf.tmpl @@ -0,0 +1,104 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +{{ define "tags" }} +{{ if eq . "tags0" -}} +{{- else if eq . "tags1" }} + tags = { + (var.tagKey1) = var.tagValue1 + } +{{- else if eq . "tags2" }} + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +{{- else if eq . "tagsNull" }} + tags = { + (var.tagKey1) = null + } +{{- end -}} +{{ end -}} + +{{- if gt .DefaultTags 0 -}} +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 +{{- if gt .DefaultTags 1 }} + (var.providerTagKey2) = var.providerTagValue2 +{{- end }} + } + } +} + +{{ end }} + +{{- block "body" .Tags }} +Missing block "body" in template +{{ end }} + +variable "rName" { + type = string + nullable = false +} +{{ if eq .Tags "tags0" -}} +{{ else if eq .Tags "tags1" }} +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} +{{ else if eq .Tags "tags2" }} +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} +{{ else if eq .Tags "tagsNull" }} +variable "tagKey1" { + type = string + nullable = false +} +{{ end }} + +{{ if gt .DefaultTags 0 -}} +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} +{{ if gt .DefaultTags 1 }} + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} +{{ end -}} +{{ end -}} diff --git a/internal/service/xray/group_tags_gen_test.go b/internal/service/xray/group_tags_gen_test.go index 8ac362c2a0c..49d1dc3d30d 100644 --- a/internal/service/xray/group_tags_gen_test.go +++ b/internal/service/xray/group_tags_gen_test.go @@ -3,10 +3,10 @@ package xray_test import ( - "fmt" "testing" "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -22,11 +22,16 @@ func TestAccXRayGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -34,12 +39,25 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGroupConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -48,12 +66,25 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGroupConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -61,18 +92,31 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGroupConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -90,23 +134,35 @@ func TestAccXRayGroup_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/Group/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Group/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGroupConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -123,18 +179,26 @@ func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -142,6 +206,12 @@ func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -159,11 +229,16 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -171,18 +246,31 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGroupConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -200,11 +288,16 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -212,7 +305,14 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccGroupConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -221,12 +321,25 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -234,6 +347,12 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -251,11 +370,16 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckGroupDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -263,7 +387,12 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccGroupConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -271,6 +400,12 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -286,16 +421,17 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccGroupConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -304,15 +440,25 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccGroupConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Group/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -322,15 +468,25 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccGroupConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -339,15 +495,22 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccGroupConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -355,6 +518,11 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -370,16 +538,19 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccGroupConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -390,15 +561,29 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccGroupConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Group/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -411,15 +596,26 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccGroupConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -427,6 +623,11 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -442,16 +643,19 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccGroupConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -461,15 +665,31 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccGroupConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Group/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -481,15 +701,31 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccGroupConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -499,6 +735,14 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -514,13 +758,18 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -530,10 +779,12 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccGroupConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -542,6 +793,12 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -557,16 +814,17 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccGroupConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -575,7 +833,13 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ), }, { - Config: testAccGroupConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -585,6 +849,13 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -600,16 +871,19 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccGroupConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -619,6 +893,14 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -634,16 +916,18 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccGroupConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -652,6 +936,13 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -667,16 +958,18 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckGroupDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccGroupConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckGroupExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -685,6 +978,13 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -692,53 +992,3 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. }, }) } - -func testAccGroupConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_xray_group" "test" { - group_name = %[1]q - filter_expression = "responsetime > 5" - -} -`, rName) -} - -func testAccGroupConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_xray_group" "test" { - group_name = %[1]q - filter_expression = "responsetime > 5" - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccGroupConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_xray_group" "test" { - group_name = %[1]q - filter_expression = "responsetime > 5" - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccGroupConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_xray_group" "test" { - group_name = %[1]q - filter_expression = "responsetime > 5" - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/xray/sampling_rule_tags_gen_test.go b/internal/service/xray/sampling_rule_tags_gen_test.go index 9b1ca120b12..b76e12a21f8 100644 --- a/internal/service/xray/sampling_rule_tags_gen_test.go +++ b/internal/service/xray/sampling_rule_tags_gen_test.go @@ -3,10 +3,10 @@ package xray_test import ( - "fmt" "testing" "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -22,11 +22,16 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -34,12 +39,25 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSamplingRuleConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -48,12 +66,25 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSamplingRuleConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -61,18 +92,31 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSamplingRuleConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -90,23 +134,35 @@ func TestAccXRaySamplingRule_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSamplingRuleConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -123,18 +179,26 @@ func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -142,6 +206,12 @@ func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -159,11 +229,16 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -171,18 +246,31 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSamplingRuleConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -200,11 +288,16 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -212,7 +305,14 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccSamplingRuleConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -221,12 +321,25 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -234,6 +347,12 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -251,11 +370,16 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -263,7 +387,12 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -271,6 +400,12 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -286,16 +421,17 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSamplingRuleConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -304,15 +440,25 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccSamplingRuleConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -322,15 +468,25 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccSamplingRuleConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -339,15 +495,22 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccSamplingRuleConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -355,6 +518,11 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -370,16 +538,19 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccSamplingRuleConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -390,15 +561,29 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccSamplingRuleConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -411,15 +596,26 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccSamplingRuleConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -427,6 +623,11 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -442,16 +643,19 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccSamplingRuleConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -461,15 +665,31 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccSamplingRuleConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -481,15 +701,31 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccSamplingRuleConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -499,6 +735,14 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -514,13 +758,18 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -530,10 +779,12 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSamplingRuleConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -542,6 +793,12 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -557,16 +814,17 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSamplingRuleConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -575,7 +833,13 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) ), }, { - Config: testAccSamplingRuleConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -585,6 +849,13 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -600,16 +871,19 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSamplingRuleConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -619,6 +893,14 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -634,16 +916,18 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccSamplingRuleConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -652,6 +936,13 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -667,16 +958,18 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.XRayServiceID), + CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccSamplingRuleConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSamplingRuleExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -685,6 +978,13 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t ), }, { + ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -692,105 +992,3 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t }, }) } - -func testAccSamplingRuleConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_xray_sampling_rule" "test" { - rule_name = %[1]q - priority = 5 - reservoir_size = 10 - url_path = "*" - host = "*" - http_method = "GET" - service_type = "*" - service_name = "*" - fixed_rate = 0.3 - resource_arn = "*" - version = 1 - - attributes = { - Hello = "World" - } - -} -`, rName) -} - -func testAccSamplingRuleConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_xray_sampling_rule" "test" { - rule_name = %[1]q - priority = 5 - reservoir_size = 10 - url_path = "*" - host = "*" - http_method = "GET" - service_type = "*" - service_name = "*" - fixed_rate = 0.3 - resource_arn = "*" - version = 1 - - attributes = { - Hello = "World" - } - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccSamplingRuleConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_xray_sampling_rule" "test" { - rule_name = %[1]q - priority = 5 - reservoir_size = 10 - url_path = "*" - host = "*" - http_method = "GET" - service_type = "*" - service_name = "*" - fixed_rate = 0.3 - resource_arn = "*" - version = 1 - - attributes = { - Hello = "World" - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccSamplingRuleConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_xray_sampling_rule" "test" { - rule_name = %[1]q - priority = 5 - reservoir_size = 10 - url_path = "*" - host = "*" - http_method = "GET" - service_type = "*" - service_name = "*" - fixed_rate = 0.3 - resource_arn = "*" - version = 1 - - attributes = { - Hello = "World" - } - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/xray/testdata/Group/tags0_default1_gen.tf b/internal/service/xray/testdata/Group/tags0_default1_gen.tf new file mode 100644 index 00000000000..48b6165fe8a --- /dev/null +++ b/internal/service/xray/testdata/Group/tags0_default1_gen.tf @@ -0,0 +1,33 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/Group/tags0_default2_gen.tf b/internal/service/xray/testdata/Group/tags0_default2_gen.tf new file mode 100644 index 00000000000..5158821b0bb --- /dev/null +++ b/internal/service/xray/testdata/Group/tags0_default2_gen.tf @@ -0,0 +1,45 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/Group/tags0_gen.tf b/internal/service/xray/testdata/Group/tags0_gen.tf new file mode 100644 index 00000000000..b6dbac279f6 --- /dev/null +++ b/internal/service/xray/testdata/Group/tags0_gen.tf @@ -0,0 +1,16 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/Group/tags1_default1_gen.tf b/internal/service/xray/testdata/Group/tags1_default1_gen.tf new file mode 100644 index 00000000000..06e6d353c6b --- /dev/null +++ b/internal/service/xray/testdata/Group/tags1_default1_gen.tf @@ -0,0 +1,46 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/Group/tags1_gen.tf b/internal/service/xray/testdata/Group/tags1_gen.tf new file mode 100644 index 00000000000..0047cbb6fb4 --- /dev/null +++ b/internal/service/xray/testdata/Group/tags1_gen.tf @@ -0,0 +1,29 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/Group/tags2_default1_gen.tf b/internal/service/xray/testdata/Group/tags2_default1_gen.tf new file mode 100644 index 00000000000..43d51d07641 --- /dev/null +++ b/internal/service/xray/testdata/Group/tags2_default1_gen.tf @@ -0,0 +1,57 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/Group/tags2_default2_gen.tf b/internal/service/xray/testdata/Group/tags2_default2_gen.tf new file mode 100644 index 00000000000..b613a95fc57 --- /dev/null +++ b/internal/service/xray/testdata/Group/tags2_default2_gen.tf @@ -0,0 +1,69 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/Group/tags2_gen.tf b/internal/service/xray/testdata/Group/tags2_gen.tf new file mode 100644 index 00000000000..0c833fe98e8 --- /dev/null +++ b/internal/service/xray/testdata/Group/tags2_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/Group/tagsNull_default1_gen.tf b/internal/service/xray/testdata/Group/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..12fe2b24b98 --- /dev/null +++ b/internal/service/xray/testdata/Group/tagsNull_default1_gen.tf @@ -0,0 +1,41 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/Group/tagsNull_gen.tf b/internal/service/xray/testdata/Group/tagsNull_gen.tf new file mode 100644 index 00000000000..0f964493422 --- /dev/null +++ b/internal/service/xray/testdata/Group/tagsNull_gen.tf @@ -0,0 +1,24 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_group" "test" { + group_name = var.rName + filter_expression = "responsetime > 5" + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/SamplingRule/tags0_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags0_default1_gen.tf new file mode 100644 index 00000000000..659c667e1a2 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags0_default1_gen.tf @@ -0,0 +1,46 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/SamplingRule/tags0_default2_gen.tf b/internal/service/xray/testdata/SamplingRule/tags0_default2_gen.tf new file mode 100644 index 00000000000..4f9f97722eb --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags0_default2_gen.tf @@ -0,0 +1,58 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/SamplingRule/tags0_gen.tf b/internal/service/xray/testdata/SamplingRule/tags0_gen.tf new file mode 100644 index 00000000000..8f068cb2ed3 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags0_gen.tf @@ -0,0 +1,29 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/SamplingRule/tags1_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags1_default1_gen.tf new file mode 100644 index 00000000000..4e0404603e8 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags1_default1_gen.tf @@ -0,0 +1,59 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/SamplingRule/tags1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags1_gen.tf new file mode 100644 index 00000000000..7e9d425dfd0 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags1_gen.tf @@ -0,0 +1,42 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/SamplingRule/tags2_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags2_default1_gen.tf new file mode 100644 index 00000000000..a809f37de0f --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags2_default1_gen.tf @@ -0,0 +1,70 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/SamplingRule/tags2_default2_gen.tf b/internal/service/xray/testdata/SamplingRule/tags2_default2_gen.tf new file mode 100644 index 00000000000..8c525f7d01a --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags2_default2_gen.tf @@ -0,0 +1,82 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/SamplingRule/tags2_gen.tf b/internal/service/xray/testdata/SamplingRule/tags2_gen.tf new file mode 100644 index 00000000000..088610f0144 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tags2_gen.tf @@ -0,0 +1,53 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..960b37e3f44 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf @@ -0,0 +1,54 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf b/internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf new file mode 100644 index 00000000000..f791be9f5f2 --- /dev/null +++ b/internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf @@ -0,0 +1,37 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_xray_sampling_rule" "test" { + rule_name = var.rName + priority = 5 + reservoir_size = 10 + url_path = "*" + host = "*" + http_method = "GET" + service_type = "*" + service_name = "*" + fixed_rate = 0.3 + resource_arn = "*" + version = 1 + + attributes = { + Hello = "World" + } + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/xray/testdata/tmpl/group_tags.tmpl b/internal/service/xray/testdata/tmpl/group_tags.tmpl index 71cc103087f..034413e53cf 100644 --- a/internal/service/xray/testdata/tmpl/group_tags.tmpl +++ b/internal/service/xray/testdata/tmpl/group_tags.tmpl @@ -1,5 +1,5 @@ resource "aws_xray_group" "test" { - group_name = %[1]q + group_name = var.rName filter_expression = "responsetime > 5" {{- template "tags" . }} } diff --git a/internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl b/internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl index d14cb2984c5..b3485511cfd 100644 --- a/internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl +++ b/internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl @@ -1,5 +1,5 @@ resource "aws_xray_sampling_rule" "test" { - rule_name = %[1]q + rule_name = var.rName priority = 5 reservoir_size = 10 url_path = "*" From c72e209524cc7a71616656f3b2e4ac0aa5f7a8f8 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 18 Apr 2024 11:32:41 -0700 Subject: [PATCH 03/23] Updates tag tests for `iam` --- .../iam/instance_profile_tags_gen_test.go | 531 +++++++++++---- .../openid_connect_provider_tags_gen_test.go | 602 ++++++++++++----- internal/service/iam/policy_tags_gen_test.go | 638 ++++++++++++------ internal/service/iam/role_tags_gen_test.go | 634 +++++++++++------ .../iam/service_linked_role_tags_gen_test.go | 582 +++++++++++----- .../InstanceProfile/tags0_default1_gen.tf | 56 ++ .../InstanceProfile/tags0_default2_gen.tf | 68 ++ .../iam/testdata/InstanceProfile/tags0_gen.tf | 39 ++ .../InstanceProfile/tags1_default1_gen.tf | 69 ++ .../iam/testdata/InstanceProfile/tags1_gen.tf | 52 ++ .../InstanceProfile/tags2_default1_gen.tf | 80 +++ .../InstanceProfile/tags2_default2_gen.tf | 92 +++ .../iam/testdata/InstanceProfile/tags2_gen.tf | 63 ++ .../InstanceProfile/tagsNull_default1_gen.tf | 64 ++ .../testdata/InstanceProfile/tagsNull_gen.tf | 47 ++ .../tags0_default1_gen.tf | 38 ++ .../tags0_default2_gen.tf | 50 ++ .../OpenIDConnectProvider/tags0_gen.tf | 21 + .../tags1_default1_gen.tf | 51 ++ .../OpenIDConnectProvider/tags1_gen.tf | 34 + .../tags2_default1_gen.tf | 62 ++ .../tags2_default2_gen.tf | 74 ++ .../OpenIDConnectProvider/tags2_gen.tf | 45 ++ .../tagsNull_default1_gen.tf | 46 ++ .../OpenIDConnectProvider/tagsNull_gen.tf | 29 + .../iam/testdata/Policy/tags0_default1_gen.tf | 51 ++ .../iam/testdata/Policy/tags0_default2_gen.tf | 63 ++ .../service/iam/testdata/Policy/tags0_gen.tf | 34 + .../iam/testdata/Policy/tags1_default1_gen.tf | 64 ++ .../service/iam/testdata/Policy/tags1_gen.tf | 47 ++ .../iam/testdata/Policy/tags2_default1_gen.tf | 75 ++ .../iam/testdata/Policy/tags2_default2_gen.tf | 87 +++ .../service/iam/testdata/Policy/tags2_gen.tf | 58 ++ .../testdata/Policy/tagsNull_default1_gen.tf | 59 ++ .../iam/testdata/Policy/tagsNull_gen.tf | 42 ++ .../iam/testdata/Role/tags0_default1_gen.tf | 46 ++ .../iam/testdata/Role/tags0_default2_gen.tf | 58 ++ .../service/iam/testdata/Role/tags0_gen.tf | 29 + .../iam/testdata/Role/tags1_default1_gen.tf | 59 ++ .../service/iam/testdata/Role/tags1_gen.tf | 42 ++ .../iam/testdata/Role/tags2_default1_gen.tf | 70 ++ .../iam/testdata/Role/tags2_default2_gen.tf | 82 +++ .../service/iam/testdata/Role/tags2_gen.tf | 53 ++ .../testdata/Role/tagsNull_default1_gen.tf | 54 ++ .../service/iam/testdata/Role/tagsNull_gen.tf | 37 + .../ServiceLinkedRole/tags0_default1_gen.tf | 33 + .../ServiceLinkedRole/tags0_default2_gen.tf | 45 ++ .../testdata/ServiceLinkedRole/tags0_gen.tf | 16 + .../ServiceLinkedRole/tags1_default1_gen.tf | 46 ++ .../testdata/ServiceLinkedRole/tags1_gen.tf | 29 + .../ServiceLinkedRole/tags2_default1_gen.tf | 57 ++ .../ServiceLinkedRole/tags2_default2_gen.tf | 69 ++ .../testdata/ServiceLinkedRole/tags2_gen.tf | 40 ++ .../tagsNull_default1_gen.tf | 41 ++ .../ServiceLinkedRole/tagsNull_gen.tf | 24 + .../iam/testdata/User/tags0_default1_gen.tf | 32 + .../iam/testdata/User/tags0_default2_gen.tf | 44 ++ .../service/iam/testdata/User/tags0_gen.tf | 15 + .../iam/testdata/User/tags1_default1_gen.tf | 45 ++ .../service/iam/testdata/User/tags1_gen.tf | 28 + .../iam/testdata/User/tags2_default1_gen.tf | 56 ++ .../iam/testdata/User/tags2_default2_gen.tf | 68 ++ .../service/iam/testdata/User/tags2_gen.tf | 39 ++ .../testdata/User/tagsNull_default1_gen.tf | 40 ++ .../service/iam/testdata/User/tagsNull_gen.tf | 23 + .../VirtualMFADevice/tags0_default1_gen.tf | 32 + .../VirtualMFADevice/tags0_default2_gen.tf | 44 ++ .../testdata/VirtualMFADevice/tags0_gen.tf | 15 + .../VirtualMFADevice/tags1_default1_gen.tf | 45 ++ .../testdata/VirtualMFADevice/tags1_gen.tf | 28 + .../VirtualMFADevice/tags2_default1_gen.tf | 56 ++ .../VirtualMFADevice/tags2_default2_gen.tf | 68 ++ .../testdata/VirtualMFADevice/tags2_gen.tf | 39 ++ .../VirtualMFADevice/tagsNull_default1_gen.tf | 40 ++ .../testdata/VirtualMFADevice/tagsNull_gen.tf | 23 + .../testdata/tmpl/instance_profile_tags.tmpl | 28 + .../tmpl/openid_connect_provider_tags.tmpl | 2 +- .../iam/testdata/tmpl/policy_tags.tmpl | 8 +- .../service/iam/testdata/tmpl/role_tags.tmpl | 2 +- .../tmpl/service_linked_role_tags.tmpl | 2 +- .../service/iam/testdata/tmpl/user_tags.tmpl | 2 +- .../tmpl/virtual_mfa_device_tags.tmpl | 2 +- internal/service/iam/user_tags_gen_test.go | 578 +++++++++++----- .../iam/virtual_mfa_device_tags_gen_test.go | 578 +++++++++++----- 84 files changed, 6321 insertions(+), 1238 deletions(-) create mode 100644 internal/service/iam/testdata/InstanceProfile/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags0_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags1_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tags2_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/InstanceProfile/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags0_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags1_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags2_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags0_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags1_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tags2_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/Policy/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags0_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags1_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/Role/tags2_gen.tf create mode 100644 internal/service/iam/testdata/Role/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/Role/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags0_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags1_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags2_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/User/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/User/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/User/tags0_gen.tf create mode 100644 internal/service/iam/testdata/User/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/User/tags1_gen.tf create mode 100644 internal/service/iam/testdata/User/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/User/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/User/tags2_gen.tf create mode 100644 internal/service/iam/testdata/User/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/User/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags0_default1_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags0_default2_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags0_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags1_default1_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags1_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags2_default1_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags2_default2_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags2_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tagsNull_gen.tf create mode 100644 internal/service/iam/testdata/tmpl/instance_profile_tags.tmpl diff --git a/internal/service/iam/instance_profile_tags_gen_test.go b/internal/service/iam/instance_profile_tags_gen_test.go index 67834d3d0ab..fea0fd36d6a 100644 --- a/internal/service/iam/instance_profile_tags_gen_test.go +++ b/internal/service/iam/instance_profile_tags_gen_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/iam/types" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -21,11 +22,16 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -33,12 +39,25 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccInstanceProfileConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -47,12 +66,25 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccInstanceProfileConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -60,18 +92,31 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccInstanceProfileConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -89,23 +134,35 @@ func TestAccIAMInstanceProfile_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccInstanceProfileConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -122,18 +179,26 @@ func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -141,6 +206,12 @@ func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -158,11 +229,16 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -170,18 +246,31 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccInstanceProfileConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -199,11 +288,16 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -211,7 +305,14 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccInstanceProfileConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -220,12 +321,25 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -233,6 +347,12 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -250,11 +370,16 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -262,7 +387,12 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -270,6 +400,12 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -285,16 +421,17 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccInstanceProfileConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -303,15 +440,25 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccInstanceProfileConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -321,15 +468,25 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccInstanceProfileConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -338,15 +495,22 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccInstanceProfileConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -354,6 +518,11 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -369,16 +538,19 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccInstanceProfileConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -389,15 +561,29 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccInstanceProfileConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -410,15 +596,26 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccInstanceProfileConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -426,6 +623,11 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -441,16 +643,19 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccInstanceProfileConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -460,15 +665,31 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccInstanceProfileConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -480,15 +701,31 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccInstanceProfileConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -498,6 +735,14 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -513,13 +758,18 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -529,10 +779,12 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccInstanceProfileConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -541,6 +793,12 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -556,16 +814,17 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccInstanceProfileConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -574,7 +833,13 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. ), }, { - Config: testAccInstanceProfileConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -584,6 +849,13 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -599,16 +871,19 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccInstanceProfileConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -618,6 +893,14 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -633,16 +916,18 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccInstanceProfileConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -651,6 +936,13 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -666,16 +958,18 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccInstanceProfileConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckInstanceProfileExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -684,6 +978,13 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { + ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/iam/openid_connect_provider_tags_gen_test.go b/internal/service/iam/openid_connect_provider_tags_gen_test.go index 6138a7d528f..c4216e9c550 100644 --- a/internal/service/iam/openid_connect_provider_tags_gen_test.go +++ b/internal/service/iam/openid_connect_provider_tags_gen_test.go @@ -3,9 +3,9 @@ package iam_test import ( - "fmt" "testing" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -20,11 +20,16 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -32,12 +37,25 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccOpenIDConnectProviderConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -46,12 +64,25 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -59,18 +90,31 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccOpenIDConnectProviderConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -87,23 +131,35 @@ func TestAccIAMOpenIDConnectProvider_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccOpenIDConnectProviderConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -119,18 +175,26 @@ func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -138,6 +202,12 @@ func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -154,11 +224,16 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -166,18 +241,31 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccOpenIDConnectProviderConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -194,11 +282,16 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -206,7 +299,14 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccOpenIDConnectProviderConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -215,12 +315,25 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -228,6 +341,12 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -244,11 +363,16 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -256,7 +380,12 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T ), }, { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -264,6 +393,12 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -278,16 +413,17 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -296,15 +432,25 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -314,15 +460,25 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -331,15 +487,22 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -347,6 +510,11 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -361,16 +529,19 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccOpenIDConnectProviderConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -381,15 +552,29 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccOpenIDConnectProviderConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -402,15 +587,26 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -418,6 +614,11 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -432,16 +633,19 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccOpenIDConnectProviderConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -451,15 +655,31 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccOpenIDConnectProviderConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -471,15 +691,31 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccOpenIDConnectProviderConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -489,6 +725,14 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -503,13 +747,18 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -519,10 +768,12 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -531,6 +782,12 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -545,16 +802,17 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccOpenIDConnectProviderConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -563,7 +821,13 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te ), }, { - Config: testAccOpenIDConnectProviderConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -573,6 +837,13 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -587,16 +858,19 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccOpenIDConnectProviderConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -606,6 +880,14 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -620,16 +902,18 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccOpenIDConnectProviderConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -638,6 +922,13 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -652,16 +943,18 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccOpenIDConnectProviderConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckOpenIDConnectProviderExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -670,6 +963,13 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource ), }, { + ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -677,73 +977,3 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource }, }) } - -func testAccOpenIDConnectProviderConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - -} -`, rName) -} - -func testAccOpenIDConnectProviderConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccOpenIDConnectProviderConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccOpenIDConnectProviderConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_iam_openid_connect_provider" "test" { - url = "https://accounts.testle.com/%[1]s" - - client_id_list = [ - "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", - ] - - thumbprint_list = ["cf23df2207d99a74fbe169e3eba035e633b65d94"] - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/iam/policy_tags_gen_test.go b/internal/service/iam/policy_tags_gen_test.go index edd96f01224..8a54a854649 100644 --- a/internal/service/iam/policy_tags_gen_test.go +++ b/internal/service/iam/policy_tags_gen_test.go @@ -3,10 +3,10 @@ package iam_test import ( - "fmt" "testing" "github.com/aws/aws-sdk-go-v2/service/iam/types" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -22,11 +22,16 @@ func TestAccIAMPolicy_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -34,12 +39,25 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPolicyConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -48,12 +66,25 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPolicyConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -61,18 +92,31 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -90,23 +134,35 @@ func TestAccIAMPolicy_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/Policy/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -123,18 +179,26 @@ func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -142,6 +206,12 @@ func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -159,11 +229,16 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -171,18 +246,31 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -200,11 +288,16 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -212,7 +305,14 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccPolicyConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -221,12 +321,25 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -234,6 +347,12 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -251,11 +370,16 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -263,7 +387,12 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccPolicyConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -271,6 +400,12 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -286,16 +421,17 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -304,15 +440,25 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -322,15 +468,25 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -339,15 +495,22 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccPolicyConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -355,6 +518,11 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -370,16 +538,19 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccPolicyConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -390,15 +561,29 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccPolicyConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -411,15 +596,26 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccPolicyConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -427,6 +623,11 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -442,16 +643,19 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccPolicyConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -461,15 +665,31 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccPolicyConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -481,15 +701,31 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccPolicyConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -499,6 +735,14 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -514,13 +758,18 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -530,10 +779,12 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -542,6 +793,12 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -557,16 +814,17 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -575,7 +833,13 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ), }, { - Config: testAccPolicyConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -585,6 +849,13 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -600,16 +871,19 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPolicyConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -619,6 +893,14 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -634,16 +916,18 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccPolicyConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -652,6 +936,13 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -667,16 +958,18 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.IAMServiceID), + CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccPolicyConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -685,6 +978,13 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -692,109 +992,3 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. }, }) } - -func testAccPolicyConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_iam_policy" "test" { - name = %q - - policy = < Date: Thu, 18 Apr 2024 11:32:41 -0700 Subject: [PATCH 04/23] Updates tag tests for `iam` --- internal/service/iam/instance_profile_test.go | 58 ------------------- 1 file changed, 58 deletions(-) diff --git a/internal/service/iam/instance_profile_test.go b/internal/service/iam/instance_profile_test.go index e2499f24067..c80025b6700 100644 --- a/internal/service/iam/instance_profile_test.go +++ b/internal/service/iam/instance_profile_test.go @@ -204,7 +204,6 @@ func TestAccIAMInstanceProfile_launchConfiguration(t *testing.T) { acctest.CheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("instance-profile/%s", rName)), resource.TestCheckResourceAttrPair(resourceName, "role", "aws_iam_role.test", "name"), resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), ), }, { @@ -219,7 +218,6 @@ func TestAccIAMInstanceProfile_launchConfiguration(t *testing.T) { acctest.CheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("instance-profile/%s", rName)), resource.TestCheckResourceAttrPair(resourceName, "role", "aws_iam_role.test", "name"), resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), ), }, { @@ -229,7 +227,6 @@ func TestAccIAMInstanceProfile_launchConfiguration(t *testing.T) { acctest.CheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("instance-profile/%s", rName)), resource.TestCheckResourceAttrPair(resourceName, "role", "aws_iam_role.test", "name"), resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), ), }, { @@ -239,7 +236,6 @@ func TestAccIAMInstanceProfile_launchConfiguration(t *testing.T) { acctest.CheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("instance-profile/%s", rName)), resource.TestCheckResourceAttrPair(resourceName, "role", "aws_iam_role.test", "name"), resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), ), }, { @@ -254,7 +250,6 @@ func TestAccIAMInstanceProfile_launchConfiguration(t *testing.T) { acctest.CheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("instance-profile/%s", rName)), resource.TestCheckResourceAttrPair(resourceName, "role", "aws_iam_role.test", "name"), resource.TestCheckResourceAttr(resourceName, "name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), ), }, }, @@ -373,55 +368,6 @@ resource "aws_iam_instance_profile" "test" { `, namePrefix)) } -func testAccInstanceProfileConfig_tags0(rName string) string { - return acctest.ConfigCompose(testAccInstanceProfileConfig_base(rName), fmt.Sprintf(` -resource "aws_iam_instance_profile" "test" { - name = %[1]q - role = aws_iam_role.test.name -} -`, rName)) -} - -func testAccInstanceProfileConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccInstanceProfileConfig_base(rName), fmt.Sprintf(` -resource "aws_iam_instance_profile" "test" { - name = %[1]q - role = aws_iam_role.test.name - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1)) -} - -func testAccInstanceProfileConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccInstanceProfileConfig_base(rName), fmt.Sprintf(` -resource "aws_iam_instance_profile" "test" { - name = "test-%[1]s" - role = aws_iam_role.test.name - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2)) -} - -func testAccInstanceProfileConfig_tagsNull(rName, tagKey1 string) string { - return acctest.ConfigCompose(testAccInstanceProfileConfig_base(rName), fmt.Sprintf(` -resource "aws_iam_instance_profile" "test" { - name = %[1]q - role = aws_iam_role.test.name - - tags = { - %[2]q = null - } -} -`, rName, tagKey1)) -} - func testAccInstanceProfileConfig_launchConfiguration(rName string) string { return acctest.ConfigCompose( acctest.ConfigLatestAmazonLinux2HVMEBSX8664AMI(), @@ -437,10 +383,6 @@ resource "aws_launch_configuration" "test" { resource "aws_iam_instance_profile" "test" { name = %[1]q role = aws_iam_role.test.name - - tags = { - Name = %[1]q - } } `, rName)) } From 495bd5c5af694e0b1c9e683ae28aaf894fde86ba Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 18 Apr 2024 13:46:11 -0700 Subject: [PATCH 05/23] Updates tag tests for `batch` --- .../compute_environment_tags_gen_test.go | 531 +++++++++++---- .../service/batch/compute_environment_test.go | 61 -- .../batch/job_definition_tags_gen_test.go | 606 ++++++++++++------ internal/service/batch/job_queue.go | 2 +- .../service/batch/job_queue_tags_gen_test.go | 531 +++++++++++---- internal/service/batch/job_queue_test.go | 65 -- .../batch/scheduling_policy_tags_gen_test.go | 598 +++++++++++------ .../ComputeEnvironment/tags0_default1_gen.tf | 91 +++ .../ComputeEnvironment/tags0_default2_gen.tf | 103 +++ .../testdata/ComputeEnvironment/tags0_gen.tf | 74 +++ .../ComputeEnvironment/tags1_default1_gen.tf | 104 +++ .../testdata/ComputeEnvironment/tags1_gen.tf | 87 +++ .../ComputeEnvironment/tags2_default1_gen.tf | 115 ++++ .../ComputeEnvironment/tags2_default2_gen.tf | 127 ++++ .../testdata/ComputeEnvironment/tags2_gen.tf | 98 +++ .../tagsNull_default1_gen.tf | 99 +++ .../ComputeEnvironment/tagsNull_gen.tf | 82 +++ .../JobDefinition/tags0_default1_gen.tf | 39 ++ .../JobDefinition/tags0_default2_gen.tf | 51 ++ .../batch/testdata/JobDefinition/tags0_gen.tf | 22 + .../JobDefinition/tags1_default1_gen.tf | 52 ++ .../batch/testdata/JobDefinition/tags1_gen.tf | 35 + .../JobDefinition/tags2_default1_gen.tf | 63 ++ .../JobDefinition/tags2_default2_gen.tf | 75 +++ .../batch/testdata/JobDefinition/tags2_gen.tf | 46 ++ .../JobDefinition/tagsNull_default1_gen.tf | 47 ++ .../testdata/JobDefinition/tagsNull_gen.tf | 30 + .../testdata/JobQueue/tags0_default1_gen.tf | 99 +++ .../testdata/JobQueue/tags0_default2_gen.tf | 111 ++++ .../batch/testdata/JobQueue/tags0_gen.tf | 82 +++ .../testdata/JobQueue/tags1_default1_gen.tf | 112 ++++ .../batch/testdata/JobQueue/tags1_gen.tf | 95 +++ .../testdata/JobQueue/tags2_default1_gen.tf | 123 ++++ .../testdata/JobQueue/tags2_default2_gen.tf | 135 ++++ .../batch/testdata/JobQueue/tags2_gen.tf | 106 +++ .../JobQueue/tagsNull_default1_gen.tf | 107 ++++ .../batch/testdata/JobQueue/tagsNull_gen.tf | 90 +++ .../SchedulingPolicy/tags0_default1_gen.tf | 37 ++ .../SchedulingPolicy/tags0_default2_gen.tf | 49 ++ .../testdata/SchedulingPolicy/tags0_gen.tf | 20 + .../SchedulingPolicy/tags1_default1_gen.tf | 50 ++ .../testdata/SchedulingPolicy/tags1_gen.tf | 33 + .../SchedulingPolicy/tags2_default1_gen.tf | 61 ++ .../SchedulingPolicy/tags2_default2_gen.tf | 73 +++ .../testdata/SchedulingPolicy/tags2_gen.tf | 44 ++ .../SchedulingPolicy/tagsNull_default1_gen.tf | 45 ++ .../testdata/SchedulingPolicy/tagsNull_gen.tf | 28 + .../tmpl/compute_environment_tags.tmpl | 63 ++ .../testdata/tmpl/job_definition_tags.tmpl | 4 +- .../batch/testdata/tmpl/job_queue_tags.tmpl | 71 ++ .../testdata/tmpl/scheduling_policy_tags.tmpl | 2 +- 51 files changed, 4742 insertions(+), 732 deletions(-) create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags0_default1_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags0_default2_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags0_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags1_default1_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags1_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags2_default1_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags2_default2_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags2_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1_gen.tf create mode 100644 internal/service/batch/testdata/ComputeEnvironment/tagsNull_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags0_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags0_default2_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags0_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags1_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags1_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags2_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags2_default2_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tags2_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tagsNull_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobDefinition/tagsNull_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags0_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags0_default2_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags0_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags1_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags1_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags2_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags2_default2_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags2_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tagsNull_default1_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tagsNull_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags0_default1_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags0_default2_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags0_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags1_default1_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags1_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags2_default1_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags2_default2_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags2_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1_gen.tf create mode 100644 internal/service/batch/testdata/SchedulingPolicy/tagsNull_gen.tf create mode 100644 internal/service/batch/testdata/tmpl/compute_environment_tags.tmpl create mode 100644 internal/service/batch/testdata/tmpl/job_queue_tags.tmpl diff --git a/internal/service/batch/compute_environment_tags_gen_test.go b/internal/service/batch/compute_environment_tags_gen_test.go index 7166919636c..e812043675e 100644 --- a/internal/service/batch/compute_environment_tags_gen_test.go +++ b/internal/service/batch/compute_environment_tags_gen_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -21,11 +22,16 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -33,12 +39,25 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccComputeEnvironmentConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -47,12 +66,25 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -60,18 +92,31 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccComputeEnvironmentConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -89,23 +134,35 @@ func TestAccBatchComputeEnvironment_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccComputeEnvironmentConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -122,18 +179,26 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -141,6 +206,12 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -158,11 +229,16 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -170,18 +246,31 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccComputeEnvironmentConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -199,11 +288,16 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -211,7 +305,14 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccComputeEnvironmentConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -220,12 +321,25 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -233,6 +347,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -250,11 +370,16 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -262,7 +387,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -270,6 +400,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -285,16 +421,17 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -303,15 +440,25 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -321,15 +468,25 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -338,15 +495,22 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -354,6 +518,11 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -369,16 +538,19 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccComputeEnvironmentConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -389,15 +561,29 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccComputeEnvironmentConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -410,15 +596,26 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -426,6 +623,11 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -441,16 +643,19 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccComputeEnvironmentConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -460,15 +665,31 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccComputeEnvironmentConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -480,15 +701,31 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccComputeEnvironmentConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -498,6 +735,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -513,13 +758,18 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -529,10 +779,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -541,6 +793,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -556,16 +814,17 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccComputeEnvironmentConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -574,7 +833,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes ), }, { - Config: testAccComputeEnvironmentConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -584,6 +849,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -599,16 +871,19 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccComputeEnvironmentConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -618,6 +893,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -633,16 +916,18 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccComputeEnvironmentConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -651,6 +936,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -666,16 +958,18 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccComputeEnvironmentConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -684,6 +978,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT ), }, { + ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/batch/compute_environment_test.go b/internal/service/batch/compute_environment_test.go index 80a53b72c4c..37d9d229b6b 100644 --- a/internal/service/batch/compute_environment_test.go +++ b/internal/service/batch/compute_environment_test.go @@ -2913,67 +2913,6 @@ resource "aws_batch_compute_environment" "test" { `, rName, version)) } -func testAccComputeEnvironmentConfig_tags0(rName string) string { - return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), fmt.Sprintf(` -resource "aws_batch_compute_environment" "test" { - depends_on = [aws_iam_role_policy_attachment.batch_service] - - compute_environment_name = %[1]q - service_role = aws_iam_role.batch_service.arn - type = "UNMANAGED" -} -`, rName)) -} - -func testAccComputeEnvironmentConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), fmt.Sprintf(` -resource "aws_batch_compute_environment" "test" { - depends_on = [aws_iam_role_policy_attachment.batch_service] - - compute_environment_name = %[1]q - service_role = aws_iam_role.batch_service.arn - type = "UNMANAGED" - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1)) -} - -func testAccComputeEnvironmentConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), fmt.Sprintf(` -resource "aws_batch_compute_environment" "test" { - depends_on = [aws_iam_role_policy_attachment.batch_service] - - compute_environment_name = %[1]q - service_role = aws_iam_role.batch_service.arn - type = "UNMANAGED" - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2)) -} - -func testAccComputeEnvironmentConfig_tagsNull(rName, tagKey1 string) string { - return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), fmt.Sprintf(` -resource "aws_batch_compute_environment" "test" { - depends_on = [aws_iam_role_policy_attachment.batch_service] - - compute_environment_name = %[1]q - service_role = aws_iam_role.batch_service.arn - type = "UNMANAGED" - - tags = { - %[2]q = null - } -} -`, rName, tagKey1)) -} - func testAccComputeEnvironmentConfig_ec2Configuration(rName string) string { return acctest.ConfigCompose(testAccComputeEnvironmentConfig_base(rName), acctest.ConfigLatestAmazonLinux2HVMEBSX8664AMI(), fmt.Sprintf(` resource "aws_batch_compute_environment" "test" { diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index 52aa85b9e9b..263b67fb05a 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -3,10 +3,10 @@ package batch_test import ( - "fmt" "testing" "github.com/aws/aws-sdk-go/service/batch" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -22,11 +22,16 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -34,6 +39,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -42,7 +53,14 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - Config: testAccJobDefinitionConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -51,6 +69,14 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -59,7 +85,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - Config: testAccJobDefinitionConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -67,6 +98,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -75,13 +112,20 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - Config: testAccJobDefinitionConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -102,17 +146,26 @@ func TestAccBatchJobDefinition_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -121,7 +174,10 @@ func TestAccBatchJobDefinition_tags_null(t *testing.T) { }, }, { - Config: testAccJobDefinitionConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -138,18 +194,26 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -157,6 +221,12 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -177,11 +247,16 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -189,6 +264,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -197,13 +278,20 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - Config: testAccJobDefinitionConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -224,11 +312,16 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -236,7 +329,14 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccJobDefinitionConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -245,6 +345,14 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -253,7 +361,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -261,6 +374,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -281,11 +400,16 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -293,7 +417,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -301,6 +430,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -319,16 +454,17 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobDefinitionConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -337,6 +473,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -345,10 +487,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccJobDefinitionConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -358,6 +504,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -366,10 +520,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccJobDefinitionConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -378,6 +534,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -386,10 +548,11 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccJobDefinitionConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -397,6 +560,11 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -415,16 +583,19 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccJobDefinitionConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -435,6 +606,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -443,10 +622,16 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccJobDefinitionConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -459,6 +644,16 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -467,10 +662,11 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccJobDefinitionConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -478,6 +674,11 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -496,16 +697,19 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccJobDefinitionConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -515,6 +719,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -523,10 +735,18 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccJobDefinitionConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -538,6 +758,18 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -546,10 +778,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccJobDefinitionConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -559,6 +795,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -577,13 +821,18 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -593,10 +842,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobDefinitionConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -605,6 +856,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -623,16 +880,17 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobDefinitionConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -641,7 +899,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. ), }, { - Config: testAccJobDefinitionConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -651,6 +915,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -669,16 +940,19 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobDefinitionConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -688,6 +962,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -706,16 +988,18 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccJobDefinitionConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -724,6 +1008,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -742,16 +1033,18 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccJobDefinitionConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -760,6 +1053,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { + ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -770,77 +1070,3 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t }, }) } - -func testAccJobDefinitionConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - -} -`, rName) -} - -func testAccJobDefinitionConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccJobDefinitionConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccJobDefinitionConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_batch_job_definition" "test" { - container_properties = jsonencode({ - command = ["echo", "test"] - image = "busybox" - memory = 128 - vcpus = 1 - }) - name = %[1]q - type = "container" - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/batch/job_queue.go b/internal/service/batch/job_queue.go index d9769c3e5d0..257efeadef9 100644 --- a/internal/service/batch/job_queue.go +++ b/internal/service/batch/job_queue.go @@ -79,7 +79,7 @@ func (r *resourceJobQueue) Schema(ctx context.Context, request resource.SchemaRe "compute_environments": schema.ListAttribute{ ElementType: fwtypes.ARNType, Optional: true, - DeprecationMessage: "This parameter will be replaced by `compute_environments_order`.", + DeprecationMessage: "This parameter will be replaced by `compute_environment_order`.", }, "id": framework.IDAttribute(), "name": schema.StringAttribute{ diff --git a/internal/service/batch/job_queue_tags_gen_test.go b/internal/service/batch/job_queue_tags_gen_test.go index 7e46a9f7879..1b3dc9bebb9 100644 --- a/internal/service/batch/job_queue_tags_gen_test.go +++ b/internal/service/batch/job_queue_tags_gen_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/batch" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -21,11 +22,16 @@ func TestAccBatchJobQueue_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -33,12 +39,25 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccJobQueueConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -47,12 +66,25 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccJobQueueConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -60,18 +92,31 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccJobQueueConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -91,23 +136,35 @@ func TestAccBatchJobQueue_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccJobQueueConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -124,18 +181,26 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -143,6 +208,12 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -160,11 +231,16 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -172,18 +248,31 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccJobQueueConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -201,11 +290,16 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -213,7 +307,14 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccJobQueueConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -222,12 +323,25 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -235,6 +349,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -252,11 +372,16 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckJobQueueDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -264,7 +389,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccJobQueueConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -272,6 +402,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -287,16 +423,17 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobQueueConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -305,15 +442,25 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccJobQueueConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -323,15 +470,25 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccJobQueueConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -340,15 +497,22 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccJobQueueConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -356,6 +520,11 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -371,16 +540,19 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccJobQueueConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -391,15 +563,29 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccJobQueueConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -412,15 +598,26 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccJobQueueConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -428,6 +625,11 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -443,16 +645,19 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccJobQueueConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -462,15 +667,31 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccJobQueueConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -482,15 +703,31 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccJobQueueConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -500,6 +737,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -515,13 +760,18 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -531,10 +781,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobQueueConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -543,6 +795,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -558,16 +816,17 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobQueueConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -576,7 +835,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ), }, { - Config: testAccJobQueueConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -586,6 +851,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -601,16 +873,19 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccJobQueueConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -620,6 +895,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -637,16 +920,18 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccJobQueueConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -655,6 +940,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -672,16 +964,18 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckJobQueueDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccJobQueueConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -690,6 +984,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test ), }, { + ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/batch/job_queue_test.go b/internal/service/batch/job_queue_test.go index fe5a23569f1..3241d37d11d 100644 --- a/internal/service/batch/job_queue_test.go +++ b/internal/service/batch/job_queue_test.go @@ -800,71 +800,6 @@ resource "aws_batch_compute_environment" "more" { `, rName, state)) } -func testAccJobQueueConfig_tags0(rName string) string { - return acctest.ConfigCompose( - testAccJobQueueConfigBase(rName), - fmt.Sprintf(` -resource "aws_batch_job_queue" "test" { - compute_environments = [aws_batch_compute_environment.test.arn] - name = %[1]q - priority = 1 - state = "DISABLED" -} -`, rName)) -} - -func testAccJobQueueConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose( - testAccJobQueueConfigBase(rName), - fmt.Sprintf(` -resource "aws_batch_job_queue" "test" { - compute_environments = [aws_batch_compute_environment.test.arn] - name = %[1]q - priority = 1 - state = "DISABLED" - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1)) -} - -func testAccJobQueueConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose( - testAccJobQueueConfigBase(rName), - fmt.Sprintf(` -resource "aws_batch_job_queue" "test" { - compute_environments = [aws_batch_compute_environment.test.arn] - name = %[1]q - priority = 1 - state = "DISABLED" - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2)) -} - -func testAccJobQueueConfig_tagsNull(rName, tagKey1 string) string { - return acctest.ConfigCompose( - testAccJobQueueConfigBase(rName), - fmt.Sprintf(` -resource "aws_batch_job_queue" "test" { - compute_environments = [aws_batch_compute_environment.test.arn] - name = %[1]q - priority = 1 - state = "DISABLED" - - tags = { - %[2]q = null - } -} -`, rName, tagKey1)) -} - func testAccCheckLaunchTemplateDestroy(ctx context.Context) resource.TestCheckFunc { return func(s *terraform.State) error { conn := acctest.Provider.Meta().(*conns.AWSClient).EC2Conn(ctx) diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 481dea3ebe6..6b1491c63fc 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -3,10 +3,10 @@ package batch_test import ( - "fmt" "testing" "github.com/aws/aws-sdk-go/service/batch" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -22,11 +22,16 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -34,12 +39,25 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSchedulingPolicyConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -48,12 +66,25 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -61,18 +92,31 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSchedulingPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -90,23 +134,35 @@ func TestAccBatchSchedulingPolicy_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSchedulingPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -123,18 +179,26 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -142,6 +206,12 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -159,11 +229,16 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -171,18 +246,31 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSchedulingPolicyConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -200,11 +288,16 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -212,7 +305,14 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccSchedulingPolicyConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -221,12 +321,25 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -234,6 +347,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -251,11 +370,16 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -263,7 +387,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -271,6 +400,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -286,16 +421,17 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -304,15 +440,25 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -322,15 +468,25 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -339,15 +495,22 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -355,6 +518,11 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -370,16 +538,19 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccSchedulingPolicyConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -390,15 +561,29 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccSchedulingPolicyConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -411,15 +596,26 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -427,6 +623,11 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -442,16 +643,19 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccSchedulingPolicyConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -461,15 +665,31 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccSchedulingPolicyConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -481,15 +701,31 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccSchedulingPolicyConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -499,6 +735,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -514,13 +758,18 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -530,10 +779,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -542,6 +793,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -557,16 +814,17 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSchedulingPolicyConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -575,7 +833,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi ), }, { - Config: testAccSchedulingPolicyConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -585,6 +849,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -600,16 +871,19 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccSchedulingPolicyConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -619,6 +893,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -634,16 +916,18 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccSchedulingPolicyConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -652,6 +936,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -667,16 +958,18 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.BatchServiceID), + CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccSchedulingPolicyConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -685,6 +978,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag ), }, { + ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -692,69 +992,3 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag }, }) } - -func testAccSchedulingPolicyConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - -} -`, rName) -} - -func testAccSchedulingPolicyConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccSchedulingPolicyConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccSchedulingPolicyConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_batch_scheduling_policy" "test" { - name = %[1]q - - fair_share_policy { - compute_reservation = 0 - share_decay_seconds = 0 - } - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags0_default1_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags0_default1_gen.tf new file mode 100644 index 00000000000..c9502b7d454 --- /dev/null +++ b/internal/service/batch/testdata/ComputeEnvironment/tags0_default1_gen.tf @@ -0,0 +1,91 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_batch_compute_environment" "test" { + compute_environment_name = var.rName + service_role = aws_iam_role.batch_service.arn + type = "UNMANAGED" + + + depends_on = [aws_iam_role_policy_attachment.batch_service] +} + +data "aws_partition" "current" {} + +resource "aws_iam_role" "batch_service" { + name = "${var.rName}-batch-service" + + assume_role_policy = < Date: Thu, 18 Apr 2024 14:03:23 -0700 Subject: [PATCH 06/23] Updates tag tests for `acmpca` --- internal/generate/tagstests/test.go.tmpl | 4 +- .../certificate_authority_tags_gen_test.go | 618 ++++++++++++------ .../tags0_default1_gen.tf | 42 ++ .../tags0_default2_gen.tf | 54 ++ .../CertificateAuthority/tags0_gen.tf | 25 + .../tags1_default1_gen.tf | 55 ++ .../CertificateAuthority/tags1_gen.tf | 38 ++ .../tags2_default1_gen.tf | 66 ++ .../tags2_default2_gen.tf | 78 +++ .../CertificateAuthority/tags2_gen.tf | 49 ++ .../tagsNull_default1_gen.tf | 50 ++ .../CertificateAuthority/tagsNull_gen.tf | 33 + .../tmpl/certificate_authority_tags.tmpl | 2 +- 13 files changed, 909 insertions(+), 205 deletions(-) create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags0_default1_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags0_default2_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags0_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags1_default1_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags1_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags2_default1_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags2_default2_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags2_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf create mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index a50d150032a..fd192aad4c5 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -47,8 +47,8 @@ import ( {{ if .ExistsTypePackage -}} "{{ .ExistsTypePackage }}" {{- end }} - {{- if eq .Generator "" }} - "github.com/hashicorp/terraform-plugin-testing/config" + "github.com/hashicorp/terraform-plugin-testing/config" + {{- if eq .Generator "" }} sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" {{- end }} "github.com/hashicorp/terraform-plugin-testing/helper/resource" diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index 4364940c80a..3d45f75c837 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -3,10 +3,10 @@ package acmpca_test import ( - "fmt" "testing" "github.com/aws/aws-sdk-go-v2/service/acmpca/types" + "github.com/hashicorp/terraform-plugin-testing/config" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" @@ -21,11 +21,16 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -33,6 +38,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -41,7 +52,14 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - Config: testAccCertificateAuthorityConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -50,6 +68,14 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -58,7 +84,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -66,6 +97,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -74,13 +111,20 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - Config: testAccCertificateAuthorityConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -101,17 +145,26 @@ func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -120,7 +173,10 @@ func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { }, }, { - Config: testAccCertificateAuthorityConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -137,18 +193,26 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -156,6 +220,12 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -176,11 +246,16 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -188,6 +263,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -196,13 +277,20 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - Config: testAccCertificateAuthorityConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -223,11 +311,16 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -235,7 +328,14 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - Config: testAccCertificateAuthorityConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -244,6 +344,14 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -252,7 +360,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) }, }, { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -260,6 +373,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -280,11 +399,16 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -292,7 +416,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ), }, { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -300,6 +429,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -318,16 +453,17 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -336,6 +472,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -344,10 +486,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -357,6 +503,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -365,10 +519,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -377,6 +533,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -385,10 +547,11 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -396,6 +559,11 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -414,16 +582,19 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccCertificateAuthorityConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -434,6 +605,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -442,10 +621,16 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccCertificateAuthorityConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -458,6 +643,16 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -466,10 +661,11 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -477,6 +673,11 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -495,16 +696,19 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccCertificateAuthorityConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -514,6 +718,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -522,10 +734,18 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccCertificateAuthorityConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -537,6 +757,18 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -545,10 +777,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccCertificateAuthorityConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -558,6 +794,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -576,13 +820,18 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -592,10 +841,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -604,6 +855,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -622,16 +879,17 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccCertificateAuthorityConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -640,7 +898,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * ), }, { - Config: testAccCertificateAuthorityConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -650,6 +914,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -668,16 +939,19 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccCertificateAuthorityConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -687,6 +961,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -705,16 +987,18 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccCertificateAuthorityConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -723,6 +1007,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -741,16 +1032,18 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour rName := acctest.RandomDomainName() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ACMPCAServiceID), + CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccCertificateAuthorityConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -759,6 +1052,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour ), }, { + ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -769,89 +1069,3 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour }, }) } - -func testAccCertificateAuthorityConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - -} -`, rName) -} - -func testAccCertificateAuthorityConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccCertificateAuthorityConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccCertificateAuthorityConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = %[1]q - } - } - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1_gen.tf new file mode 100644 index 00000000000..2353de482fc --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1_gen.tf @@ -0,0 +1,42 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2_gen.tf new file mode 100644 index 00000000000..366b46cea8d --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2_gen.tf @@ -0,0 +1,54 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_gen.tf new file mode 100644 index 00000000000..1e476270021 --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags0_gen.tf @@ -0,0 +1,25 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1_gen.tf new file mode 100644 index 00000000000..b650c27f538 --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1_gen.tf @@ -0,0 +1,55 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags1_gen.tf new file mode 100644 index 00000000000..e61b1948bd4 --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags1_gen.tf @@ -0,0 +1,38 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1_gen.tf new file mode 100644 index 00000000000..5fc3039167d --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1_gen.tf @@ -0,0 +1,66 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2_gen.tf new file mode 100644 index 00000000000..84c53791cee --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2_gen.tf @@ -0,0 +1,78 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2_gen.tf new file mode 100644 index 00000000000..45dceb03677 --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags2_gen.tf @@ -0,0 +1,49 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..b03778d6a68 --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf @@ -0,0 +1,50 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf new file mode 100644 index 00000000000..500b35ea02b --- /dev/null +++ b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf @@ -0,0 +1,33 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_acmpca_certificate_authority" "test" { + permanent_deletion_time_in_days = 7 + usage_mode = "SHORT_LIVED_CERTIFICATE" + + certificate_authority_configuration { + key_algorithm = "RSA_4096" + signing_algorithm = "SHA512WITHRSA" + + subject { + common_name = var.rName + } + } + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl b/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl index f9e0b0d47e9..9601ddfd5e6 100644 --- a/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl +++ b/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl @@ -7,7 +7,7 @@ resource "aws_acmpca_certificate_authority" "test" { signing_algorithm = "SHA512WITHRSA" subject { - common_name = %[1]q + common_name = var.rName } } {{- template "tags" . }} From 86627f6ed3f76df31698d2772285fe74ecd9842a Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 23 Apr 2024 13:32:38 -0700 Subject: [PATCH 07/23] Updates tag tests for `accessanalyzer` --- .../accessanalyzer/analyzer_tags_gen_test.go | 531 ++++++++++++++---- .../testdata/Analyzer/tags0_default1_gen.tf | 32 ++ .../testdata/Analyzer/tags0_default2_gen.tf | 44 ++ .../testdata/Analyzer/tags0_gen.tf | 15 + .../testdata/Analyzer/tags1_default1_gen.tf | 45 ++ .../testdata/Analyzer/tags1_gen.tf | 28 + .../testdata/Analyzer/tags2_default1_gen.tf | 56 ++ .../testdata/Analyzer/tags2_default2_gen.tf | 68 +++ .../testdata/Analyzer/tags2_gen.tf | 39 ++ .../Analyzer/tagsNull_default1_gen.tf | 40 ++ .../testdata/Analyzer/tagsNull_gen.tf | 23 + .../testdata/tmpl/analyzer_tags.tmpl | 4 + 12 files changed, 810 insertions(+), 115 deletions(-) create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags0_default1_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags0_default2_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags0_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags1_default1_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags1_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags2_default1_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags2_default2_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags2_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.tmpl diff --git a/internal/service/accessanalyzer/analyzer_tags_gen_test.go b/internal/service/accessanalyzer/analyzer_tags_gen_test.go index 5890437c03f..6961def1842 100644 --- a/internal/service/accessanalyzer/analyzer_tags_gen_test.go +++ b/internal/service/accessanalyzer/analyzer_tags_gen_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -40,11 +41,16 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -52,12 +58,25 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAnalyzerConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -66,12 +85,25 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAnalyzerConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -79,18 +111,31 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAnalyzerConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -108,23 +153,35 @@ func testAccAccessAnalyzerAnalyzer_tags_null(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAnalyzerConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -141,18 +198,26 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -160,6 +225,12 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -177,11 +248,16 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -189,18 +265,31 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAnalyzerConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -218,11 +307,16 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -230,7 +324,14 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccAnalyzerConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -239,12 +340,25 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -252,6 +366,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -269,11 +389,16 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -281,7 +406,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - Config: testAccAnalyzerConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -289,6 +419,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -304,16 +440,17 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccAnalyzerConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -322,15 +459,25 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccAnalyzerConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -340,15 +487,25 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccAnalyzerConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -357,15 +514,22 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccAnalyzerConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -373,6 +537,11 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -388,16 +557,19 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccAnalyzerConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -408,15 +580,29 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccAnalyzerConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -429,15 +615,26 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccAnalyzerConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -445,6 +642,11 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -460,16 +662,19 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccAnalyzerConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -479,15 +684,31 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccAnalyzerConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -499,15 +720,31 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccAnalyzerConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -517,6 +754,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -532,13 +777,18 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -548,10 +798,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccAnalyzerConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -560,6 +812,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -575,16 +833,17 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccAnalyzerConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -593,7 +852,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test ), }, { - Config: testAccAnalyzerConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -603,6 +868,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -618,16 +890,19 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccAnalyzerConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -637,6 +912,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -652,16 +935,18 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccAnalyzerConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -670,6 +955,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -685,16 +977,18 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.Test(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckAnalyzerDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t); testAccPreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.AccessAnalyzerServiceID), + CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccAnalyzerConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -703,6 +997,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa ), }, { + ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1_gen.tf new file mode 100644 index 00000000000..c29739f43d5 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1_gen.tf @@ -0,0 +1,32 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2_gen.tf new file mode 100644 index 00000000000..73247985566 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2_gen.tf @@ -0,0 +1,44 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_gen.tf new file mode 100644 index 00000000000..d53964ee3e8 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags0_gen.tf @@ -0,0 +1,15 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1_gen.tf new file mode 100644 index 00000000000..6af610f497e --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1_gen.tf @@ -0,0 +1,45 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags1_gen.tf new file mode 100644 index 00000000000..74a62d1920b --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags1_gen.tf @@ -0,0 +1,28 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1_gen.tf new file mode 100644 index 00000000000..71e15c43d86 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1_gen.tf @@ -0,0 +1,56 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2_gen.tf new file mode 100644 index 00000000000..1104047ad29 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2_gen.tf @@ -0,0 +1,68 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2_gen.tf new file mode 100644 index 00000000000..5b0227f8b94 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags2_gen.tf @@ -0,0 +1,39 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..0fa82aca4f1 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf @@ -0,0 +1,40 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf new file mode 100644 index 00000000000..a48487f006d --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf @@ -0,0 +1,23 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.tmpl b/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.tmpl new file mode 100644 index 00000000000..266f6c2dd20 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.tmpl @@ -0,0 +1,4 @@ +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName +{{- template "tags" . }} +} From d8b4453ae56721e8cf71d2539c6d38e3264b477f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 23 Apr 2024 17:44:47 -0700 Subject: [PATCH 08/23] Updates tag tests for `servicecatalog` --- internal/generate/tagstests/main.go | 66 ++- internal/generate/tagstests/test.go.tmpl | 23 +- .../servicecatalog/portfolio_tags_gen_test.go | 531 ++++++++++++++---- .../service/servicecatalog/portfolio_test.go | 39 -- .../servicecatalog/product_tags_gen_test.go | 531 ++++++++++++++---- .../servicecatalog/provisioned_product.go | 2 +- .../provisioned_product_tags_test.go | 531 ++++++++++++++---- .../provisioned_product_test.go | 85 +-- .../testdata/Portfolio/tags0_default1_gen.tf | 34 ++ .../testdata/Portfolio/tags0_default2_gen.tf | 46 ++ .../testdata/Portfolio/tags0_gen.tf | 17 + .../testdata/Portfolio/tags1_default1_gen.tf | 47 ++ .../testdata/Portfolio/tags1_gen.tf | 30 + .../testdata/Portfolio/tags2_default1_gen.tf | 58 ++ .../testdata/Portfolio/tags2_default2_gen.tf | 70 +++ .../testdata/Portfolio/tags2_gen.tf | 41 ++ .../Portfolio/tagsNull_default1_gen.tf | 42 ++ .../testdata/Portfolio/tagsNull_gen.tf | 25 + .../testdata/Product/tags0_default1_gen.tf | 78 +++ .../testdata/Product/tags0_default2_gen.tf | 90 +++ .../testdata/Product/tags0_gen.tf | 61 ++ .../testdata/Product/tags1_default1_gen.tf | 91 +++ .../testdata/Product/tags1_gen.tf | 74 +++ .../testdata/Product/tags2_default1_gen.tf | 102 ++++ .../testdata/Product/tags2_default2_gen.tf | 114 ++++ .../testdata/Product/tags2_gen.tf | 85 +++ .../testdata/Product/tagsNull_default1_gen.tf | 86 +++ .../testdata/Product/tagsNull_gen.tf | 69 +++ .../ProvisionedProduct/tags0_default1_gen.tf | 125 +++++ .../ProvisionedProduct/tags0_default2_gen.tf | 137 +++++ .../testdata/ProvisionedProduct/tags0_gen.tf | 108 ++++ .../ProvisionedProduct/tags1_default1_gen.tf | 138 +++++ .../testdata/ProvisionedProduct/tags1_gen.tf | 121 ++++ .../ProvisionedProduct/tags2_default1_gen.tf | 149 +++++ .../ProvisionedProduct/tags2_default2_gen.tf | 161 ++++++ .../testdata/ProvisionedProduct/tags2_gen.tf | 132 +++++ .../tagsNull_default1_gen.tf | 133 +++++ .../ProvisionedProduct/tagsNull_gen.tf | 116 ++++ .../testdata/tmpl/portfolio_tags.tmpl | 6 + .../testdata/tmpl/product_tags.tmpl | 50 ++ .../tmpl/provisioned_product_tags.tmpl | 97 ++++ 41 files changed, 4042 insertions(+), 499 deletions(-) create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags0_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf create mode 100644 internal/service/servicecatalog/testdata/tmpl/portfolio_tags.tmpl create mode 100644 internal/service/servicecatalog/testdata/tmpl/product_tags.tmpl create mode 100644 internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.tmpl diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 8a53cfe898c..d4eb5acaded 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -26,6 +26,8 @@ import ( ) func main() { + failed := false + g := common.NewGenerator() serviceData, err := data.ReadAllServiceData() @@ -76,16 +78,26 @@ func main() { sourceName := foo.FileName ext := filepath.Ext(sourceName) sourceName = strings.TrimSuffix(sourceName, ext) - filename := fmt.Sprintf("%s_tags_gen_test.go", sourceName) - - d := g.NewGoFileDestination(filename) foo.ProviderNameUpper = serviceRecord.ProviderNameUpper() foo.ProviderPackage = servicePackage - templates, err := template.New("taggingtests").Parse(testGoTmpl) - if err != nil { - g.Fatalf("parsing base Go test template: %w", err) + if foo.GenerateTests { + filename := fmt.Sprintf("%s_tags_gen_test.go", sourceName) + + d := g.NewGoFileDestination(filename) + templates, err := template.New("taggingtests").Parse(testGoTmpl) + if err != nil { + g.Fatalf("parsing base Go test template: %w", err) + } + + if err := d.WriteTemplateSet(templates, foo); err != nil { + g.Fatalf("error generating %q service package data: %s", servicePackage, err) + } + + if err := d.Write(); err != nil { + g.Fatalf("generating file (%s): %s", filename, err) + } } configTmplFile := path.Join("testdata", "tmpl", fmt.Sprintf("%s_tags.tmpl", sourceName)) @@ -98,25 +110,12 @@ func main() { configTmpl = string(b) foo.GenerateConfig = true } else if errors.Is(err, os.ErrNotExist) { - // TODO: This will be an error when composed configurations are implemented. - g.Warnf("no tags template found for %s at %q", sourceName, configTmplFile) + g.Errorf("no tags template found for %s at %q", sourceName, configTmplFile) + failed = true } else { g.Fatalf("opening config template %q: %w", configTmplFile, err) } - _, err = templates.New("config").Parse(configTmpl) - if err != nil { - g.Fatalf("parsing config template %q: %w", configTmplFile, err) - } - - if err := d.WriteTemplateSet(templates, foo); err != nil { - g.Fatalf("error generating %q service package data: %s", servicePackage, err) - } - - if err := d.Write(); err != nil { - g.Fatalf("generating file (%s): %s", filename, err) - } - if foo.GenerateConfig { testDirPath := path.Join("testdata", foo.Name) err = os.MkdirAll(testDirPath, 0755) @@ -136,6 +135,10 @@ func main() { generateTestConfig(g, testDirPath, "tagsNull", 1, configTmplFile, configTmpl) } } + + if failed { + os.Exit(1) + } } type implementation string @@ -161,7 +164,7 @@ type ResourceDatum struct { SkipEmptyTags bool // TODO: Remove when we have a strategy for resources that have a minimum tag value length of 1 GoImports []goImport GenerateConfig bool - Tags string + GenerateTests bool } type goImport struct { @@ -238,7 +241,8 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { // Look first for tagging annotations. d := ResourceDatum{ - FileName: v.fileName, + FileName: v.fileName, + GenerateTests: true, } tagged := false skip := false @@ -332,12 +336,20 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { } } if attr, ok := args.Keyword["tagsTest"]; ok { - if b, err := strconv.ParseBool(attr); err != nil { - v.errs = append(v.errs, fmt.Errorf("invalid tagsTest value: %q at %s. Should be boolean value.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) - continue - } else if !b { + switch attr { + case "true": + // no-op + + case "false": v.g.Infof("Skipping tags test for %s.%s", v.packageName, v.functionName) skip = true + + case "config-only": + d.GenerateTests = false + + default: + v.errs = append(v.errs, fmt.Errorf("invalid tagsTest value: %q at %s.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + continue } } if attr, ok := args.Keyword["skipEmptyTags"]; ok { diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index fd192aad4c5..06ef6309bd0 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -44,16 +44,19 @@ package {{ .ProviderPackage }}_test import ( "testing" - {{ if .ExistsTypePackage -}} + {{ if .ExistsTypePackage -}} "{{ .ExistsTypePackage }}" - {{- end }} - "github.com/hashicorp/terraform-plugin-testing/config" - {{- if eq .Generator "" }} + {{- end }} + "github.com/hashicorp/terraform-plugin-testing/config" + {{- if eq .Generator "" }} sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" {{- end }} "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" "github.com/hashicorp/terraform-provider-aws/names" + {{ range .GoImports -}} + {{ if .Alias }}{{ .Alias }} {{ end }}"{{ .Path }}" + {{ end }} ) {{ if .Serialize }} @@ -258,6 +261,9 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { } func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { +{{- if .SkipEmptyTags }} + t.Skip("Resource {{ .Name }} does not support empty tags") +{{ end }} {{- template "Init" . }} resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ @@ -307,6 +313,9 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { } func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { +{{- if .SkipEmptyTags }} + t.Skip("Resource {{ .Name }} does not support empty tags") +{{ end }} {{- template "Init" . }} resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ @@ -379,6 +388,9 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { } func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { +{{- if .SkipEmptyTags }} + t.Skip("Resource {{ .Name }} does not support empty tags") +{{ end }} {{- template "Init" . }} resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ @@ -825,6 +837,9 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin } func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) { +{{- if .SkipEmptyTags }} + t.Skip("Resource {{ .Name }} does not support empty tags") +{{ end }} {{- template "Init" . }} resource.{{ if .Serialize }}Test{{ else }}ParallelTest{{ end }}(t, resource.TestCase{ diff --git a/internal/service/servicecatalog/portfolio_tags_gen_test.go b/internal/service/servicecatalog/portfolio_tags_gen_test.go index 3a13209896e..7308293f590 100644 --- a/internal/service/servicecatalog/portfolio_tags_gen_test.go +++ b/internal/service/servicecatalog/portfolio_tags_gen_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -21,11 +22,16 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPortfolioDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -33,12 +39,25 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPortfolioConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -47,12 +66,25 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPortfolioConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -60,18 +92,31 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPortfolioConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -89,23 +134,35 @@ func TestAccServiceCatalogPortfolio_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPortfolioDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPortfolioConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -122,18 +179,26 @@ func TestAccServiceCatalogPortfolio_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPortfolioDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -141,6 +206,12 @@ func TestAccServiceCatalogPortfolio_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -160,11 +231,16 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPortfolioDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -172,18 +248,31 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPortfolioConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -203,11 +292,16 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPortfolioDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -215,7 +309,14 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccPortfolioConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -224,12 +325,25 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -237,6 +351,12 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -256,11 +376,16 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckPortfolioDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -268,7 +393,12 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - Config: testAccPortfolioConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -276,6 +406,12 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -291,16 +427,17 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPortfolioConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -309,15 +446,25 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccPortfolioConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -327,15 +474,25 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccPortfolioConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -344,15 +501,22 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccPortfolioConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -360,6 +524,11 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -375,16 +544,19 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccPortfolioConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -395,15 +567,29 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccPortfolioConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -416,15 +602,26 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccPortfolioConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -432,6 +629,11 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -447,16 +649,19 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccPortfolioConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -466,15 +671,31 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccPortfolioConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -486,15 +707,31 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccPortfolioConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -504,6 +741,14 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -519,13 +764,18 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -535,10 +785,12 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPortfolioConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -547,6 +799,12 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -562,16 +820,17 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPortfolioConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -580,7 +839,13 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes ), }, { - Config: testAccPortfolioConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -590,6 +855,13 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -607,16 +879,19 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccPortfolioConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -626,6 +901,14 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -641,16 +924,18 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccPortfolioConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -659,6 +944,13 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -674,16 +966,18 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT rName := sdkacctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckPortfolioDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccPortfolioConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckPortfolioExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -692,6 +986,13 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT ), }, { + ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/servicecatalog/portfolio_test.go b/internal/service/servicecatalog/portfolio_test.go index 7cd4e8e3203..bbb1263b7ed 100644 --- a/internal/service/servicecatalog/portfolio_test.go +++ b/internal/service/servicecatalog/portfolio_test.go @@ -138,16 +138,6 @@ resource "aws_servicecatalog_portfolio" "test" { `, name) } -func testAccPortfolioConfig_tags0(name string) string { - return fmt.Sprintf(` -resource "aws_servicecatalog_portfolio" "test" { - name = %[1]q - description = "test-b" - provider_name = "test-c" -} -`, name) -} - func testAccPortfolioConfig_tags1(name, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_servicecatalog_portfolio" "test" { @@ -161,32 +151,3 @@ resource "aws_servicecatalog_portfolio" "test" { } `, name, tagKey1, tagValue1) } - -func testAccPortfolioConfig_tags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_servicecatalog_portfolio" "test" { - name = %[1]q - description = "test-only-change-me" - provider_name = "test-c" - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, name, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccPortfolioConfig_tagsNull(name, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_servicecatalog_portfolio" "test" { - name = %[1]q - description = "test-b" - provider_name = "test-c" - - tags = { - %[2]q = null - } -} -`, name, tagKey1) -} diff --git a/internal/service/servicecatalog/product_tags_gen_test.go b/internal/service/servicecatalog/product_tags_gen_test.go index fa7b8e140ca..c79b1387b5b 100644 --- a/internal/service/servicecatalog/product_tags_gen_test.go +++ b/internal/service/servicecatalog/product_tags_gen_test.go @@ -5,6 +5,7 @@ package servicecatalog_test import ( "testing" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -19,11 +20,16 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -31,6 +37,12 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -39,7 +51,14 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { }, }, { - Config: testAccProductConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -48,6 +67,14 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -56,7 +83,12 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { }, }, { - Config: testAccProductConfig_tags1(rName, "key2", "value2"), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -64,6 +96,12 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key2"), + "tagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -72,13 +110,20 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { }, }, { - Config: testAccProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -98,17 +143,26 @@ func TestAccServiceCatalogProduct_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/Product/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Product/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -117,7 +171,10 @@ func TestAccServiceCatalogProduct_tags_null(t *testing.T) { }, }, { - Config: testAccProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -133,18 +190,26 @@ func TestAccServiceCatalogProduct_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -152,6 +217,12 @@ func TestAccServiceCatalogProduct_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -173,11 +244,16 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -185,6 +261,12 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -193,13 +275,20 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - Config: testAccProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -221,11 +310,16 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -233,7 +327,14 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - Config: testAccProductConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -242,6 +343,14 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -250,7 +359,12 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -258,6 +372,12 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -279,11 +399,16 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -291,7 +416,12 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - Config: testAccProductConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -299,6 +429,12 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -316,16 +452,17 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -334,6 +471,12 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -342,10 +485,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Product/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -355,6 +502,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -363,10 +518,12 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key2", "value2"), - testAccProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -375,6 +532,12 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key2"), + "providerTagValue1": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -383,10 +546,11 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccProductConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -394,6 +558,11 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -411,16 +580,19 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccProductConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -431,6 +603,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -439,10 +619,16 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccProductConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Product/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -455,6 +641,16 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -463,10 +659,11 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags0(), - testAccProductConfig_tags0(rName), - ), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -474,6 +671,11 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -491,16 +693,19 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccProductConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -510,6 +715,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -518,10 +731,18 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccProductConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Product/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -533,6 +754,18 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -541,10 +774,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccProductConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -554,6 +791,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -571,13 +816,18 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -587,10 +837,12 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -599,6 +851,12 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -616,16 +874,17 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -634,7 +893,13 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi ), }, { - Config: testAccProductConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -644,6 +909,13 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -663,16 +935,19 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProductConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -682,6 +957,14 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -699,16 +982,18 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccProductConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -717,6 +1002,13 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { + ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -734,16 +1026,18 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccProductConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProductExists(ctx, resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -752,6 +1046,13 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag ), }, { + ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/servicecatalog/provisioned_product.go b/internal/service/servicecatalog/provisioned_product.go index 6a558d99cf1..cc9f3ed8e4f 100644 --- a/internal/service/servicecatalog/provisioned_product.go +++ b/internal/service/servicecatalog/provisioned_product.go @@ -30,7 +30,7 @@ import ( // @SDKResource("aws_servicecatalog_provisioned_product", name="Provisioned Product") // @Tags -// @Testing(tagsTest=false, existsType="github.com/aws/aws-sdk-go/service/servicecatalog.ProvisionedProductDetail",importIgnore="accept_language;ignore_errors;provisioning_artifact_name;provisioning_parameters;retain_physical_resources", skipEmptyTags=true) +// @Testing(tagsTest=config-only, existsType="github.com/aws/aws-sdk-go/service/servicecatalog.ProvisionedProductDetail",importIgnore="accept_language;ignore_errors;provisioning_artifact_name;provisioning_parameters;retain_physical_resources", skipEmptyTags=true) func ResourceProvisionedProduct() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceProvisionedProductCreate, diff --git a/internal/service/servicecatalog/provisioned_product_tags_test.go b/internal/service/servicecatalog/provisioned_product_tags_test.go index 46f525aff34..cac58d74a15 100644 --- a/internal/service/servicecatalog/provisioned_product_tags_test.go +++ b/internal/service/servicecatalog/provisioned_product_tags_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/servicecatalog" + "github.com/hashicorp/terraform-plugin-testing/config" sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" "github.com/hashicorp/terraform-plugin-testing/helper/resource" "github.com/hashicorp/terraform-provider-aws/internal/acctest" @@ -22,11 +23,16 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -34,6 +40,12 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -42,7 +54,14 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { }, }, { - Config: testAccProvisionedProductConfig_tags2(rName, "key1", "value1updated", "key2", "value2"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -51,6 +70,14 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1updated"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -59,7 +86,12 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { }, }, // { - // Config: testAccProvisionedProductConfig_tags1(rName, "key2", "value2"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // "tagKey1": config.StringVariable("key2"), + // "tagValue1": config.StringVariable("value2"), + // }, // Check: resource.ComposeAggregateTestCheckFunc( // testAccCheckProvisionedProductExists(ctx, resourceName, &v), // resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -67,6 +99,12 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // ), // }, // { + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // "tagKey1": config.StringVariable("key2"), + // "tagValue1": config.StringVariable("value2"), + // }, // ResourceName: resourceName, // ImportState: true, // ImportStateVerify: true, @@ -75,13 +113,20 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // }, // }, // { - // Config: testAccProvisionedProductConfig_tags0(rName), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // }, // Check: resource.ComposeAggregateTestCheckFunc( // testAccCheckProvisionedProductExists(ctx, resourceName, &v), // resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), // ), // }, // { + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // }, // ResourceName: resourceName, // ImportState: true, // ImportStateVerify: true, @@ -102,17 +147,26 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tagsNull(rName, "key1"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -121,7 +175,10 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { }, }, { - Config: testAccProvisionedProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, PlanOnly: true, ExpectNonEmptyPlan: false, }, @@ -138,18 +195,26 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -157,6 +222,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -179,11 +250,16 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -191,6 +267,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -199,13 +281,20 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T }, }, { - Config: testAccProvisionedProductConfig_tags0(rName), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -228,11 +317,16 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -240,7 +334,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - Config: testAccProvisionedProductConfig_tags2(rName, "key1", "value1", "key2", ""), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -249,6 +350,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + "tagKey2": config.StringVariable("key2"), + "tagValue2": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -257,7 +366,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi }, }, { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -265,6 +379,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -287,11 +407,16 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(ctx, t) }, ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -299,7 +424,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ), }, { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", ""), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -307,6 +437,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -325,16 +461,17 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProvisionedProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -343,6 +480,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -351,10 +494,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("key1", "value1updated", "key2", "value2"), - testAccProvisionedProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -364,6 +511,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1updated"), + "providerTagKey2": config.StringVariable("key2"), + "providerTagValue2": config.StringVariable("value2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -372,10 +527,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te }, }, // { - // Config: acctest.ConfigCompose( - // acctest.ConfigDefaultTags_Tags1("key2", "value2"), - // testAccProvisionedProductConfig_tags0(rName), - // ), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // "providerTagKey1": config.StringVariable("key2"), + // "providerTagValue1": config.StringVariable("value2"), + // }, // Check: resource.ComposeAggregateTestCheckFunc( // testAccCheckProvisionedProductExists(ctx, resourceName, &v), // resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -384,6 +541,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // ), // }, // { + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // "providerTagKey1": config.StringVariable("key2"), + // "providerTagValue1": config.StringVariable("value2"), + // }, // ResourceName: resourceName, // ImportState: true, // ImportStateVerify: true, @@ -392,10 +555,11 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // }, // }, // { - // Config: acctest.ConfigCompose( - // acctest.ConfigDefaultTags_Tags0(), - // testAccProvisionedProductConfig_tags0(rName), - // ), + // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // }, // Check: resource.ComposeAggregateTestCheckFunc( // testAccCheckProvisionedProductExists(ctx, resourceName, &v), // resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -403,6 +567,11 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // ), // }, // { + // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // }, // ResourceName: resourceName, // ImportState: true, // ImportStateVerify: true, @@ -421,16 +590,19 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccProvisionedProductConfig_tags1(rName, "resourcekey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -441,6 +613,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -449,10 +629,16 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1updated"), - testAccProvisionedProductConfig_tags2(rName, "resourcekey1", "resourcevalue1updated", "resourcekey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -465,6 +651,16 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1updated"), + "tagKey1": config.StringVariable("resourcekey1"), + "tagValue1": config.StringVariable("resourcevalue1updated"), + "tagKey2": config.StringVariable("resourcekey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -473,10 +669,11 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * }, }, // { - // Config: acctest.ConfigCompose( - // acctest.ConfigDefaultTags_Tags0(), - // testAccProvisionedProductConfig_tags0(rName), - // ), + // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // }, // Check: resource.ComposeAggregateTestCheckFunc( // testAccCheckProvisionedProductExists(ctx, resourceName, &v), // resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -484,6 +681,11 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * // ), // }, // { + // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigVariables: config.Variables{ + // "rName": config.StringVariable(rName), + // }, // ResourceName: resourceName, // ImportState: true, // ImportStateVerify: true, @@ -502,16 +704,19 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccProvisionedProductConfig_tags1(rName, "overlapkey1", "resourcevalue1"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -521,6 +726,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -529,10 +742,18 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), - testAccProvisionedProductConfig_tags2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -544,6 +765,18 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "providerTagKey2": config.StringVariable("overlapkey2"), + "providerTagValue2": config.StringVariable("providervalue2"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue1"), + "tagKey2": config.StringVariable("overlapkey2"), + "tagValue2": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -552,10 +785,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes }, }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), - testAccProvisionedProductConfig_tags1(rName, "overlapkey1", "resourcevalue2"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -565,6 +802,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("overlapkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("overlapkey1"), + "tagValue1": config.StringVariable("resourcevalue2"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -583,13 +828,18 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -599,10 +849,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn ), }, { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProvisionedProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -611,6 +863,12 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -629,16 +887,17 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProvisionedProductConfig_tags0(rName), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -647,7 +906,13 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn ), }, { - Config: testAccProvisionedProductConfig_tags1(rName, "key1", "value1"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -657,6 +922,13 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn ), }, { + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable("value1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -677,16 +949,19 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "value1"), - testAccProvisionedProductConfig_tags1(rName, "key1", ""), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -696,6 +971,14 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("value1"), + "tagKey1": config.StringVariable("key1"), + "tagValue1": config.StringVariable(""), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -714,16 +997,18 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("key1", "providervalue1"), - testAccProvisionedProductConfig_tagsNull(rName, "key1"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -732,6 +1017,13 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("key1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("key1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, @@ -750,16 +1042,18 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { acctest.PreCheck(ctx, t) }, - ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), - ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), + PreCheck: func() { acctest.PreCheck(ctx, t) }, + ErrorCheck: acctest.ErrorCheck(t, names.ServiceCatalogServiceID), + CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - Config: acctest.ConfigCompose( - acctest.ConfigDefaultTags_Tags1("providerkey1", "providervalue1"), - testAccProvisionedProductConfig_tagsNull(rName, "resourcekey1"), - ), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckProvisionedProductExists(ctx, resourceName, &v), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), @@ -768,6 +1062,13 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping ), }, { + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigVariables: config.Variables{ + "rName": config.StringVariable(rName), + "providerTagKey1": config.StringVariable("providerkey1"), + "providerTagValue1": config.StringVariable("providervalue1"), + "tagKey1": config.StringVariable("resourcekey1"), + }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, diff --git a/internal/service/servicecatalog/provisioned_product_test.go b/internal/service/servicecatalog/provisioned_product_test.go index a13f095008e..aa9a905e6e6 100644 --- a/internal/service/servicecatalog/provisioned_product_test.go +++ b/internal/service/servicecatalog/provisioned_product_test.go @@ -549,7 +549,7 @@ resource "aws_servicecatalog_constraint" "test" { } resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id # avoid depends_on + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id product_id = aws_servicecatalog_product.test.id } @@ -565,7 +565,7 @@ resource "aws_servicecatalog_principal_portfolio_association" "test" { } data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id # avoid depends_on + product_id = aws_servicecatalog_product_portfolio_association.test.product_id } `, rName) } @@ -988,84 +988,3 @@ resource "aws_s3_bucket" "conflict" { } `, rName, conflictingBucketName, tagValue)) } - -func testAccProvisionedProductConfig_tags0(rName string) string { - return acctest.ConfigCompose(testAccProvisionedProductTemplateURLSimpleBaseConfig(rName), - fmt.Sprintf(` -resource "aws_servicecatalog_provisioned_product" "test" { - name = %[1]q - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = %[1]q - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "%[1]s-dest" - } -} -`, rName)) -} - -func testAccProvisionedProductConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccProvisionedProductTemplateURLSimpleBaseConfig(rName), - fmt.Sprintf(` -resource "aws_servicecatalog_provisioned_product" "test" { - name = %[1]q - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = %[1]q - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "%[1]s-dest" - } - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1)) -} - -func testAccProvisionedProductConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccProvisionedProductTemplateURLSimpleBaseConfig(rName), - fmt.Sprintf(` -resource "aws_servicecatalog_provisioned_product" "test" { - name = %[1]q - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = %[1]q - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "%[1]s-dest" - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2)) -} - -func testAccProvisionedProductConfig_tagsNull(rName, tagKey1 string) string { - return acctest.ConfigCompose(testAccProvisionedProductTemplateURLSimpleBaseConfig(rName), - fmt.Sprintf(` -resource "aws_servicecatalog_provisioned_product" "test" { - name = %[1]q - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = %[1]q - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "%[1]s-dest" - } - - tags = { - %[2]q = null - } -} -`, rName, tagKey1)) -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf new file mode 100644 index 00000000000..fe2c8be86e0 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf @@ -0,0 +1,34 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf new file mode 100644 index 00000000000..1eb18fdccb8 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf @@ -0,0 +1,46 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf new file mode 100644 index 00000000000..08eb335c8ff --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf @@ -0,0 +1,17 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf new file mode 100644 index 00000000000..622333cbe51 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf @@ -0,0 +1,47 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf new file mode 100644 index 00000000000..812e5b58ff6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf @@ -0,0 +1,30 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf new file mode 100644 index 00000000000..f91afa13141 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf @@ -0,0 +1,58 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf new file mode 100644 index 00000000000..8b03f05a8bb --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf @@ -0,0 +1,70 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf new file mode 100644 index 00000000000..eaed4a5d5b2 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf @@ -0,0 +1,41 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..a1132dcaf1b --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf @@ -0,0 +1,42 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf new file mode 100644 index 00000000000..2d6a573c544 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf @@ -0,0 +1,25 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf new file mode 100644 index 00000000000..ac0ccd45bce --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf @@ -0,0 +1,78 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf new file mode 100644 index 00000000000..88ed5494e34 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf @@ -0,0 +1,90 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags0_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_gen.tf new file mode 100644 index 00000000000..67beb3ee7ce --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags0_gen.tf @@ -0,0 +1,61 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf new file mode 100644 index 00000000000..34d72fba297 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf @@ -0,0 +1,91 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags1_gen.tf new file mode 100644 index 00000000000..30e50a5eac6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags1_gen.tf @@ -0,0 +1,74 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf new file mode 100644 index 00000000000..03d6870806d --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf @@ -0,0 +1,102 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf new file mode 100644 index 00000000000..5a289b36da6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf @@ -0,0 +1,114 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags2_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_gen.tf new file mode 100644 index 00000000000..d24f8ceea7a --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags2_gen.tf @@ -0,0 +1,85 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..e169b91f0c9 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf @@ -0,0 +1,86 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf b/internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf new file mode 100644 index 00000000000..32ca1a0cf00 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf @@ -0,0 +1,69 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf new file mode 100644 index 00000000000..70fbdc93b83 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf @@ -0,0 +1,125 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf new file mode 100644 index 00000000000..b81c80e2ee6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf @@ -0,0 +1,137 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf new file mode 100644 index 00000000000..0975df6166a --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf @@ -0,0 +1,108 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf new file mode 100644 index 00000000000..d2d7283370b --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf @@ -0,0 +1,138 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf new file mode 100644 index 00000000000..4304d040413 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf @@ -0,0 +1,121 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf new file mode 100644 index 00000000000..d21c8c7cba5 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf @@ -0,0 +1,149 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf new file mode 100644 index 00000000000..9d4d551bc57 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf @@ -0,0 +1,161 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf new file mode 100644 index 00000000000..923fb5b6d52 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf @@ -0,0 +1,132 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf new file mode 100644 index 00000000000..3dd3a83c710 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf @@ -0,0 +1,133 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf new file mode 100644 index 00000000000..916375b9914 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf @@ -0,0 +1,116 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/tmpl/portfolio_tags.tmpl b/internal/service/servicecatalog/testdata/tmpl/portfolio_tags.tmpl new file mode 100644 index 00000000000..d15a8e6d0de --- /dev/null +++ b/internal/service/servicecatalog/testdata/tmpl/portfolio_tags.tmpl @@ -0,0 +1,6 @@ +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" +{{- template "tags" . }} +} diff --git a/internal/service/servicecatalog/testdata/tmpl/product_tags.tmpl b/internal/service/servicecatalog/testdata/tmpl/product_tags.tmpl new file mode 100644 index 00000000000..72c231ea622 --- /dev/null +++ b/internal/service/servicecatalog/testdata/tmpl/product_tags.tmpl @@ -0,0 +1,50 @@ +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +{{- template "tags" . }} +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} diff --git a/internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.tmpl b/internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.tmpl new file mode 100644 index 00000000000..1f0ab0b6650 --- /dev/null +++ b/internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.tmpl @@ -0,0 +1,97 @@ +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } +{{- template "tags" . }} +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} From 975464863350b04bd4fbcf31a25331f25611f427 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 18 Apr 2024 14:04:15 -0700 Subject: [PATCH 09/23] Deletes generated acceptance test `.tf.` files when generating --- GNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/GNUmakefile b/GNUmakefile index f84ba0f5e61..cf0e2bb3618 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -187,6 +187,7 @@ gen: prereq-go ## Run all Go generators rm -f internal/provider/*_gen.go rm -f internal/service/**/*_gen.go rm -f internal/service/**/*_gen_test.go + rm -f internal/service/**/*_gen.tf rm -f names/caps.md rm -f names/*_gen.go rm -f website/docs/guides/custom-service-endpoints.html.md From 35972ebbc847b2466ad6bc756e6174e83305af4c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 18 Apr 2024 14:04:42 -0700 Subject: [PATCH 10/23] Renames `copywrite` GHA --- .github/workflows/copyright.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copyright.yml b/.github/workflows/copyright.yml index 7f2d8a7ed31..2eca9d151ba 100644 --- a/.github/workflows/copyright.yml +++ b/.github/workflows/copyright.yml @@ -15,7 +15,7 @@ on: - .goreleaser.yml jobs: - go_generate: + copywrite: name: add headers check runs-on: ubuntu-latest steps: From f95f996f9f84968201576f6dd6fb66f3d56bf129 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 19 Apr 2024 15:07:05 -0700 Subject: [PATCH 11/23] Moves test configurations to separate directories --- internal/generate/tagstests/main.go | 17 +- internal/generate/tagstests/test.go.tmpl | 116 ++++++------- internal/generate/tagstests/test.tf.tmpl | 2 +- .../accessanalyzer/analyzer_tags_gen_test.go | 116 ++++++------- .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../certificate_authority_tags_gen_test.go | 116 ++++++------- .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../compute_environment_tags_gen_test.go | 116 ++++++------- .../batch/job_definition_tags_gen_test.go | 116 ++++++------- .../service/batch/job_queue_tags_gen_test.go | 116 ++++++------- .../batch/scheduling_policy_tags_gen_test.go | 116 ++++++------- .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../iam/instance_profile_tags_gen_test.go | 116 ++++++------- .../openid_connect_provider_tags_gen_test.go | 116 ++++++------- internal/service/iam/policy_tags_gen_test.go | 116 ++++++------- internal/service/iam/role_tags_gen_test.go | 116 ++++++------- .../iam/service_linked_role_tags_gen_test.go | 116 ++++++------- .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../Role/{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../Role/{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../Role/{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../User/{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../User/{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../User/{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - internal/service/iam/user_tags_gen_test.go | 116 ++++++------- .../iam/virtual_mfa_device_tags_gen_test.go | 116 ++++++------- .../servicecatalog/portfolio_tags_gen_test.go | 116 ++++++------- .../servicecatalog/product_tags_gen_test.go | 116 ++++++------- .../provisioned_product_tags_test.go | 116 ++++++------- .../testdata/Portfolio/tags0/main_gen.tf | 17 ++ .../Portfolio/tags0_default1/main_gen.tf | 34 ++++ .../Portfolio/tags0_default2/main_gen.tf | 46 +++++ .../testdata/Portfolio/tags1/main_gen.tf | 30 ++++ .../Portfolio/tags1_default1/main_gen.tf | 47 +++++ .../testdata/Portfolio/tags2/main_gen.tf | 41 +++++ .../Portfolio/tags2_default1/main_gen.tf | 58 +++++++ .../Portfolio/tags2_default2/main_gen.tf | 70 ++++++++ .../testdata/Portfolio/tagsNull/main_gen.tf | 24 +++ .../Portfolio/tagsNull_default1/main_gen.tf | 41 +++++ .../testdata/Product/tags0/main_gen.tf | 61 +++++++ .../Product/tags0_default1/main_gen.tf | 78 +++++++++ .../Product/tags0_default2/main_gen.tf | 90 ++++++++++ .../testdata/Product/tags1/main_gen.tf | 74 ++++++++ .../Product/tags1_default1/main_gen.tf | 91 ++++++++++ .../testdata/Product/tags2/main_gen.tf | 85 +++++++++ .../Product/tags2_default1/main_gen.tf | 102 +++++++++++ .../Product/tags2_default2/main_gen.tf | 114 +++++++++++++ .../testdata/Product/tagsNull/main_gen.tf | 68 ++++++++ .../Product/tagsNull_default1/main_gen.tf | 85 +++++++++ .../ProvisionedProduct/tags0/main_gen.tf | 108 ++++++++++++ .../tags0_default1/main_gen.tf | 125 ++++++++++++++ .../tags0_default2/main_gen.tf | 137 +++++++++++++++ .../ProvisionedProduct/tags1/main_gen.tf | 121 +++++++++++++ .../tags1_default1/main_gen.tf | 138 +++++++++++++++ .../ProvisionedProduct/tags2/main_gen.tf | 132 ++++++++++++++ .../tags2_default1/main_gen.tf | 149 ++++++++++++++++ .../tags2_default2/main_gen.tf | 161 ++++++++++++++++++ .../ProvisionedProduct/tagsNull/main_gen.tf | 115 +++++++++++++ .../tagsNull_default1/main_gen.tf | 132 ++++++++++++++ internal/service/xray/group_tags_gen_test.go | 116 ++++++------- .../xray/sampling_rule_tags_gen_test.go | 116 ++++++------- .../Group/{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../Group/{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../Group/{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - .../{tags0_gen.tf => tags0/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags1_gen.tf => tags1/main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tags2_gen.tf => tags2/main_gen.tf} | 0 .../main_gen.tf} | 0 .../main_gen.tf} | 0 .../{tagsNull_gen.tf => tagsNull/main_gen.tf} | 1 - .../main_gen.tf} | 1 - 201 files changed, 3686 insertions(+), 1141 deletions(-) rename internal/service/accessanalyzer/testdata/Analyzer/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/accessanalyzer/testdata/Analyzer/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/accessanalyzer/testdata/Analyzer/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/acmpca/testdata/CertificateAuthority/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/acmpca/testdata/CertificateAuthority/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/batch/testdata/ComputeEnvironment/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/ComputeEnvironment/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/batch/testdata/ComputeEnvironment/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/batch/testdata/JobDefinition/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/JobDefinition/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/batch/testdata/JobDefinition/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/batch/testdata/JobQueue/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/JobQueue/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/batch/testdata/JobQueue/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/batch/testdata/SchedulingPolicy/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/batch/testdata/SchedulingPolicy/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/batch/testdata/SchedulingPolicy/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/InstanceProfile/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/InstanceProfile/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/InstanceProfile/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/Policy/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/Policy/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/Policy/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/Role/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/Role/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/Role/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/ServiceLinkedRole/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/ServiceLinkedRole/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/User/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/User/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/User/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/iam/testdata/VirtualMFADevice/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/iam/testdata/VirtualMFADevice/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/iam/testdata/VirtualMFADevice/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags1_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tagsNull/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags0/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags1_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tagsNull/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/Product/tagsNull_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull/main_gen.tf create mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf rename internal/service/xray/testdata/Group/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/xray/testdata/Group/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/xray/testdata/Group/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) rename internal/service/xray/testdata/SamplingRule/{tags0_gen.tf => tags0/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags0_default1_gen.tf => tags0_default1/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags0_default2_gen.tf => tags0_default2/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags1_gen.tf => tags1/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags1_default1_gen.tf => tags1_default1/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags2_gen.tf => tags2/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags2_default1_gen.tf => tags2_default1/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tags2_default2_gen.tf => tags2_default2/main_gen.tf} (100%) rename internal/service/xray/testdata/SamplingRule/{tagsNull_gen.tf => tagsNull/main_gen.tf} (99%) rename internal/service/xray/testdata/SamplingRule/{tagsNull_default1_gen.tf => tagsNull_default1/main_gen.tf} (99%) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index d4eb5acaded..0b874c6f0a8 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -118,10 +118,6 @@ func main() { if foo.GenerateConfig { testDirPath := path.Join("testdata", foo.Name) - err = os.MkdirAll(testDirPath, 0755) - if err != nil { - g.Fatalf("creating test directory %q: %w", testDirPath, err) - } generateTestConfig(g, testDirPath, "tags0", 0, configTmplFile, configTmpl) generateTestConfig(g, testDirPath, "tags1", 0, configTmplFile, configTmpl) @@ -382,14 +378,19 @@ func (v *visitor) Visit(node ast.Node) ast.Visitor { } func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount int, configTmplFile, configTmpl string) { - var fileName string + var testName string if defaultCount > 0 { - fileName = fmt.Sprintf("%s_default%d_gen.tf", test, defaultCount) + testName = fmt.Sprintf("%s_default%d", test, defaultCount) } else { - fileName = fmt.Sprintf("%s_gen.tf", test) + testName = fmt.Sprintf("%s", test) + } + + dirPath = path.Join(dirPath, testName) + if err := os.MkdirAll(dirPath, 0755); err != nil { + g.Fatalf("creating test directory %q: %w", dirPath, err) } - mainPath := path.Join(dirPath, fileName) + mainPath := path.Join(dirPath, "main_gen.tf") tf := g.NewUnformattedFileDestination(mainPath) tfTemplates, err := template.New("taggingtests").Parse(testTfTmpl) diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index 06ef6309bd0..9cd643e1e19 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -87,7 +87,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -100,7 +100,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -109,7 +109,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -125,7 +125,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -136,7 +136,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -149,7 +149,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -158,7 +158,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -168,7 +168,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -188,7 +188,7 @@ func {{ template "testname" . }}_tags_null(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -199,7 +199,7 @@ func {{ template "testname" . }}_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -207,7 +207,7 @@ func {{ template "testname" . }}_tags_null(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -225,7 +225,7 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -235,7 +235,7 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -248,7 +248,7 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -270,7 +270,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -283,7 +283,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -292,7 +292,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -302,7 +302,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -322,7 +322,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -335,7 +335,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -351,7 +351,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -362,7 +362,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -375,7 +375,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -397,7 +397,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -410,7 +410,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -423,7 +423,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -442,7 +442,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -456,7 +456,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -465,7 +465,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -482,7 +482,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -493,7 +493,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -517,7 +517,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -529,7 +529,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -546,7 +546,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -564,7 +564,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -575,7 +575,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -597,7 +597,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -611,7 +611,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -623,7 +623,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -640,7 +640,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -657,7 +657,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -668,7 +668,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -691,7 +691,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -706,7 +706,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -723,7 +723,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -745,7 +745,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -760,7 +760,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -774,7 +774,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -808,7 +808,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -824,7 +824,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -846,7 +846,7 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -863,7 +863,7 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -887,7 +887,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -902,7 +902,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -925,7 +925,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -940,7 +940,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( ), }, { - ConfigFile: config.StaticFile("testdata/{{ .Name }}/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/generate/tagstests/test.tf.tmpl b/internal/generate/tagstests/test.tf.tmpl index d4cae794688..e302fdb27d4 100644 --- a/internal/generate/tagstests/test.tf.tmpl +++ b/internal/generate/tagstests/test.tf.tmpl @@ -77,7 +77,7 @@ variable "tagKey1" { type = string nullable = false } -{{ end }} +{{- end }} {{ if gt .DefaultTags 0 -}} variable "providerTagKey1" { diff --git a/internal/service/accessanalyzer/analyzer_tags_gen_test.go b/internal/service/accessanalyzer/analyzer_tags_gen_test.go index 6961def1842..948e05de193 100644 --- a/internal/service/accessanalyzer/analyzer_tags_gen_test.go +++ b/internal/service/accessanalyzer/analyzer_tags_gen_test.go @@ -45,7 +45,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -58,7 +58,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -69,7 +69,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -85,7 +85,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -98,7 +98,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -111,7 +111,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -122,7 +122,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -132,7 +132,7 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -157,7 +157,7 @@ func testAccAccessAnalyzerAnalyzer_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -168,7 +168,7 @@ func testAccAccessAnalyzerAnalyzer_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -178,7 +178,7 @@ func testAccAccessAnalyzerAnalyzer_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -202,7 +202,7 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -212,7 +212,7 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -225,7 +225,7 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -252,7 +252,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -265,7 +265,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -276,7 +276,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -286,7 +286,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -311,7 +311,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -324,7 +324,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -340,7 +340,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -353,7 +353,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -366,7 +366,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -393,7 +393,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -406,7 +406,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -419,7 +419,7 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -445,7 +445,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -459,7 +459,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -470,7 +470,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +487,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -500,7 +500,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -514,7 +514,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -526,7 +526,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -538,7 +538,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -562,7 +562,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -580,7 +580,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -593,7 +593,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -615,7 +615,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -631,7 +631,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -643,7 +643,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -667,7 +667,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -684,7 +684,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -697,7 +697,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -720,7 +720,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -737,7 +737,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -754,7 +754,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -783,7 +783,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -798,7 +798,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -812,7 +812,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -838,7 +838,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -853,7 +853,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -869,7 +869,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -895,7 +895,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -912,7 +912,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -940,7 +940,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -955,7 +955,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -982,7 +982,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -997,7 +997,7 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa ), }, { - ConfigFile: config.StaticFile("testdata/Analyzer/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags0_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags0_default1_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags0_default1/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags0_default2_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags0_default2/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags1/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags1_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags1/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags1_default1_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags1_default1/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags2_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags2/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags2_default1_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags2_default1/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/accessanalyzer/testdata/Analyzer/tags2_default2_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags2_default2/main_gen.tf diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf similarity index 99% rename from internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf index a48487f006d..c4315436ba1 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf @@ -20,4 +20,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf index 0fa82aca4f1..01735ea5376 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf @@ -28,7 +28,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index 3d45f75c837..d815557f79f 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -25,7 +25,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -38,7 +38,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -52,7 +52,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -68,7 +68,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -84,7 +84,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -97,7 +97,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -111,7 +111,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -121,7 +121,7 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -149,7 +149,7 @@ func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -160,7 +160,7 @@ func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -173,7 +173,7 @@ func TestAccACMPCACertificateAuthority_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -197,7 +197,7 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -207,7 +207,7 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -220,7 +220,7 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -250,7 +250,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -263,7 +263,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -277,7 +277,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -287,7 +287,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -315,7 +315,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -328,7 +328,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -344,7 +344,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -360,7 +360,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -373,7 +373,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -403,7 +403,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -416,7 +416,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -429,7 +429,7 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -458,7 +458,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -472,7 +472,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -486,7 +486,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -503,7 +503,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -519,7 +519,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -533,7 +533,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -548,7 +548,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -560,7 +560,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -587,7 +587,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -605,7 +605,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -621,7 +621,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -643,7 +643,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -662,7 +662,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -674,7 +674,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -701,7 +701,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -734,7 +734,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -757,7 +757,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -777,7 +777,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -794,7 +794,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -826,7 +826,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -841,7 +841,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -855,7 +855,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -884,7 +884,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -899,7 +899,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -915,7 +915,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -944,7 +944,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -961,7 +961,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -992,7 +992,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1007,7 +1007,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1037,7 +1037,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1052,7 +1052,7 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour ), }, { - ConfigFile: config.StaticFile("testdata/CertificateAuthority/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags0_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags0/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags0_default1_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags0_default1/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags0_default2_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags0_default2/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags1/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags1_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags1/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags1_default1_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags1_default1/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags2_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags2/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags2_default1_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags2_default1/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/acmpca/testdata/CertificateAuthority/tags2_default2_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags2_default2/main_gen.tf diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull/main_gen.tf similarity index 99% rename from internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tagsNull/main_gen.tf index 500b35ea02b..705e1b1ada8 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull/main_gen.tf @@ -30,4 +30,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1/main_gen.tf index b03778d6a68..759cb970e24 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1/main_gen.tf @@ -38,7 +38,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/batch/compute_environment_tags_gen_test.go b/internal/service/batch/compute_environment_tags_gen_test.go index e812043675e..616c993f076 100644 --- a/internal/service/batch/compute_environment_tags_gen_test.go +++ b/internal/service/batch/compute_environment_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccBatchComputeEnvironment_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccBatchComputeEnvironment_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccBatchComputeEnvironment_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT ), }, { - ConfigFile: config.StaticFile("testdata/ComputeEnvironment/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index 263b67fb05a..93228d0d90a 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -53,7 +53,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -69,7 +69,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -85,7 +85,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -98,7 +98,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -112,7 +112,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -122,7 +122,7 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -150,7 +150,7 @@ func TestAccBatchJobDefinition_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -161,7 +161,7 @@ func TestAccBatchJobDefinition_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -174,7 +174,7 @@ func TestAccBatchJobDefinition_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -198,7 +198,7 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -208,7 +208,7 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -221,7 +221,7 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -251,7 +251,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -264,7 +264,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -278,7 +278,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -288,7 +288,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -316,7 +316,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -329,7 +329,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -345,7 +345,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -361,7 +361,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -404,7 +404,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -417,7 +417,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -430,7 +430,7 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -459,7 +459,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +473,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +487,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -504,7 +504,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -520,7 +520,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +534,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -549,7 +549,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -561,7 +561,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -588,7 +588,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -606,7 +606,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -622,7 +622,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -644,7 +644,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -663,7 +663,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -675,7 +675,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -702,7 +702,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -719,7 +719,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -758,7 +758,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -778,7 +778,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -795,7 +795,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -827,7 +827,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -842,7 +842,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -856,7 +856,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -885,7 +885,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -900,7 +900,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -916,7 +916,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -945,7 +945,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -962,7 +962,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -993,7 +993,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1008,7 +1008,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1038,7 +1038,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1053,7 +1053,7 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/JobDefinition/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/job_queue_tags_gen_test.go b/internal/service/batch/job_queue_tags_gen_test.go index 1b3dc9bebb9..169d7e66769 100644 --- a/internal/service/batch/job_queue_tags_gen_test.go +++ b/internal/service/batch/job_queue_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -140,7 +140,7 @@ func TestAccBatchJobQueue_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -151,7 +151,7 @@ func TestAccBatchJobQueue_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -161,7 +161,7 @@ func TestAccBatchJobQueue_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -185,7 +185,7 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -195,7 +195,7 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -208,7 +208,7 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -235,7 +235,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -248,7 +248,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -259,7 +259,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -269,7 +269,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -294,7 +294,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -307,7 +307,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -323,7 +323,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -336,7 +336,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -349,7 +349,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -376,7 +376,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -389,7 +389,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -402,7 +402,7 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -428,7 +428,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -442,7 +442,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -453,7 +453,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -470,7 +470,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -483,7 +483,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -497,7 +497,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -509,7 +509,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -521,7 +521,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -545,7 +545,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -563,7 +563,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -576,7 +576,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -598,7 +598,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -614,7 +614,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -626,7 +626,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -650,7 +650,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -667,7 +667,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -680,7 +680,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -703,7 +703,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -720,7 +720,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -737,7 +737,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -766,7 +766,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -781,7 +781,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -795,7 +795,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -821,7 +821,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -836,7 +836,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -852,7 +852,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -878,7 +878,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -895,7 +895,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -925,7 +925,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -940,7 +940,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -969,7 +969,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -984,7 +984,7 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test ), }, { - ConfigFile: config.StaticFile("testdata/JobQueue/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 6b1491c63fc..76150f8c322 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccBatchSchedulingPolicy_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccBatchSchedulingPolicy_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccBatchSchedulingPolicy_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag ), }, { - ConfigFile: config.StaticFile("testdata/SchedulingPolicy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags0_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags0/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags0_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags0/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags0_default1_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags0_default1_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags0_default1/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags0_default2_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags0_default2_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags0_default2/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags1_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags1_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags1/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags1_default1_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags1_default1_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags1_default1/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags2_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags2_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags2/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags2_default1_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags2_default1_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags2_default1/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags2_default2_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/ComputeEnvironment/tags2_default2_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags2_default2/main_gen.tf diff --git a/internal/service/batch/testdata/ComputeEnvironment/tagsNull_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tagsNull/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/ComputeEnvironment/tagsNull_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tagsNull/main_gen.tf index e8aa1f3de44..317cadabb44 100644 --- a/internal/service/batch/testdata/ComputeEnvironment/tagsNull_gen.tf +++ b/internal/service/batch/testdata/ComputeEnvironment/tagsNull/main_gen.tf @@ -79,4 +79,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1/main_gen.tf index d6b67359aee..f5d40bd16f2 100644 --- a/internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1_gen.tf +++ b/internal/service/batch/testdata/ComputeEnvironment/tagsNull_default1/main_gen.tf @@ -87,7 +87,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/batch/testdata/JobDefinition/tags0_gen.tf b/internal/service/batch/testdata/JobDefinition/tags0/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags0_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags0/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags0_default1_gen.tf b/internal/service/batch/testdata/JobDefinition/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags0_default1_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags0_default1/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags0_default2_gen.tf b/internal/service/batch/testdata/JobDefinition/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags0_default2_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags0_default2/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags1_gen.tf b/internal/service/batch/testdata/JobDefinition/tags1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags1_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags1/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags1_default1_gen.tf b/internal/service/batch/testdata/JobDefinition/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags1_default1_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags1_default1/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags2_gen.tf b/internal/service/batch/testdata/JobDefinition/tags2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags2_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags2/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags2_default1_gen.tf b/internal/service/batch/testdata/JobDefinition/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags2_default1_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags2_default1/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tags2_default2_gen.tf b/internal/service/batch/testdata/JobDefinition/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobDefinition/tags2_default2_gen.tf rename to internal/service/batch/testdata/JobDefinition/tags2_default2/main_gen.tf diff --git a/internal/service/batch/testdata/JobDefinition/tagsNull_gen.tf b/internal/service/batch/testdata/JobDefinition/tagsNull/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/JobDefinition/tagsNull_gen.tf rename to internal/service/batch/testdata/JobDefinition/tagsNull/main_gen.tf index 535d27e34bc..64dc40ea097 100644 --- a/internal/service/batch/testdata/JobDefinition/tagsNull_gen.tf +++ b/internal/service/batch/testdata/JobDefinition/tagsNull/main_gen.tf @@ -27,4 +27,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/batch/testdata/JobDefinition/tagsNull_default1_gen.tf b/internal/service/batch/testdata/JobDefinition/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/JobDefinition/tagsNull_default1_gen.tf rename to internal/service/batch/testdata/JobDefinition/tagsNull_default1/main_gen.tf index 5fccd3cc0f7..1f209c88fd9 100644 --- a/internal/service/batch/testdata/JobDefinition/tagsNull_default1_gen.tf +++ b/internal/service/batch/testdata/JobDefinition/tagsNull_default1/main_gen.tf @@ -35,7 +35,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/batch/testdata/JobQueue/tags0_gen.tf b/internal/service/batch/testdata/JobQueue/tags0/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags0_gen.tf rename to internal/service/batch/testdata/JobQueue/tags0/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags0_default1_gen.tf b/internal/service/batch/testdata/JobQueue/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags0_default1_gen.tf rename to internal/service/batch/testdata/JobQueue/tags0_default1/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags0_default2_gen.tf b/internal/service/batch/testdata/JobQueue/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags0_default2_gen.tf rename to internal/service/batch/testdata/JobQueue/tags0_default2/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags1_gen.tf b/internal/service/batch/testdata/JobQueue/tags1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags1_gen.tf rename to internal/service/batch/testdata/JobQueue/tags1/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags1_default1_gen.tf b/internal/service/batch/testdata/JobQueue/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags1_default1_gen.tf rename to internal/service/batch/testdata/JobQueue/tags1_default1/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags2_gen.tf b/internal/service/batch/testdata/JobQueue/tags2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags2_gen.tf rename to internal/service/batch/testdata/JobQueue/tags2/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags2_default1_gen.tf b/internal/service/batch/testdata/JobQueue/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags2_default1_gen.tf rename to internal/service/batch/testdata/JobQueue/tags2_default1/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tags2_default2_gen.tf b/internal/service/batch/testdata/JobQueue/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/JobQueue/tags2_default2_gen.tf rename to internal/service/batch/testdata/JobQueue/tags2_default2/main_gen.tf diff --git a/internal/service/batch/testdata/JobQueue/tagsNull_gen.tf b/internal/service/batch/testdata/JobQueue/tagsNull/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/JobQueue/tagsNull_gen.tf rename to internal/service/batch/testdata/JobQueue/tagsNull/main_gen.tf index 73c9f9a4e31..faef07a8863 100644 --- a/internal/service/batch/testdata/JobQueue/tagsNull_gen.tf +++ b/internal/service/batch/testdata/JobQueue/tagsNull/main_gen.tf @@ -87,4 +87,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/batch/testdata/JobQueue/tagsNull_default1_gen.tf b/internal/service/batch/testdata/JobQueue/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/JobQueue/tagsNull_default1_gen.tf rename to internal/service/batch/testdata/JobQueue/tagsNull_default1/main_gen.tf index 27d88c6a39f..30c80c4001e 100644 --- a/internal/service/batch/testdata/JobQueue/tagsNull_default1_gen.tf +++ b/internal/service/batch/testdata/JobQueue/tagsNull_default1/main_gen.tf @@ -95,7 +95,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags0_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags0/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags0_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags0/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags0_default1_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags0_default1_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags0_default1/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags0_default2_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags0_default2_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags0_default2/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags1_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags1_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags1/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags1_default1_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags1_default1_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags1_default1/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags2_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags2_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags2/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags2_default1_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags2_default1_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags2_default1/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tags2_default2_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/batch/testdata/SchedulingPolicy/tags2_default2_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tags2_default2/main_gen.tf diff --git a/internal/service/batch/testdata/SchedulingPolicy/tagsNull_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tagsNull/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/SchedulingPolicy/tagsNull_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tagsNull/main_gen.tf index d2976137d8b..23b84748f15 100644 --- a/internal/service/batch/testdata/SchedulingPolicy/tagsNull_gen.tf +++ b/internal/service/batch/testdata/SchedulingPolicy/tagsNull/main_gen.tf @@ -25,4 +25,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1_gen.tf b/internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1_gen.tf rename to internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1/main_gen.tf index bb32593b6ac..b0b5d1a7ac4 100644 --- a/internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1_gen.tf +++ b/internal/service/batch/testdata/SchedulingPolicy/tagsNull_default1/main_gen.tf @@ -33,7 +33,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/instance_profile_tags_gen_test.go b/internal/service/iam/instance_profile_tags_gen_test.go index fea0fd36d6a..cdf68884686 100644 --- a/internal/service/iam/instance_profile_tags_gen_test.go +++ b/internal/service/iam/instance_profile_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccIAMInstanceProfile_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccIAMInstanceProfile_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccIAMInstanceProfile_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccIAMInstanceProfile_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccIAMInstanceProfile_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccIAMInstanceProfile_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/InstanceProfile/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/openid_connect_provider_tags_gen_test.go b/internal/service/iam/openid_connect_provider_tags_gen_test.go index c4216e9c550..8fb428174cd 100644 --- a/internal/service/iam/openid_connect_provider_tags_gen_test.go +++ b/internal/service/iam/openid_connect_provider_tags_gen_test.go @@ -24,7 +24,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -37,7 +37,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -48,7 +48,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -64,7 +64,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -77,7 +77,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -90,7 +90,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -101,7 +101,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -111,7 +111,7 @@ func TestAccIAMOpenIDConnectProvider_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -135,7 +135,7 @@ func TestAccIAMOpenIDConnectProvider_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -146,7 +146,7 @@ func TestAccIAMOpenIDConnectProvider_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -156,7 +156,7 @@ func TestAccIAMOpenIDConnectProvider_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -179,7 +179,7 @@ func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -189,7 +189,7 @@ func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -202,7 +202,7 @@ func TestAccIAMOpenIDConnectProvider_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -228,7 +228,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -241,7 +241,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -252,7 +252,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -262,7 +262,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -286,7 +286,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -299,7 +299,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -315,7 +315,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -328,7 +328,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -341,7 +341,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -367,7 +367,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -380,7 +380,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -393,7 +393,7 @@ func TestAccIAMOpenIDConnectProvider_tags_EmptyTag_OnUpdate_Replace(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -418,7 +418,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -432,7 +432,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -443,7 +443,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -460,7 +460,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +473,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -487,7 +487,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -499,7 +499,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -511,7 +511,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -534,7 +534,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -552,7 +552,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -565,7 +565,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -587,7 +587,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -603,7 +603,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -615,7 +615,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -638,7 +638,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -655,7 +655,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -668,7 +668,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -691,7 +691,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -708,7 +708,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -725,7 +725,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -753,7 +753,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -768,7 +768,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -782,7 +782,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -807,7 +807,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -822,7 +822,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -838,7 +838,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -863,7 +863,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -880,7 +880,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -907,7 +907,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -922,7 +922,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -948,7 +948,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -963,7 +963,7 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource ), }, { - ConfigFile: config.StaticFile("testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/policy_tags_gen_test.go b/internal/service/iam/policy_tags_gen_test.go index 8a54a854649..bb372483308 100644 --- a/internal/service/iam/policy_tags_gen_test.go +++ b/internal/service/iam/policy_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccIAMPolicy_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccIAMPolicy_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccIAMPolicy_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccIAMPolicy_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccIAMPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccIAMPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Policy/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/Policy/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/role_tags_gen_test.go b/internal/service/iam/role_tags_gen_test.go index c8c1068ff0b..e69a9ef2ad5 100644 --- a/internal/service/iam/role_tags_gen_test.go +++ b/internal/service/iam/role_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccIAMRole_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccIAMRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccIAMRole_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccIAMRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccIAMRole_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccIAMRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccIAMRole_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccIAMRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccIAMRole_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccIAMRole_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccIAMRole_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccIAMRole_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccIAMRole_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccIAMRole_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccIAMRole_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccIAMRole_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccIAMRole_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccIAMRole_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccIAMRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccIAMRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Role/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccIAMRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccIAMRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccIAMRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccIAMRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Role/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccIAMRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Role/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccIAMRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Role/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/service_linked_role_tags_gen_test.go b/internal/service/iam/service_linked_role_tags_gen_test.go index 096f24bafc2..8073b84a094 100644 --- a/internal/service/iam/service_linked_role_tags_gen_test.go +++ b/internal/service/iam/service_linked_role_tags_gen_test.go @@ -24,7 +24,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -37,7 +37,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -48,7 +48,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -64,7 +64,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -77,7 +77,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -90,7 +90,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -101,7 +101,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -111,7 +111,7 @@ func TestAccIAMServiceLinkedRole_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -135,7 +135,7 @@ func TestAccIAMServiceLinkedRole_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -146,7 +146,7 @@ func TestAccIAMServiceLinkedRole_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -156,7 +156,7 @@ func TestAccIAMServiceLinkedRole_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -179,7 +179,7 @@ func TestAccIAMServiceLinkedRole_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -189,7 +189,7 @@ func TestAccIAMServiceLinkedRole_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -202,7 +202,7 @@ func TestAccIAMServiceLinkedRole_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -228,7 +228,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -241,7 +241,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -252,7 +252,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -262,7 +262,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -286,7 +286,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -299,7 +299,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -315,7 +315,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -328,7 +328,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -341,7 +341,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -367,7 +367,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -380,7 +380,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -393,7 +393,7 @@ func TestAccIAMServiceLinkedRole_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -418,7 +418,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -432,7 +432,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -443,7 +443,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -460,7 +460,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +473,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -487,7 +487,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -499,7 +499,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -511,7 +511,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -534,7 +534,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -552,7 +552,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -565,7 +565,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -587,7 +587,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -603,7 +603,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -615,7 +615,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -638,7 +638,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -655,7 +655,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -668,7 +668,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -691,7 +691,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -708,7 +708,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -725,7 +725,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -753,7 +753,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -768,7 +768,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -782,7 +782,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -807,7 +807,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToResourceOnly(t *testin CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -822,7 +822,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -838,7 +838,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -863,7 +863,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyResourceTag(t *testing.T) CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -880,7 +880,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -907,7 +907,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullOverlappingResourceTag(t * CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -922,7 +922,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullOverlappingResourceTag(t * ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -948,7 +948,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullNonOverlappingResourceTag( CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -963,7 +963,7 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullNonOverlappingResourceTag( ), }, { - ConfigFile: config.StaticFile("testdata/ServiceLinkedRole/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/testdata/InstanceProfile/tags0_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags0_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags0_default1_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags0_default1_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags0_default2_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags0_default2_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags1_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags1_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags1_default1_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags1_default1_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags2_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags2_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags2_default1_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags2_default1_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tags2_default2_gen.tf b/internal/service/iam/testdata/InstanceProfile/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/InstanceProfile/tags2_default2_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/InstanceProfile/tagsNull_gen.tf b/internal/service/iam/testdata/InstanceProfile/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/InstanceProfile/tagsNull_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tagsNull/main_gen.tf index 5263f42dea4..c5bc9de9d4c 100644 --- a/internal/service/iam/testdata/InstanceProfile/tagsNull_gen.tf +++ b/internal/service/iam/testdata/InstanceProfile/tagsNull/main_gen.tf @@ -44,4 +44,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/InstanceProfile/tagsNull_default1_gen.tf b/internal/service/iam/testdata/InstanceProfile/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/InstanceProfile/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/InstanceProfile/tagsNull_default1/main_gen.tf index e69f6e764c9..a716fb34465 100644 --- a/internal/service/iam/testdata/InstanceProfile/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/InstanceProfile/tagsNull_default1/main_gen.tf @@ -52,7 +52,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags0_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags0_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags0_default1_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags0_default1_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags0_default2_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags0_default2_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags1_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags1_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags1_default1_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags1_default1_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags2_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags2_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags2_default1_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags2_default1_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tags2_default2_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/OpenIDConnectProvider/tags2_default2_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tagsNull/main_gen.tf index 454eff33650..bc088abcb64 100644 --- a/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_gen.tf +++ b/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull/main_gen.tf @@ -26,4 +26,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf b/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1/main_gen.tf index 3631c9e1303..1a4c8c30d10 100644 --- a/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/OpenIDConnectProvider/tagsNull_default1/main_gen.tf @@ -34,7 +34,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/testdata/Policy/tags0_gen.tf b/internal/service/iam/testdata/Policy/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags0_gen.tf rename to internal/service/iam/testdata/Policy/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags0_default1_gen.tf b/internal/service/iam/testdata/Policy/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags0_default1_gen.tf rename to internal/service/iam/testdata/Policy/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags0_default2_gen.tf b/internal/service/iam/testdata/Policy/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags0_default2_gen.tf rename to internal/service/iam/testdata/Policy/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags1_gen.tf b/internal/service/iam/testdata/Policy/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags1_gen.tf rename to internal/service/iam/testdata/Policy/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags1_default1_gen.tf b/internal/service/iam/testdata/Policy/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags1_default1_gen.tf rename to internal/service/iam/testdata/Policy/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags2_gen.tf b/internal/service/iam/testdata/Policy/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags2_gen.tf rename to internal/service/iam/testdata/Policy/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags2_default1_gen.tf b/internal/service/iam/testdata/Policy/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags2_default1_gen.tf rename to internal/service/iam/testdata/Policy/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tags2_default2_gen.tf b/internal/service/iam/testdata/Policy/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Policy/tags2_default2_gen.tf rename to internal/service/iam/testdata/Policy/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/Policy/tagsNull_gen.tf b/internal/service/iam/testdata/Policy/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/Policy/tagsNull_gen.tf rename to internal/service/iam/testdata/Policy/tagsNull/main_gen.tf index a5e4b148094..2a182d27e4f 100644 --- a/internal/service/iam/testdata/Policy/tagsNull_gen.tf +++ b/internal/service/iam/testdata/Policy/tagsNull/main_gen.tf @@ -39,4 +39,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/Policy/tagsNull_default1_gen.tf b/internal/service/iam/testdata/Policy/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/Policy/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/Policy/tagsNull_default1/main_gen.tf index 1aa0f040c20..8af11c8fecd 100644 --- a/internal/service/iam/testdata/Policy/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/Policy/tagsNull_default1/main_gen.tf @@ -47,7 +47,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/testdata/Role/tags0_gen.tf b/internal/service/iam/testdata/Role/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags0_gen.tf rename to internal/service/iam/testdata/Role/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags0_default1_gen.tf b/internal/service/iam/testdata/Role/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags0_default1_gen.tf rename to internal/service/iam/testdata/Role/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags0_default2_gen.tf b/internal/service/iam/testdata/Role/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags0_default2_gen.tf rename to internal/service/iam/testdata/Role/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags1_gen.tf b/internal/service/iam/testdata/Role/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags1_gen.tf rename to internal/service/iam/testdata/Role/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags1_default1_gen.tf b/internal/service/iam/testdata/Role/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags1_default1_gen.tf rename to internal/service/iam/testdata/Role/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags2_gen.tf b/internal/service/iam/testdata/Role/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags2_gen.tf rename to internal/service/iam/testdata/Role/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags2_default1_gen.tf b/internal/service/iam/testdata/Role/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags2_default1_gen.tf rename to internal/service/iam/testdata/Role/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tags2_default2_gen.tf b/internal/service/iam/testdata/Role/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/Role/tags2_default2_gen.tf rename to internal/service/iam/testdata/Role/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/Role/tagsNull_gen.tf b/internal/service/iam/testdata/Role/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/Role/tagsNull_gen.tf rename to internal/service/iam/testdata/Role/tagsNull/main_gen.tf index 519bd484697..55553760c89 100644 --- a/internal/service/iam/testdata/Role/tagsNull_gen.tf +++ b/internal/service/iam/testdata/Role/tagsNull/main_gen.tf @@ -34,4 +34,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/Role/tagsNull_default1_gen.tf b/internal/service/iam/testdata/Role/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/Role/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/Role/tagsNull_default1/main_gen.tf index 97c91485a57..dafb658d89a 100644 --- a/internal/service/iam/testdata/Role/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/Role/tagsNull_default1/main_gen.tf @@ -42,7 +42,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags0_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags0_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags0_default1_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags0_default1_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags0_default2_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags0_default2_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags1_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags1_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags1_default1_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags1_default1_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags2_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags2_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags2_default1_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags2_default1_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tags2_default2_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/ServiceLinkedRole/tags2_default2_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tagsNull_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/ServiceLinkedRole/tagsNull_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tagsNull/main_gen.tf index a77941e3f09..511b70eebe1 100644 --- a/internal/service/iam/testdata/ServiceLinkedRole/tagsNull_gen.tf +++ b/internal/service/iam/testdata/ServiceLinkedRole/tagsNull/main_gen.tf @@ -21,4 +21,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1_gen.tf b/internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1/main_gen.tf index 094e880eccf..66cd5ab08f1 100644 --- a/internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/ServiceLinkedRole/tagsNull_default1/main_gen.tf @@ -29,7 +29,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/testdata/User/tags0_gen.tf b/internal/service/iam/testdata/User/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags0_gen.tf rename to internal/service/iam/testdata/User/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags0_default1_gen.tf b/internal/service/iam/testdata/User/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags0_default1_gen.tf rename to internal/service/iam/testdata/User/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags0_default2_gen.tf b/internal/service/iam/testdata/User/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags0_default2_gen.tf rename to internal/service/iam/testdata/User/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags1_gen.tf b/internal/service/iam/testdata/User/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags1_gen.tf rename to internal/service/iam/testdata/User/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags1_default1_gen.tf b/internal/service/iam/testdata/User/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags1_default1_gen.tf rename to internal/service/iam/testdata/User/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags2_gen.tf b/internal/service/iam/testdata/User/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags2_gen.tf rename to internal/service/iam/testdata/User/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags2_default1_gen.tf b/internal/service/iam/testdata/User/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags2_default1_gen.tf rename to internal/service/iam/testdata/User/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/User/tags2_default2_gen.tf b/internal/service/iam/testdata/User/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/User/tags2_default2_gen.tf rename to internal/service/iam/testdata/User/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/User/tagsNull_gen.tf b/internal/service/iam/testdata/User/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/User/tagsNull_gen.tf rename to internal/service/iam/testdata/User/tagsNull/main_gen.tf index 608fe571388..bd715e58fcc 100644 --- a/internal/service/iam/testdata/User/tagsNull_gen.tf +++ b/internal/service/iam/testdata/User/tagsNull/main_gen.tf @@ -20,4 +20,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/User/tagsNull_default1_gen.tf b/internal/service/iam/testdata/User/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/User/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/User/tagsNull_default1/main_gen.tf index 74ab5c76ace..f46425f07bb 100644 --- a/internal/service/iam/testdata/User/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/User/tagsNull_default1/main_gen.tf @@ -28,7 +28,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags0_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags0/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags0_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags0/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags0_default1_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags0_default1_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags0_default1/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags0_default2_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags0_default2_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags0_default2/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags1_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags1_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags1/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags1_default1_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags1_default1_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags1_default1/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags2_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags2_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags2/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags2_default1_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags2_default1_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags2_default1/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tags2_default2_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/iam/testdata/VirtualMFADevice/tags2_default2_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tags2_default2/main_gen.tf diff --git a/internal/service/iam/testdata/VirtualMFADevice/tagsNull_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tagsNull/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/VirtualMFADevice/tagsNull_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tagsNull/main_gen.tf index bbb505fa4a1..b535efb22d7 100644 --- a/internal/service/iam/testdata/VirtualMFADevice/tagsNull_gen.tf +++ b/internal/service/iam/testdata/VirtualMFADevice/tagsNull/main_gen.tf @@ -20,4 +20,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1_gen.tf b/internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1_gen.tf rename to internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1/main_gen.tf index d851534cb5a..2c5f08d5b5b 100644 --- a/internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1_gen.tf +++ b/internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1/main_gen.tf @@ -28,7 +28,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/iam/user_tags_gen_test.go b/internal/service/iam/user_tags_gen_test.go index cb150b3dd54..6cbead48f62 100644 --- a/internal/service/iam/user_tags_gen_test.go +++ b/internal/service/iam/user_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccIAMUser_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccIAMUser_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -53,7 +53,7 @@ func TestAccIAMUser_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -69,7 +69,7 @@ func TestAccIAMUser_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -85,7 +85,7 @@ func TestAccIAMUser_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -98,7 +98,7 @@ func TestAccIAMUser_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -112,7 +112,7 @@ func TestAccIAMUser_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -122,7 +122,7 @@ func TestAccIAMUser_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -150,7 +150,7 @@ func TestAccIAMUser_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -161,7 +161,7 @@ func TestAccIAMUser_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -174,7 +174,7 @@ func TestAccIAMUser_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -198,7 +198,7 @@ func TestAccIAMUser_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -208,7 +208,7 @@ func TestAccIAMUser_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -221,7 +221,7 @@ func TestAccIAMUser_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -251,7 +251,7 @@ func TestAccIAMUser_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -264,7 +264,7 @@ func TestAccIAMUser_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -278,7 +278,7 @@ func TestAccIAMUser_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -288,7 +288,7 @@ func TestAccIAMUser_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -316,7 +316,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -329,7 +329,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -345,7 +345,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -361,7 +361,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -404,7 +404,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -417,7 +417,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -430,7 +430,7 @@ func TestAccIAMUser_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -459,7 +459,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +473,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +487,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -504,7 +504,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -520,7 +520,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +534,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -549,7 +549,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -561,7 +561,7 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -588,7 +588,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -606,7 +606,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -622,7 +622,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -644,7 +644,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -663,7 +663,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -675,7 +675,7 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -702,7 +702,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -719,7 +719,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -758,7 +758,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -778,7 +778,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -795,7 +795,7 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -827,7 +827,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -842,7 +842,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -856,7 +856,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -885,7 +885,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -900,7 +900,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -916,7 +916,7 @@ func TestAccIAMUser_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/User/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -945,7 +945,7 @@ func TestAccIAMUser_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -962,7 +962,7 @@ func TestAccIAMUser_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -993,7 +993,7 @@ func TestAccIAMUser_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1008,7 +1008,7 @@ func TestAccIAMUser_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/User/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1038,7 +1038,7 @@ func TestAccIAMUser_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/User/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1053,7 +1053,7 @@ func TestAccIAMUser_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/User/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/virtual_mfa_device_tags_gen_test.go b/internal/service/iam/virtual_mfa_device_tags_gen_test.go index 27dc3567b47..decb0fa57c4 100644 --- a/internal/service/iam/virtual_mfa_device_tags_gen_test.go +++ b/internal/service/iam/virtual_mfa_device_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -53,7 +53,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -69,7 +69,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -85,7 +85,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -98,7 +98,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -112,7 +112,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -122,7 +122,7 @@ func TestAccIAMVirtualMFADevice_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -150,7 +150,7 @@ func TestAccIAMVirtualMFADevice_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -161,7 +161,7 @@ func TestAccIAMVirtualMFADevice_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -174,7 +174,7 @@ func TestAccIAMVirtualMFADevice_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -198,7 +198,7 @@ func TestAccIAMVirtualMFADevice_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -208,7 +208,7 @@ func TestAccIAMVirtualMFADevice_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -221,7 +221,7 @@ func TestAccIAMVirtualMFADevice_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -251,7 +251,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -264,7 +264,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -278,7 +278,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -288,7 +288,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -316,7 +316,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -329,7 +329,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -345,7 +345,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -361,7 +361,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -404,7 +404,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -417,7 +417,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -430,7 +430,7 @@ func TestAccIAMVirtualMFADevice_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -459,7 +459,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +473,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +487,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -504,7 +504,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -520,7 +520,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +534,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -549,7 +549,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -561,7 +561,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -588,7 +588,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -606,7 +606,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -622,7 +622,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -644,7 +644,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -663,7 +663,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -675,7 +675,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -702,7 +702,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -719,7 +719,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -758,7 +758,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -778,7 +778,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -795,7 +795,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -827,7 +827,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -842,7 +842,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -856,7 +856,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -885,7 +885,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToResourceOnly(t *testing CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -900,7 +900,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToResourceOnly(t *testing }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -916,7 +916,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToResourceOnly(t *testing }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -945,7 +945,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyResourceTag(t *testing.T) CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -962,7 +962,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -993,7 +993,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullOverlappingResourceTag(t *t CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1008,7 +1008,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullOverlappingResourceTag(t *t ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1038,7 +1038,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullNonOverlappingResourceTag(t CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1053,7 +1053,7 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/VirtualMFADevice/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/servicecatalog/portfolio_tags_gen_test.go b/internal/service/servicecatalog/portfolio_tags_gen_test.go index 7308293f590..f4b3b8eda66 100644 --- a/internal/service/servicecatalog/portfolio_tags_gen_test.go +++ b/internal/service/servicecatalog/portfolio_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccServiceCatalogPortfolio_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccServiceCatalogPortfolio_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccServiceCatalogPortfolio_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccServiceCatalogPortfolio_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccServiceCatalogPortfolio_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccServiceCatalogPortfolio_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccServiceCatalogPortfolio_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -235,7 +235,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -248,7 +248,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -259,7 +259,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -269,7 +269,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -296,7 +296,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -309,7 +309,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -325,7 +325,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -338,7 +338,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -351,7 +351,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -380,7 +380,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -393,7 +393,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -406,7 +406,7 @@ func TestAccServiceCatalogPortfolio_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -432,7 +432,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -446,7 +446,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -457,7 +457,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -474,7 +474,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +487,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -501,7 +501,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -513,7 +513,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -525,7 +525,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -549,7 +549,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -567,7 +567,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -580,7 +580,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -602,7 +602,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -618,7 +618,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -630,7 +630,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -654,7 +654,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -671,7 +671,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -684,7 +684,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -707,7 +707,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -724,7 +724,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -741,7 +741,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -770,7 +770,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -785,7 +785,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -799,7 +799,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -825,7 +825,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -840,7 +840,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -856,7 +856,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -884,7 +884,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -901,7 +901,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -929,7 +929,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -944,7 +944,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -971,7 +971,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -986,7 +986,7 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT ), }, { - ConfigFile: config.StaticFile("testdata/Portfolio/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/servicecatalog/product_tags_gen_test.go b/internal/service/servicecatalog/product_tags_gen_test.go index c79b1387b5b..0832359c818 100644 --- a/internal/service/servicecatalog/product_tags_gen_test.go +++ b/internal/service/servicecatalog/product_tags_gen_test.go @@ -24,7 +24,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -37,7 +37,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -51,7 +51,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -67,7 +67,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -83,7 +83,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -96,7 +96,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -110,7 +110,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -120,7 +120,7 @@ func TestAccServiceCatalogProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -147,7 +147,7 @@ func TestAccServiceCatalogProduct_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -158,7 +158,7 @@ func TestAccServiceCatalogProduct_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -171,7 +171,7 @@ func TestAccServiceCatalogProduct_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -194,7 +194,7 @@ func TestAccServiceCatalogProduct_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -204,7 +204,7 @@ func TestAccServiceCatalogProduct_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -217,7 +217,7 @@ func TestAccServiceCatalogProduct_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -248,7 +248,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -261,7 +261,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -275,7 +275,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -285,7 +285,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -314,7 +314,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -327,7 +327,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -343,7 +343,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -359,7 +359,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -372,7 +372,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -403,7 +403,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -416,7 +416,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -429,7 +429,7 @@ func TestAccServiceCatalogProduct_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -457,7 +457,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -471,7 +471,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -485,7 +485,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -502,7 +502,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -518,7 +518,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -532,7 +532,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -547,7 +547,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -559,7 +559,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -585,7 +585,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -603,7 +603,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -619,7 +619,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -641,7 +641,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -660,7 +660,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -672,7 +672,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -698,7 +698,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -715,7 +715,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -731,7 +731,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -754,7 +754,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -774,7 +774,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -791,7 +791,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -822,7 +822,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -837,7 +837,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -851,7 +851,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -879,7 +879,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -894,7 +894,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -910,7 +910,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Product/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -940,7 +940,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -957,7 +957,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/Product/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -987,7 +987,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1002,7 +1002,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1031,7 +1031,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1046,7 +1046,7 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag ), }, { - ConfigFile: config.StaticFile("testdata/Product/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/servicecatalog/provisioned_product_tags_test.go b/internal/service/servicecatalog/provisioned_product_tags_test.go index cac58d74a15..00ae9a61894 100644 --- a/internal/service/servicecatalog/provisioned_product_tags_test.go +++ b/internal/service/servicecatalog/provisioned_product_tags_test.go @@ -27,7 +27,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -40,7 +40,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -54,7 +54,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -70,7 +70,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -86,7 +86,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { }, }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "tagKey1": config.StringVariable("key2"), @@ -99,7 +99,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // ), // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "tagKey1": config.StringVariable("key2"), @@ -113,7 +113,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // }, // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -123,7 +123,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // ), // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -151,7 +151,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -162,7 +162,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -175,7 +175,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -199,7 +199,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -209,7 +209,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -222,7 +222,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -254,7 +254,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -267,7 +267,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -281,7 +281,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -291,7 +291,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -321,7 +321,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -350,7 +350,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -366,7 +366,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -379,7 +379,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -411,7 +411,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -424,7 +424,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -437,7 +437,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -466,7 +466,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -480,7 +480,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -494,7 +494,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -511,7 +511,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -527,7 +527,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te }, }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "providerTagKey1": config.StringVariable("key2"), @@ -541,7 +541,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // ), // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "providerTagKey1": config.StringVariable("key2"), @@ -556,7 +556,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -568,7 +568,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -595,7 +595,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -613,7 +613,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -629,7 +629,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -651,7 +651,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -670,7 +670,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -682,7 +682,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * // }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_gen.tf"), + // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -709,7 +709,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -726,7 +726,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -742,7 +742,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -765,7 +765,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -785,7 +785,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -802,7 +802,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -834,7 +834,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -849,7 +849,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -863,7 +863,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -892,7 +892,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -907,7 +907,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -923,7 +923,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -954,7 +954,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -971,7 +971,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1002,7 +1002,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1017,7 +1017,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1047,7 +1047,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1062,7 +1062,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1_gen.tf"), + ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0/main_gen.tf new file mode 100644 index 00000000000..08eb335c8ff --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags0/main_gen.tf @@ -0,0 +1,17 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_default1/main_gen.tf new file mode 100644 index 00000000000..fe2c8be86e0 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags0_default1/main_gen.tf @@ -0,0 +1,34 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_default2/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_default2/main_gen.tf new file mode 100644 index 00000000000..1eb18fdccb8 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags0_default2/main_gen.tf @@ -0,0 +1,46 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags1/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags1/main_gen.tf new file mode 100644 index 00000000000..812e5b58ff6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags1/main_gen.tf @@ -0,0 +1,30 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags1_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags1_default1/main_gen.tf new file mode 100644 index 00000000000..622333cbe51 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags1_default1/main_gen.tf @@ -0,0 +1,47 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2/main_gen.tf new file mode 100644 index 00000000000..eaed4a5d5b2 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags2/main_gen.tf @@ -0,0 +1,41 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_default1/main_gen.tf new file mode 100644 index 00000000000..f91afa13141 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags2_default1/main_gen.tf @@ -0,0 +1,58 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_default2/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_default2/main_gen.tf new file mode 100644 index 00000000000..8b03f05a8bb --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tags2_default2/main_gen.tf @@ -0,0 +1,70 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tagsNull/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tagsNull/main_gen.tf new file mode 100644 index 00000000000..1ec5a9326d9 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tagsNull/main_gen.tf @@ -0,0 +1,24 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + diff --git a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1/main_gen.tf new file mode 100644 index 00000000000..9c082b62df8 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1/main_gen.tf @@ -0,0 +1,41 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = "test-b" + provider_name = "test-c" + + tags = { + (var.tagKey1) = null + } +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags0/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0/main_gen.tf new file mode 100644 index 00000000000..67beb3ee7ce --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags0/main_gen.tf @@ -0,0 +1,61 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tags0_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_default1/main_gen.tf new file mode 100644 index 00000000000..ac0ccd45bce --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags0_default1/main_gen.tf @@ -0,0 +1,78 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags0_default2/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_default2/main_gen.tf new file mode 100644 index 00000000000..88ed5494e34 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags0_default2/main_gen.tf @@ -0,0 +1,90 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags1/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags1/main_gen.tf new file mode 100644 index 00000000000..30e50a5eac6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags1/main_gen.tf @@ -0,0 +1,74 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tags1_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags1_default1/main_gen.tf new file mode 100644 index 00000000000..34d72fba297 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags1_default1/main_gen.tf @@ -0,0 +1,91 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags2/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2/main_gen.tf new file mode 100644 index 00000000000..d24f8ceea7a --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags2/main_gen.tf @@ -0,0 +1,85 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/Product/tags2_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_default1/main_gen.tf new file mode 100644 index 00000000000..03d6870806d --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags2_default1/main_gen.tf @@ -0,0 +1,102 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tags2_default2/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_default2/main_gen.tf new file mode 100644 index 00000000000..5a289b36da6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tags2_default2/main_gen.tf @@ -0,0 +1,114 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/Product/tagsNull/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tagsNull/main_gen.tf new file mode 100644 index 00000000000..6154e3f209e --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tagsNull/main_gen.tf @@ -0,0 +1,68 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + diff --git a/internal/service/servicecatalog/testdata/Product/tagsNull_default1/main_gen.tf b/internal/service/servicecatalog/testdata/Product/tagsNull_default1/main_gen.tf new file mode 100644 index 00000000000..40f246fb2dd --- /dev/null +++ b/internal/service/servicecatalog/testdata/Product/tagsNull_default1/main_gen.tf @@ -0,0 +1,85 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Resources = { + MyVPC = { + Type = "AWS::EC2::VPC" + Properties = { + CidrBlock = "10.1.0.0/16" + } + } + } + + Outputs = { + VpcID = { + Description = "VPC ID" + Value = { + Ref = "MyVPC" + } + } + } + }) +} + +data "aws_partition" "current" {} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0/main_gen.tf new file mode 100644 index 00000000000..0975df6166a --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0/main_gen.tf @@ -0,0 +1,108 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1/main_gen.tf new file mode 100644 index 00000000000..70fbdc93b83 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1/main_gen.tf @@ -0,0 +1,125 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2/main_gen.tf new file mode 100644 index 00000000000..b81c80e2ee6 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2/main_gen.tf @@ -0,0 +1,137 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1/main_gen.tf new file mode 100644 index 00000000000..4304d040413 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1/main_gen.tf @@ -0,0 +1,121 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1/main_gen.tf new file mode 100644 index 00000000000..d2d7283370b --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1/main_gen.tf @@ -0,0 +1,138 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2/main_gen.tf new file mode 100644 index 00000000000..923fb5b6d52 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2/main_gen.tf @@ -0,0 +1,132 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1/main_gen.tf new file mode 100644 index 00000000000..d21c8c7cba5 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1/main_gen.tf @@ -0,0 +1,149 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2/main_gen.tf new file mode 100644 index 00000000000..9d4d551bc57 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2/main_gen.tf @@ -0,0 +1,161 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = var.tagValue1 + (var.tagKey2) = var.tagValue2 + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "tagValue1" { + type = string + nullable = false +} + +variable "tagKey2" { + type = string + nullable = false +} + +variable "tagValue2" { + type = string + nullable = false +} + + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} + + +variable "providerTagKey2" { + type = string + nullable = false +} + +variable "providerTagValue2" { + type = string + nullable = false +} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull/main_gen.tf new file mode 100644 index 00000000000..12805d494dd --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull/main_gen.tf @@ -0,0 +1,115 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf new file mode 100644 index 00000000000..34dd3eed7d2 --- /dev/null +++ b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf @@ -0,0 +1,132 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = { + (var.providerTagKey1) = var.providerTagValue1 + } + } +} + +resource "aws_servicecatalog_provisioned_product" "test" { + name = var.rName + product_id = aws_servicecatalog_constraint.test.product_id + provisioning_artifact_name = var.rName + path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id + + provisioning_parameters { + key = "BucketName" + value = "${var.rName}-dest" + } + + tags = { + (var.tagKey1) = null + } +} + +resource "aws_s3_bucket" "test" { + bucket = var.rName + force_destroy = true +} + +resource "aws_s3_object" "test" { + bucket = aws_s3_bucket.test.id + key = "${var.rName}.json" + + content = jsonencode({ + AWSTemplateFormatVersion = "2010-09-09" + + Parameters = { + BucketName = { + Type = "String" + } + } + + Resources = { + MyS3Bucket = { + Type = "AWS::S3::Bucket" + Properties = { + BucketName = { Ref = "BucketName" } + } + } + } + }) +} + +resource "aws_servicecatalog_product" "test" { + description = var.rName + distributor = "distributör" + name = var.rName + owner = "ägare" + type = "CLOUD_FORMATION_TEMPLATE" + + provisioning_artifact_parameters { + description = "artefaktbeskrivning" + disable_template_validation = true + name = var.rName + template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" + type = "CLOUD_FORMATION_TEMPLATE" + } +} + +resource "aws_servicecatalog_portfolio" "test" { + name = var.rName + description = var.rName + provider_name = var.rName +} + +resource "aws_servicecatalog_constraint" "test" { + description = var.rName + portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product_portfolio_association.test.product_id + type = "RESOURCE_UPDATE" + + parameters = jsonencode({ + Version = "2.0" + Properties = { + TagUpdateOnProvisionedProduct = "ALLOWED" + } + }) +} + +resource "aws_servicecatalog_product_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id + product_id = aws_servicecatalog_product.test.id +} + +data "aws_caller_identity" "current" {} + +data "aws_iam_session_context" "current" { + arn = data.aws_caller_identity.current.arn +} + +resource "aws_servicecatalog_principal_portfolio_association" "test" { + portfolio_id = aws_servicecatalog_portfolio.test.id + principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller +} + +data "aws_servicecatalog_launch_paths" "test" { + product_id = aws_servicecatalog_product_portfolio_association.test.product_id +} + + +variable "rName" { + type = string + nullable = false +} + +variable "tagKey1" { + type = string + nullable = false +} + +variable "providerTagKey1" { + type = string + nullable = false +} + +variable "providerTagValue1" { + type = string + nullable = false +} diff --git a/internal/service/xray/group_tags_gen_test.go b/internal/service/xray/group_tags_gen_test.go index 49d1dc3d30d..30c981f7387 100644 --- a/internal/service/xray/group_tags_gen_test.go +++ b/internal/service/xray/group_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccXRayGroup_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccXRayGroup_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccXRayGroup_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccXRayGroup_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccXRayGroup_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccXRayGroup_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/Group/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/Group/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. ), }, { - ConfigFile: config.StaticFile("testdata/Group/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/xray/sampling_rule_tags_gen_test.go b/internal/service/xray/sampling_rule_tags_gen_test.go index b76e12a21f8..ff371eb4233 100644 --- a/internal/service/xray/sampling_rule_tags_gen_test.go +++ b/internal/service/xray/sampling_rule_tags_gen_test.go @@ -26,7 +26,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -39,7 +39,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -50,7 +50,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -66,7 +66,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -79,7 +79,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -92,7 +92,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key2"), @@ -103,7 +103,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -113,7 +113,7 @@ func TestAccXRaySamplingRule_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -138,7 +138,7 @@ func TestAccXRaySamplingRule_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -149,7 +149,7 @@ func TestAccXRaySamplingRule_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -159,7 +159,7 @@ func TestAccXRaySamplingRule_tags_null(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -183,7 +183,7 @@ func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -193,7 +193,7 @@ func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -206,7 +206,7 @@ func TestAccXRaySamplingRule_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -233,7 +233,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -246,7 +246,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -257,7 +257,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -267,7 +267,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -292,7 +292,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -305,7 +305,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -321,7 +321,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -347,7 +347,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -374,7 +374,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -387,7 +387,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -400,7 +400,7 @@ func TestAccXRaySamplingRule_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -426,7 +426,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +440,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +451,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +468,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +481,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +495,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -507,7 +507,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -519,7 +519,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -543,7 +543,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +561,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +574,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +596,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +612,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +624,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -648,7 +648,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +665,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +678,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +701,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags2_default2_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +718,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +735,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -764,7 +764,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -779,7 +779,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +793,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +819,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags0_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -834,7 +834,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -850,7 +850,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -876,7 +876,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +893,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tags1_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +921,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +936,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +963,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +978,7 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t ), }, { - ConfigFile: config.StaticFile("testdata/SamplingRule/tagsNull_default1_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/xray/testdata/Group/tags0_gen.tf b/internal/service/xray/testdata/Group/tags0/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags0_gen.tf rename to internal/service/xray/testdata/Group/tags0/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags0_default1_gen.tf b/internal/service/xray/testdata/Group/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags0_default1_gen.tf rename to internal/service/xray/testdata/Group/tags0_default1/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags0_default2_gen.tf b/internal/service/xray/testdata/Group/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags0_default2_gen.tf rename to internal/service/xray/testdata/Group/tags0_default2/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags1_gen.tf b/internal/service/xray/testdata/Group/tags1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags1_gen.tf rename to internal/service/xray/testdata/Group/tags1/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags1_default1_gen.tf b/internal/service/xray/testdata/Group/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags1_default1_gen.tf rename to internal/service/xray/testdata/Group/tags1_default1/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags2_gen.tf b/internal/service/xray/testdata/Group/tags2/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags2_gen.tf rename to internal/service/xray/testdata/Group/tags2/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags2_default1_gen.tf b/internal/service/xray/testdata/Group/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags2_default1_gen.tf rename to internal/service/xray/testdata/Group/tags2_default1/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tags2_default2_gen.tf b/internal/service/xray/testdata/Group/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/Group/tags2_default2_gen.tf rename to internal/service/xray/testdata/Group/tags2_default2/main_gen.tf diff --git a/internal/service/xray/testdata/Group/tagsNull_gen.tf b/internal/service/xray/testdata/Group/tagsNull/main_gen.tf similarity index 99% rename from internal/service/xray/testdata/Group/tagsNull_gen.tf rename to internal/service/xray/testdata/Group/tagsNull/main_gen.tf index 0f964493422..a29ea33b2db 100644 --- a/internal/service/xray/testdata/Group/tagsNull_gen.tf +++ b/internal/service/xray/testdata/Group/tagsNull/main_gen.tf @@ -21,4 +21,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/xray/testdata/Group/tagsNull_default1_gen.tf b/internal/service/xray/testdata/Group/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/xray/testdata/Group/tagsNull_default1_gen.tf rename to internal/service/xray/testdata/Group/tagsNull_default1/main_gen.tf index 12fe2b24b98..fa51c680f95 100644 --- a/internal/service/xray/testdata/Group/tagsNull_default1_gen.tf +++ b/internal/service/xray/testdata/Group/tagsNull_default1/main_gen.tf @@ -29,7 +29,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false diff --git a/internal/service/xray/testdata/SamplingRule/tags0_gen.tf b/internal/service/xray/testdata/SamplingRule/tags0/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags0_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags0/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags0_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags0_default1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags0_default1_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags0_default1/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags0_default2_gen.tf b/internal/service/xray/testdata/SamplingRule/tags0_default2/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags0_default2_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags0_default2/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags1_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags1/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags1_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags1_default1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags1_default1_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags1_default1/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags2_gen.tf b/internal/service/xray/testdata/SamplingRule/tags2/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags2_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags2/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags2_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tags2_default1/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags2_default1_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags2_default1/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tags2_default2_gen.tf b/internal/service/xray/testdata/SamplingRule/tags2_default2/main_gen.tf similarity index 100% rename from internal/service/xray/testdata/SamplingRule/tags2_default2_gen.tf rename to internal/service/xray/testdata/SamplingRule/tags2_default2/main_gen.tf diff --git a/internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf b/internal/service/xray/testdata/SamplingRule/tagsNull/main_gen.tf similarity index 99% rename from internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf rename to internal/service/xray/testdata/SamplingRule/tagsNull/main_gen.tf index f791be9f5f2..00a8f33c9cd 100644 --- a/internal/service/xray/testdata/SamplingRule/tagsNull_gen.tf +++ b/internal/service/xray/testdata/SamplingRule/tagsNull/main_gen.tf @@ -34,4 +34,3 @@ variable "tagKey1" { nullable = false } - diff --git a/internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf b/internal/service/xray/testdata/SamplingRule/tagsNull_default1/main_gen.tf similarity index 99% rename from internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf rename to internal/service/xray/testdata/SamplingRule/tagsNull_default1/main_gen.tf index 960b37e3f44..8d0969eeec5 100644 --- a/internal/service/xray/testdata/SamplingRule/tagsNull_default1_gen.tf +++ b/internal/service/xray/testdata/SamplingRule/tagsNull_default1/main_gen.tf @@ -42,7 +42,6 @@ variable "tagKey1" { nullable = false } - variable "providerTagKey1" { type = string nullable = false From f18759071ae442abd2c42e03c8f3ed8f08499a40 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 23 Apr 2024 19:43:41 -0700 Subject: [PATCH 12/23] Cleanup --- .../service/accessanalyzer/analyzer_test.go | 45 -------- .../service/servicecatalog/product_test.go | 101 ------------------ 2 files changed, 146 deletions(-) diff --git a/internal/service/accessanalyzer/analyzer_test.go b/internal/service/accessanalyzer/analyzer_test.go index 9fe7772e513..b26cd248f08 100644 --- a/internal/service/accessanalyzer/analyzer_test.go +++ b/internal/service/accessanalyzer/analyzer_test.go @@ -200,51 +200,6 @@ resource "aws_accessanalyzer_analyzer" "test" { `, rName) } -func testAccAnalyzerConfig_tags0(rName string) string { - return fmt.Sprintf(` -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name = %[1]q -} -`, rName) -} - -func testAccAnalyzerConfig_tags1(rName, tagKey1, tagValue1 string) string { - return fmt.Sprintf(` -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name = %[1]q - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1) -} - -func testAccAnalyzerConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return fmt.Sprintf(` -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name = %[1]q - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2) -} - -func testAccAnalyzerConfig_tagsNull(rName, tagKey1 string) string { - return fmt.Sprintf(` -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name = %[1]q - - tags = { - %[2]q = null - } -} -`, rName, tagKey1) -} - func testAccAnalyzerConfig_typeOrganization(rName string) string { return fmt.Sprintf(` data "aws_partition" "current" {} diff --git a/internal/service/servicecatalog/product_test.go b/internal/service/servicecatalog/product_test.go index ce8bc393b30..0b386034225 100644 --- a/internal/service/servicecatalog/product_test.go +++ b/internal/service/servicecatalog/product_test.go @@ -303,107 +303,6 @@ resource "aws_servicecatalog_product" "test" { `, rName, description, supportDescription, domain, email)) } -func testAccProductConfig_tags0(rName string) string { - return acctest.ConfigCompose(testAccProductTemplateURLBaseConfig(rName), fmt.Sprintf(` -data "aws_partition" "current" {} - -resource "aws_servicecatalog_product" "test" { - description = %[1]q - distributor = "distributör" - name = %[1]q - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = %[1]q - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} -`, rName)) -} - -func testAccProductConfig_tags1(rName, tagKey1, tagValue1 string) string { - return acctest.ConfigCompose(testAccProductTemplateURLBaseConfig(rName), fmt.Sprintf(` -data "aws_partition" "current" {} - -resource "aws_servicecatalog_product" "test" { - description = %[1]q - distributor = "distributör" - name = %[1]q - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = %[1]q - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - %[2]q = %[3]q - } -} -`, rName, tagKey1, tagValue1)) -} - -func testAccProductConfig_tags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { - return acctest.ConfigCompose(testAccProductTemplateURLBaseConfig(rName), fmt.Sprintf(` -data "aws_partition" "current" {} - -resource "aws_servicecatalog_product" "test" { - description = %[1]q - distributor = "distributör" - name = %[1]q - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = %[1]q - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - %[2]q = %[3]q - %[4]q = %[5]q - } -} -`, rName, tagKey1, tagValue1, tagKey2, tagValue2)) -} - -func testAccProductConfig_tagsNull(rName, tagKey1 string) string { - return acctest.ConfigCompose(testAccProductTemplateURLBaseConfig(rName), fmt.Sprintf(` -data "aws_partition" "current" {} - -resource "aws_servicecatalog_product" "test" { - description = %[1]q - distributor = "distributör" - name = %[1]q - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = %[1]q - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - %[2]q = null - } -} -`, rName, tagKey1)) -} - func testAccProductConfig_physicalID(rName, domain, email string) string { return fmt.Sprintf(` resource "aws_cloudformation_stack" "test" { From 8ec628462ae6e893cdfb79ded9ef7701e977470e Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 24 Apr 2024 09:43:15 -0700 Subject: [PATCH 13/23] Factors out Exists check call --- internal/generate/tagstests/test.go.tmpl | 66 +++++++++++++----------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index 9cd643e1e19..1b48db6c230 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -39,6 +39,10 @@ {{ if .Serialize }}testAcc{{ else }}TestAcc{{ end }}{{ .ProviderNameUpper }}{{ .Name }} {{- end }} +{{ define "ExistsCheck" }} + testAccCheck{{ .Name }}Exists(ctx, resourceName{{ if .ExistsTypeName}}, &v{{ end }}), +{{ end }} + package {{ .ProviderPackage }}_test import ( @@ -94,7 +98,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -118,7 +122,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { "tagValue2": config.StringVariable("value2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), @@ -143,7 +147,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { "tagValue1": config.StringVariable("value2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), @@ -163,7 +167,7 @@ func {{ template "testname" . }}_tags(t *testing.T) { "rName": config.StringVariable(rName), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -194,7 +198,7 @@ func {{ template "testname" . }}_tags_null(t *testing.T) { "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -230,7 +234,7 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { "rName": config.StringVariable(rName), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -242,7 +246,7 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -277,7 +281,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { "tagValue1": config.StringVariable(""), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), ), @@ -297,7 +301,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { "rName": config.StringVariable(rName), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -329,7 +333,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -344,7 +348,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { "tagValue2": config.StringVariable(""), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", ""), @@ -369,7 +373,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -404,7 +408,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -417,7 +421,7 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { "tagValue1": config.StringVariable(""), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), ), @@ -449,7 +453,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { "providerTagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), @@ -474,7 +478,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { "providerTagValue2": config.StringVariable("value2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1updated"), @@ -500,7 +504,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { "providerTagValue1": config.StringVariable("value2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags_all.key2", "value2"), @@ -522,7 +526,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { "rName": config.StringVariable(rName), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), ), @@ -555,7 +559,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { "tagValue1": config.StringVariable("resourcevalue1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), @@ -586,7 +590,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { "tagValue2": config.StringVariable("resourcevalue2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1updated"), resource.TestCheckResourceAttr(resourceName, "tags.resourcekey2", "resourcevalue2"), @@ -616,7 +620,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { "rName": config.StringVariable(rName), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "0"), ), @@ -649,7 +653,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { "tagValue1": config.StringVariable("resourcevalue1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), @@ -681,7 +685,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { "tagValue2": config.StringVariable("resourcevalue2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), resource.TestCheckResourceAttr(resourceName, "tags.overlapkey2", "resourcevalue2"), @@ -715,7 +719,7 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { "tagValue1": config.StringVariable("resourcevalue2"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue2"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), @@ -752,7 +756,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), @@ -767,7 +771,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin "providerTagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), @@ -800,7 +804,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin "providerTagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), @@ -815,7 +819,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin "tagValue1": config.StringVariable("value1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), @@ -855,7 +859,7 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) "tagValue1": config.StringVariable(""), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", ""), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), @@ -895,7 +899,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "providervalue1"), @@ -933,7 +937,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheck{{ .Name }}Exists(ctx, resourceName {{ if .ExistsTypeName}}, &v{{ end }}), + {{- template "ExistsCheck" . -}} resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), From aced4353a0bcc6b7b8917e384f62947838d82214 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 24 Apr 2024 09:59:49 -0700 Subject: [PATCH 14/23] Factors out function spec parsing --- internal/generate/tagstests/main.go | 49 +++++++++++++++++------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 0b874c6f0a8..36f268b7fc1 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -286,27 +286,14 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { d.ExistsTypeName = typeName } if attr, ok := args.Keyword["generator"]; ok { - parts := strings.Split(attr, ";") - switch len(parts) { - case 1: - d.Generator = parts[0] - - case 2: - d.Generator = parts[1] - d.GoImports = append(d.GoImports, goImport{ - Path: parts[0], - }) - - case 3: - d.Generator = parts[2] - d.GoImports = append(d.GoImports, goImport{ - Path: parts[0], - Alias: parts[1], - }) - - default: - v.errs = append(v.errs, fmt.Errorf("invalid generator value: %q at %s.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) + if funcName, importSpec, err := parseFunctionSpec(attr); err != nil { + v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) continue + } else { + d.Generator = funcName + if importSpec != nil { + d.GoImports = append(d.GoImports, *importSpec) + } } } if attr, ok := args.Keyword["importIgnore"]; ok { @@ -416,3 +403,25 @@ func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount g.Fatalf("generating file (%s): %s", mainPath, err) } } + +func parseFunctionSpec(s string) (string, *goImport, error) { + parts := strings.Split(s, ";") + switch len(parts) { + case 1: + return parts[0], nil, nil + + case 2: + return parts[1], &goImport{ + Path: parts[0], + }, nil + + case 3: + return parts[2], &goImport{ + Path: parts[0], + Alias: parts[1], + }, nil + + default: + return "", nil, fmt.Errorf("invalid generator value: %q", s) + } +} From b4c9a8984fc6d25e3c9a9537d01a1224a7109a61 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 24 Apr 2024 10:16:03 -0700 Subject: [PATCH 15/23] Uses spec for existsType --- internal/generate/tagstests/main.go | 39 ++++++++++--------- internal/generate/tagstests/test.go.tmpl | 3 -- internal/service/accessanalyzer/analyzer.go | 2 +- .../service/acmpca/certificate_authority.go | 2 +- internal/service/batch/compute_environment.go | 2 +- internal/service/batch/job_definition.go | 2 +- internal/service/batch/job_queue.go | 2 +- internal/service/batch/scheduling_policy.go | 2 +- internal/service/iam/instance_profile.go | 2 +- internal/service/iam/policy.go | 2 +- internal/service/iam/role.go | 2 +- internal/service/iam/user.go | 2 +- internal/service/iam/virtual_mfa_device.go | 2 +- internal/service/servicecatalog/portfolio.go | 2 +- .../servicecatalog/provisioned_product.go | 2 +- internal/service/xray/group.go | 2 +- internal/service/xray/sampling_rule.go | 2 +- 17 files changed, 35 insertions(+), 37 deletions(-) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 36f268b7fc1..cc07fdaad04 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -74,15 +74,15 @@ func main() { g.Fatalf("%s", err.Error()) } - for _, foo := range v.taggedResources { - sourceName := foo.FileName + for _, resource := range v.taggedResources { + sourceName := resource.FileName ext := filepath.Ext(sourceName) sourceName = strings.TrimSuffix(sourceName, ext) - foo.ProviderNameUpper = serviceRecord.ProviderNameUpper() - foo.ProviderPackage = servicePackage + resource.ProviderNameUpper = serviceRecord.ProviderNameUpper() + resource.ProviderPackage = servicePackage - if foo.GenerateTests { + if resource.GenerateTests { filename := fmt.Sprintf("%s_tags_gen_test.go", sourceName) d := g.NewGoFileDestination(filename) @@ -91,7 +91,7 @@ func main() { g.Fatalf("parsing base Go test template: %w", err) } - if err := d.WriteTemplateSet(templates, foo); err != nil { + if err := d.WriteTemplateSet(templates, resource); err != nil { g.Fatalf("error generating %q service package data: %s", servicePackage, err) } @@ -108,7 +108,7 @@ func main() { g.Fatalf("reading %q: %w", configTmplFile, err) } configTmpl = string(b) - foo.GenerateConfig = true + resource.GenerateConfig = true } else if errors.Is(err, os.ErrNotExist) { g.Errorf("no tags template found for %s at %q", sourceName, configTmplFile) failed = true @@ -116,8 +116,8 @@ func main() { g.Fatalf("opening config template %q: %w", configTmplFile, err) } - if foo.GenerateConfig { - testDirPath := path.Join("testdata", foo.Name) + if resource.GenerateConfig { + testDirPath := path.Join("testdata", resource.Name) generateTestConfig(g, testDirPath, "tags0", 0, configTmplFile, configTmpl) generateTestConfig(g, testDirPath, "tags1", 0, configTmplFile, configTmpl) @@ -149,7 +149,6 @@ type ResourceDatum struct { ProviderNameUpper string Name string TypeName string - ExistsTypePackage string ExistsTypeName string FileName string Generator string @@ -278,15 +277,18 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { case "Testing": args := common.ParseArgs(m[3]) if attr, ok := args.Keyword["existsType"]; ok { - dotIx := strings.LastIndex(attr, ".") - pkg := attr[:dotIx] - d.ExistsTypePackage = pkg - slashIx := strings.LastIndex(attr, "/") - typeName := attr[slashIx+1:] - d.ExistsTypeName = typeName + if typeName, importSpec, err := parseIdentifierSpec(attr); err != nil { + v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) + continue + } else { + d.ExistsTypeName = typeName + if importSpec != nil { + d.GoImports = append(d.GoImports, *importSpec) + } + } } if attr, ok := args.Keyword["generator"]; ok { - if funcName, importSpec, err := parseFunctionSpec(attr); err != nil { + if funcName, importSpec, err := parseIdentifierSpec(attr); err != nil { v.errs = append(v.errs, fmt.Errorf("%s: %w", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName), err)) continue } else { @@ -391,7 +393,6 @@ func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount } configData := ConfigDatum{ - // Name: foo.Name, Tags: test, DefaultTags: defaultCount, } @@ -404,7 +405,7 @@ func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount } } -func parseFunctionSpec(s string) (string, *goImport, error) { +func parseIdentifierSpec(s string) (string, *goImport, error) { parts := strings.Split(s, ";") switch len(parts) { case 1: diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index 1b48db6c230..af6a99805c4 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -48,9 +48,6 @@ package {{ .ProviderPackage }}_test import ( "testing" - {{ if .ExistsTypePackage -}} - "{{ .ExistsTypePackage }}" - {{- end }} "github.com/hashicorp/terraform-plugin-testing/config" {{- if eq .Generator "" }} sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest" diff --git a/internal/service/accessanalyzer/analyzer.go b/internal/service/accessanalyzer/analyzer.go index d3aefd2d2eb..30363b24896 100644 --- a/internal/service/accessanalyzer/analyzer.go +++ b/internal/service/accessanalyzer/analyzer.go @@ -37,7 +37,7 @@ const ( // @SDKResource("aws_accessanalyzer_analyzer", name="Analyzer") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types.AnalyzerSummary", serialize="true", preCheck="true") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/accessanalyzer/types;types.AnalyzerSummary", serialize="true", preCheck="true") func resourceAnalyzer() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceAnalyzerCreate, diff --git a/internal/service/acmpca/certificate_authority.go b/internal/service/acmpca/certificate_authority.go index c9a5b00aaab..f6154f67639 100644 --- a/internal/service/acmpca/certificate_authority.go +++ b/internal/service/acmpca/certificate_authority.go @@ -35,7 +35,7 @@ const ( // @SDKResource("aws_acmpca_certificate_authority", name="Certificate Authority") // @Tags(identifierAttribute="id") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/acmpca/types.CertificateAuthority", generator="acctest.RandomDomainName()", importIgnore="permanent_deletion_time_in_days") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/acmpca/types;types.CertificateAuthority", generator="acctest.RandomDomainName()", importIgnore="permanent_deletion_time_in_days") func resourceCertificateAuthority() *schema.Resource { //lintignore:R011 return &schema.Resource{ diff --git a/internal/service/batch/compute_environment.go b/internal/service/batch/compute_environment.go index 8e3775e997e..b2d1c194b80 100644 --- a/internal/service/batch/compute_environment.go +++ b/internal/service/batch/compute_environment.go @@ -31,7 +31,7 @@ import ( // @SDKResource("aws_batch_compute_environment", name="Compute Environment") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch.ComputeEnvironmentDetail") +// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch;batch.ComputeEnvironmentDetail") func ResourceComputeEnvironment() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceComputeEnvironmentCreate, diff --git a/internal/service/batch/job_definition.go b/internal/service/batch/job_definition.go index d725226c9d0..a7a4bd27676 100644 --- a/internal/service/batch/job_definition.go +++ b/internal/service/batch/job_definition.go @@ -32,7 +32,7 @@ import ( // @SDKResource("aws_batch_job_definition", name="Job Definition") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch.JobDefinition", importIgnore="deregister_on_new_revision") +// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch;batch.JobDefinition", importIgnore="deregister_on_new_revision") func ResourceJobDefinition() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceJobDefinitionCreate, diff --git a/internal/service/batch/job_queue.go b/internal/service/batch/job_queue.go index 257efeadef9..cdf43cd9978 100644 --- a/internal/service/batch/job_queue.go +++ b/internal/service/batch/job_queue.go @@ -37,7 +37,7 @@ import ( // @FrameworkResource("aws_batch_job_queue", name="Job Queue") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch.JobQueueDetail") +// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch;batch.JobQueueDetail") func newResourceJobQueue(_ context.Context) (resource.ResourceWithConfigure, error) { r := resourceJobQueue{} diff --git a/internal/service/batch/scheduling_policy.go b/internal/service/batch/scheduling_policy.go index c2ee1a06d68..4906b170bc3 100644 --- a/internal/service/batch/scheduling_policy.go +++ b/internal/service/batch/scheduling_policy.go @@ -25,7 +25,7 @@ import ( // @SDKResource("aws_batch_scheduling_policy", name="Scheduling Policy") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch.SchedulingPolicyDetail") +// @Testing(existsType="github.com/aws/aws-sdk-go/service/batch;batch.SchedulingPolicyDetail") func ResourceSchedulingPolicy() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceSchedulingPolicyCreate, diff --git a/internal/service/iam/instance_profile.go b/internal/service/iam/instance_profile.go index 2e360a66d5d..2d3c864073b 100644 --- a/internal/service/iam/instance_profile.go +++ b/internal/service/iam/instance_profile.go @@ -33,7 +33,7 @@ const ( // @SDKResource("aws_iam_instance_profile", name="Instance Profile") // @Tags(identifierAttribute="id", resourceType="InstanceProfile") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types.InstanceProfile") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types;types.InstanceProfile") func resourceInstanceProfile() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceInstanceProfileCreate, diff --git a/internal/service/iam/policy.go b/internal/service/iam/policy.go index 5bf5e887c52..d23560b3022 100644 --- a/internal/service/iam/policy.go +++ b/internal/service/iam/policy.go @@ -36,7 +36,7 @@ const ( // @SDKResource("aws_iam_policy", name="Policy") // @Tags(identifierAttribute="id", resourceType="Policy") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types.Policy") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types;types.Policy") func resourcePolicy() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourcePolicyCreate, diff --git a/internal/service/iam/role.go b/internal/service/iam/role.go index abcc77cde2b..f3f1dcfa24c 100644 --- a/internal/service/iam/role.go +++ b/internal/service/iam/role.go @@ -41,7 +41,7 @@ const ( // @SDKResource("aws_iam_role", name="Role") // @Tags(identifierAttribute="id", resourceType="Role") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types.Role") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types;types.Role") func resourceRole() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceRoleCreate, diff --git a/internal/service/iam/user.go b/internal/service/iam/user.go index 956a2932a42..9318de4f599 100644 --- a/internal/service/iam/user.go +++ b/internal/service/iam/user.go @@ -29,7 +29,7 @@ import ( // @SDKResource("aws_iam_user", name="User") // @Tags(identifierAttribute="id", resourceType="User") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types.User", importIgnore="force_destroy") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types;types.User", importIgnore="force_destroy") func resourceUser() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceUserCreate, diff --git a/internal/service/iam/virtual_mfa_device.go b/internal/service/iam/virtual_mfa_device.go index 712f249330c..e6c00f314ed 100644 --- a/internal/service/iam/virtual_mfa_device.go +++ b/internal/service/iam/virtual_mfa_device.go @@ -30,7 +30,7 @@ import ( // @SDKResource("aws_iam_virtual_mfa_device", name="Virtual MFA Device") // @Tags(identifierAttribute="id", resourceType="VirtualMFADevice") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types.VirtualMFADevice", importIgnore="base_32_string_seed;qr_code_png") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/iam/types;types.VirtualMFADevice", importIgnore="base_32_string_seed;qr_code_png") func resourceVirtualMFADevice() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceVirtualMFADeviceCreate, diff --git a/internal/service/servicecatalog/portfolio.go b/internal/service/servicecatalog/portfolio.go index 204864d224f..bae633466f4 100644 --- a/internal/service/servicecatalog/portfolio.go +++ b/internal/service/servicecatalog/portfolio.go @@ -26,7 +26,7 @@ import ( // @SDKResource("aws_servicecatalog_portfolio", name="Portfolio") // @Tags -// @Testing(existsType="github.com/aws/aws-sdk-go/service/servicecatalog.DescribePortfolioOutput", generator="github.com/hashicorp/terraform-plugin-testing/helper/acctest;sdkacctest;sdkacctest.RandString(5)", skipEmptyTags=true) +// @Testing(existsType="github.com/aws/aws-sdk-go/service/servicecatalog;servicecatalog.DescribePortfolioOutput", generator="github.com/hashicorp/terraform-plugin-testing/helper/acctest;sdkacctest;sdkacctest.RandString(5)", skipEmptyTags=true) func ResourcePortfolio() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourcePortfolioCreate, diff --git a/internal/service/servicecatalog/provisioned_product.go b/internal/service/servicecatalog/provisioned_product.go index cc9f3ed8e4f..8269515931e 100644 --- a/internal/service/servicecatalog/provisioned_product.go +++ b/internal/service/servicecatalog/provisioned_product.go @@ -30,7 +30,7 @@ import ( // @SDKResource("aws_servicecatalog_provisioned_product", name="Provisioned Product") // @Tags -// @Testing(tagsTest=config-only, existsType="github.com/aws/aws-sdk-go/service/servicecatalog.ProvisionedProductDetail",importIgnore="accept_language;ignore_errors;provisioning_artifact_name;provisioning_parameters;retain_physical_resources", skipEmptyTags=true) +// @Testing(tagsTest=config-only, existsType="github.com/aws/aws-sdk-go/service/servicecatalog;servicecatalog.ProvisionedProductDetail",importIgnore="accept_language;ignore_errors;provisioning_artifact_name;provisioning_parameters;retain_physical_resources", skipEmptyTags=true) func ResourceProvisionedProduct() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceProvisionedProductCreate, diff --git a/internal/service/xray/group.go b/internal/service/xray/group.go index aca4c2ae31a..14cedad4897 100644 --- a/internal/service/xray/group.go +++ b/internal/service/xray/group.go @@ -24,7 +24,7 @@ import ( // @SDKResource("aws_xray_group", name="Group") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/xray/types.Group") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/xray/types;types.Group") func resourceGroup() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceGroupCreate, diff --git a/internal/service/xray/sampling_rule.go b/internal/service/xray/sampling_rule.go index 024d6f7c6dc..3203f34f888 100644 --- a/internal/service/xray/sampling_rule.go +++ b/internal/service/xray/sampling_rule.go @@ -26,7 +26,7 @@ import ( // @SDKResource("aws_xray_sampling_rule", name="Sampling Rule") // @Tags(identifierAttribute="arn") -// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/xray/types.SamplingRule") +// @Testing(existsType="github.com/aws/aws-sdk-go-v2/service/xray/types;types.SamplingRule") func resourceSamplingRule() *schema.Resource { return &schema.Resource{ CreateWithoutTimeout: resourceSamplingRuleCreate, From 1a722d2ce96b87b3cef5cb53156154f87347cf5c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 25 Apr 2024 11:33:01 -0700 Subject: [PATCH 16/23] Removes unneeded config files --- .../testdata/Portfolio/tags0_default1_gen.tf | 34 ---- .../testdata/Portfolio/tags0_default2_gen.tf | 46 ----- .../testdata/Portfolio/tags0_gen.tf | 17 -- .../testdata/Portfolio/tags1_default1_gen.tf | 47 ----- .../testdata/Portfolio/tags1_gen.tf | 30 ---- .../testdata/Portfolio/tags2_default1_gen.tf | 58 ------- .../testdata/Portfolio/tags2_default2_gen.tf | 70 -------- .../testdata/Portfolio/tags2_gen.tf | 41 ----- .../Portfolio/tagsNull_default1_gen.tf | 42 ----- .../testdata/Portfolio/tagsNull_gen.tf | 25 --- .../testdata/Product/tags0_default1_gen.tf | 78 --------- .../testdata/Product/tags0_default2_gen.tf | 90 ---------- .../testdata/Product/tags0_gen.tf | 61 ------- .../testdata/Product/tags1_default1_gen.tf | 91 ---------- .../testdata/Product/tags1_gen.tf | 74 -------- .../testdata/Product/tags2_default1_gen.tf | 102 ----------- .../testdata/Product/tags2_default2_gen.tf | 114 ------------- .../testdata/Product/tags2_gen.tf | 85 --------- .../testdata/Product/tagsNull_default1_gen.tf | 86 ---------- .../testdata/Product/tagsNull_gen.tf | 69 -------- .../ProvisionedProduct/tags0_default1_gen.tf | 125 -------------- .../ProvisionedProduct/tags0_default2_gen.tf | 137 --------------- .../testdata/ProvisionedProduct/tags0_gen.tf | 108 ------------ .../ProvisionedProduct/tags1_default1_gen.tf | 138 --------------- .../testdata/ProvisionedProduct/tags1_gen.tf | 121 ------------- .../ProvisionedProduct/tags2_default1_gen.tf | 149 ---------------- .../ProvisionedProduct/tags2_default2_gen.tf | 161 ------------------ .../testdata/ProvisionedProduct/tags2_gen.tf | 132 -------------- .../tagsNull_default1_gen.tf | 133 --------------- .../ProvisionedProduct/tagsNull_gen.tf | 116 ------------- 30 files changed, 2580 deletions(-) delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags0_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf deleted file mode 100644 index fe2c8be86e0..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags0_default1_gen.tf +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - -} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf deleted file mode 100644 index 1eb18fdccb8..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags0_default2_gen.tf +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - -} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf deleted file mode 100644 index 08eb335c8ff..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags0_gen.tf +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - -} - - -variable "rName" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf deleted file mode 100644 index 622333cbe51..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags1_default1_gen.tf +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = var.tagValue1 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf deleted file mode 100644 index 812e5b58ff6..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags1_gen.tf +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = var.tagValue1 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf deleted file mode 100644 index f91afa13141..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags2_default1_gen.tf +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf deleted file mode 100644 index 8b03f05a8bb..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags2_default2_gen.tf +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf deleted file mode 100644 index eaed4a5d5b2..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tags2_gen.tf +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf deleted file mode 100644 index a1132dcaf1b..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_default1_gen.tf +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = null - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf b/internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf deleted file mode 100644 index 2d6a573c544..00000000000 --- a/internal/service/servicecatalog/testdata/Portfolio/tagsNull_gen.tf +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = "test-b" - provider_name = "test-c" - - tags = { - (var.tagKey1) = null - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf deleted file mode 100644 index ac0ccd45bce..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags0_default1_gen.tf +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf deleted file mode 100644 index 88ed5494e34..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags0_default2_gen.tf +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Product/tags0_gen.tf b/internal/service/servicecatalog/testdata/Product/tags0_gen.tf deleted file mode 100644 index 67beb3ee7ce..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags0_gen.tf +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf deleted file mode 100644 index 34d72fba297..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags1_default1_gen.tf +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = var.tagValue1 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Product/tags1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags1_gen.tf deleted file mode 100644 index 30e50a5eac6..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags1_gen.tf +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = var.tagValue1 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf deleted file mode 100644 index 03d6870806d..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags2_default1_gen.tf +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf deleted file mode 100644 index 5a289b36da6..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags2_default2_gen.tf +++ /dev/null @@ -1,114 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Product/tags2_gen.tf b/internal/service/servicecatalog/testdata/Product/tags2_gen.tf deleted file mode 100644 index d24f8ceea7a..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tags2_gen.tf +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf b/internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf deleted file mode 100644 index e169b91f0c9..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tagsNull_default1_gen.tf +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = null - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf b/internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf deleted file mode 100644 index 32ca1a0cf00..00000000000 --- a/internal/service/servicecatalog/testdata/Product/tagsNull_gen.tf +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } - - tags = { - (var.tagKey1) = null - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Resources = { - MyVPC = { - Type = "AWS::EC2::VPC" - Properties = { - CidrBlock = "10.1.0.0/16" - } - } - } - - Outputs = { - VpcID = { - Description = "VPC ID" - Value = { - Ref = "MyVPC" - } - } - } - }) -} - -data "aws_partition" "current" {} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf deleted file mode 100644 index 70fbdc93b83..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default1_gen.tf +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf deleted file mode 100644 index b81c80e2ee6..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2_gen.tf +++ /dev/null @@ -1,137 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf deleted file mode 100644 index 0975df6166a..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_gen.tf +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf deleted file mode 100644 index d2d7283370b..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_default1_gen.tf +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = var.tagValue1 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf deleted file mode 100644 index 4304d040413..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags1_gen.tf +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = var.tagValue1 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf deleted file mode 100644 index d21c8c7cba5..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default1_gen.tf +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf deleted file mode 100644 index 9d4d551bc57..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2_gen.tf +++ /dev/null @@ -1,161 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf deleted file mode 100644 index 923fb5b6d52..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_gen.tf +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf deleted file mode 100644 index 3dd3a83c710..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_default1_gen.tf +++ /dev/null @@ -1,133 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = null - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf b/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf deleted file mode 100644 index 916375b9914..00000000000 --- a/internal/service/servicecatalog/testdata/ProvisionedProduct/tagsNull_gen.tf +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_servicecatalog_provisioned_product" "test" { - name = var.rName - product_id = aws_servicecatalog_constraint.test.product_id - provisioning_artifact_name = var.rName - path_id = data.aws_servicecatalog_launch_paths.test.summaries[0].path_id - - provisioning_parameters { - key = "BucketName" - value = "${var.rName}-dest" - } - - tags = { - (var.tagKey1) = null - } -} - -resource "aws_s3_bucket" "test" { - bucket = var.rName - force_destroy = true -} - -resource "aws_s3_object" "test" { - bucket = aws_s3_bucket.test.id - key = "${var.rName}.json" - - content = jsonencode({ - AWSTemplateFormatVersion = "2010-09-09" - - Parameters = { - BucketName = { - Type = "String" - } - } - - Resources = { - MyS3Bucket = { - Type = "AWS::S3::Bucket" - Properties = { - BucketName = { Ref = "BucketName" } - } - } - } - }) -} - -resource "aws_servicecatalog_product" "test" { - description = var.rName - distributor = "distributör" - name = var.rName - owner = "ägare" - type = "CLOUD_FORMATION_TEMPLATE" - - provisioning_artifact_parameters { - description = "artefaktbeskrivning" - disable_template_validation = true - name = var.rName - template_url = "https://${aws_s3_bucket.test.bucket_regional_domain_name}/${aws_s3_object.test.key}" - type = "CLOUD_FORMATION_TEMPLATE" - } -} - -resource "aws_servicecatalog_portfolio" "test" { - name = var.rName - description = var.rName - provider_name = var.rName -} - -resource "aws_servicecatalog_constraint" "test" { - description = var.rName - portfolio_id = aws_servicecatalog_product_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product_portfolio_association.test.product_id - type = "RESOURCE_UPDATE" - - parameters = jsonencode({ - Version = "2.0" - Properties = { - TagUpdateOnProvisionedProduct = "ALLOWED" - } - }) -} - -resource "aws_servicecatalog_product_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_principal_portfolio_association.test.portfolio_id - product_id = aws_servicecatalog_product.test.id -} - -data "aws_caller_identity" "current" {} - -data "aws_iam_session_context" "current" { - arn = data.aws_caller_identity.current.arn -} - -resource "aws_servicecatalog_principal_portfolio_association" "test" { - portfolio_id = aws_servicecatalog_portfolio.test.id - principal_arn = data.aws_iam_session_context.current.issuer_arn # unfortunately, you cannot get launch_path for arbitrary role - only caller -} - -data "aws_servicecatalog_launch_paths" "test" { - product_id = aws_servicecatalog_product_portfolio_association.test.product_id -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - - From 4aecbd98c9553edac058c897c5eaf461d233c15c Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 25 Apr 2024 12:38:55 -0700 Subject: [PATCH 17/23] Updates Provisioned Product tests to use directory --- .../provisioned_product_tags_test.go | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/internal/service/servicecatalog/provisioned_product_tags_test.go b/internal/service/servicecatalog/provisioned_product_tags_test.go index 00ae9a61894..5991233b697 100644 --- a/internal/service/servicecatalog/provisioned_product_tags_test.go +++ b/internal/service/servicecatalog/provisioned_product_tags_test.go @@ -27,7 +27,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -40,7 +40,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -54,7 +54,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -70,7 +70,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -86,7 +86,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { }, }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "tagKey1": config.StringVariable("key2"), @@ -99,7 +99,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // ), // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "tagKey1": config.StringVariable("key2"), @@ -113,7 +113,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // }, // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -123,7 +123,7 @@ func TestAccServiceCatalogProvisionedProduct_tags(t *testing.T) { // ), // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -151,7 +151,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -162,7 +162,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tagsNull/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -175,7 +175,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_null(t *testing.T) { }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -199,7 +199,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -209,7 +209,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -222,7 +222,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -254,7 +254,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -267,7 +267,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -281,7 +281,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -291,7 +291,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnCreate(t *testing.T ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -321,7 +321,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -334,7 +334,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -350,7 +350,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -366,7 +366,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -379,7 +379,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Add(t *testi ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -411,7 +411,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -424,7 +424,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -437,7 +437,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_EmptyTag_OnUpdate_Replace(t *t ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -466,7 +466,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -480,7 +480,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -494,7 +494,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -511,7 +511,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -527,7 +527,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te }, }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "providerTagKey1": config.StringVariable("key2"), @@ -541,7 +541,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // ), // }, // { - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // "providerTagKey1": config.StringVariable("key2"), @@ -556,7 +556,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -568,7 +568,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_providerOnly(t *te // }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -595,7 +595,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -613,7 +613,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -629,7 +629,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -651,7 +651,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -670,7 +670,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -682,7 +682,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nonOverlapping(t * // }, // { // ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - // ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0/main_gen.tf"), + // ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0/"), // ConfigVariables: config.Variables{ // "rName": config.StringVariable(rName), // }, @@ -709,7 +709,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -726,7 +726,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -742,7 +742,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -765,7 +765,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags2_default2/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -785,7 +785,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes }, }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -802,7 +802,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_overlapping(t *tes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -834,7 +834,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -849,7 +849,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -863,7 +863,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToProviderOn ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -892,7 +892,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags0_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -907,7 +907,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -923,7 +923,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_updateToResourceOn }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -954,7 +954,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -971,7 +971,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_emptyResourceTag(t ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tags1_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1002,7 +1002,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1017,7 +1017,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullOverlappingRes ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1047,7 +1047,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping CheckDestroy: testAccCheckProvisionedProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1062,7 +1062,7 @@ func TestAccServiceCatalogProvisionedProduct_tags_DefaultTags_nullNonOverlapping ), }, { - ConfigFile: config.StaticFile("testdata/ProvisionedProduct/tagsNull_default1/main_gen.tf"), + ConfigDirectory: config.StaticDirectory("testdata/ProvisionedProduct/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), From 92fe13533606c7d1e8dd17ca50038e6e74b718b4 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Fri, 26 Apr 2024 17:55:58 -0700 Subject: [PATCH 18/23] Moves provider factories to test steps where needed --- internal/generate/tagstests/test.go.tmpl | 89 ++++++++++++------- .../accessanalyzer/analyzer_tags_gen_test.go | 75 ++++++++++------ .../certificate_authority_tags_gen_test.go | 75 ++++++++++------ .../compute_environment_tags_gen_test.go | 75 ++++++++++------ .../batch/job_definition_tags_gen_test.go | 75 ++++++++++------ .../service/batch/job_queue_tags_gen_test.go | 75 ++++++++++------ .../batch/scheduling_policy_tags_gen_test.go | 75 ++++++++++------ .../iam/instance_profile_tags_gen_test.go | 75 ++++++++++------ .../openid_connect_provider_tags_gen_test.go | 75 ++++++++++------ internal/service/iam/policy_tags_gen_test.go | 75 ++++++++++------ internal/service/iam/role_tags_gen_test.go | 75 ++++++++++------ .../iam/service_linked_role_tags_gen_test.go | 75 ++++++++++------ internal/service/iam/user_tags_gen_test.go | 75 ++++++++++------ .../iam/virtual_mfa_device_tags_gen_test.go | 75 ++++++++++------ .../servicecatalog/portfolio_tags_gen_test.go | 75 ++++++++++------ .../servicecatalog/product_tags_gen_test.go | 75 ++++++++++------ internal/service/xray/group_tags_gen_test.go | 75 ++++++++++------ .../xray/sampling_rule_tags_gen_test.go | 75 ++++++++++------ 18 files changed, 907 insertions(+), 457 deletions(-) diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index af6a99805c4..cc37fdc46e4 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -443,7 +443,8 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -457,7 +458,8 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -466,7 +468,8 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -483,7 +486,8 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -494,7 +498,8 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -508,7 +513,8 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -518,7 +524,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -530,7 +536,7 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -547,7 +553,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -565,7 +572,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -576,7 +584,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -598,7 +607,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -612,7 +622,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -624,7 +634,7 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), }, @@ -641,7 +651,8 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -658,7 +669,8 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -669,7 +681,8 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -692,7 +705,8 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -707,7 +721,8 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -724,7 +739,8 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -746,7 +762,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -761,7 +777,8 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -775,7 +792,8 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -794,7 +812,8 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -809,7 +828,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -825,7 +844,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "tagKey1": config.StringVariable("key1"), @@ -847,7 +866,8 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -864,7 +884,8 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -888,7 +909,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -903,7 +925,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -926,7 +949,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( {{ template "TestCaseSetupNoProviders" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -941,7 +965,8 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/accessanalyzer/analyzer_tags_gen_test.go b/internal/service/accessanalyzer/analyzer_tags_gen_test.go index 948e05de193..4f7b9f9b208 100644 --- a/internal/service/accessanalyzer/analyzer_tags_gen_test.go +++ b/internal/service/accessanalyzer/analyzer_tags_gen_test.go @@ -445,7 +445,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -459,7 +460,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -470,7 +472,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +490,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -500,7 +504,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -514,7 +519,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -562,7 +568,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -580,7 +587,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -593,7 +601,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -615,7 +624,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -667,7 +677,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -684,7 +695,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -697,7 +709,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -720,7 +733,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -737,7 +751,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -754,7 +769,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -798,7 +814,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -812,7 +829,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -838,7 +856,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -895,7 +914,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -912,7 +932,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -940,7 +961,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -955,7 +977,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -982,7 +1005,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa CheckDestroy: testAccCheckAnalyzerDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -997,7 +1021,8 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index d815557f79f..3cebc657e00 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -458,7 +458,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -472,7 +473,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -486,7 +488,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -503,7 +506,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -519,7 +523,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -533,7 +538,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -587,7 +593,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -605,7 +612,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -621,7 +629,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -643,7 +652,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -701,7 +711,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +729,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -734,7 +746,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -757,7 +770,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -777,7 +791,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -794,7 +809,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -841,7 +857,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -855,7 +872,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -884,7 +902,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -944,7 +963,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -961,7 +981,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -992,7 +1013,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1007,7 +1029,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1037,7 +1060,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour CheckDestroy: testAccCheckCertificateAuthorityDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1052,7 +1076,8 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/compute_environment_tags_gen_test.go b/internal/service/batch/compute_environment_tags_gen_test.go index 616c993f076..52617a489ea 100644 --- a/internal/service/batch/compute_environment_tags_gen_test.go +++ b/internal/service/batch/compute_environment_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT CheckDestroy: testAccCheckComputeEnvironmentDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index 93228d0d90a..46c148e1284 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -459,7 +459,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +474,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +489,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -504,7 +507,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -520,7 +524,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +539,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -588,7 +594,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -606,7 +613,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -622,7 +630,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -644,7 +653,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -702,7 +712,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -719,7 +730,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +747,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -758,7 +771,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -778,7 +792,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -795,7 +810,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -842,7 +858,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -856,7 +873,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -885,7 +903,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -945,7 +964,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -962,7 +982,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -993,7 +1014,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1008,7 +1030,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1038,7 +1061,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t CheckDestroy: testAccCheckJobDefinitionDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1053,7 +1077,8 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/job_queue_tags_gen_test.go b/internal/service/batch/job_queue_tags_gen_test.go index 169d7e66769..cf7bf4e6d7e 100644 --- a/internal/service/batch/job_queue_tags_gen_test.go +++ b/internal/service/batch/job_queue_tags_gen_test.go @@ -428,7 +428,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -442,7 +443,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -453,7 +455,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -470,7 +473,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -483,7 +487,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -497,7 +502,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -545,7 +551,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -563,7 +570,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -576,7 +584,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -598,7 +607,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -650,7 +660,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -667,7 +678,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -680,7 +692,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -703,7 +716,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -720,7 +734,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -737,7 +752,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -781,7 +797,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -795,7 +812,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -821,7 +839,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -878,7 +897,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -895,7 +915,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -925,7 +946,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -940,7 +962,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -969,7 +992,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test CheckDestroy: testAccCheckJobQueueDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -984,7 +1008,8 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 76150f8c322..5e93325eb12 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag CheckDestroy: testAccCheckSchedulingPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/instance_profile_tags_gen_test.go b/internal/service/iam/instance_profile_tags_gen_test.go index cdf68884686..fa7f6206ea6 100644 --- a/internal/service/iam/instance_profile_tags_gen_test.go +++ b/internal/service/iam/instance_profile_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToProviderOnly(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_updateToResourceOnly(t *testing. CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullOverlappingResourceTag(t *te ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t CheckDestroy: testAccCheckInstanceProfileDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccIAMInstanceProfile_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/InstanceProfile/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/openid_connect_provider_tags_gen_test.go b/internal/service/iam/openid_connect_provider_tags_gen_test.go index 8fb428174cd..21bc79e2f84 100644 --- a/internal/service/iam/openid_connect_provider_tags_gen_test.go +++ b/internal/service/iam/openid_connect_provider_tags_gen_test.go @@ -418,7 +418,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -432,7 +433,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -443,7 +445,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -460,7 +463,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +477,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -487,7 +492,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +540,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -552,7 +559,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -565,7 +573,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -587,7 +596,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nonOverlapping(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -638,7 +648,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -655,7 +666,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -668,7 +680,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -691,7 +704,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -708,7 +722,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -725,7 +740,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_overlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -768,7 +784,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -782,7 +799,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToProviderOnly(t *te ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -807,7 +825,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_updateToResourceOnly(t *te CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -863,7 +882,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -880,7 +900,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_emptyResourceTag(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -907,7 +928,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -922,7 +944,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullOverlappingResourceTag ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -948,7 +971,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource CheckDestroy: testAccCheckOpenIDConnectProviderDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -963,7 +987,8 @@ func TestAccIAMOpenIDConnectProvider_tags_DefaultTags_nullNonOverlappingResource ), }, { - ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/OpenIDConnectProvider/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/policy_tags_gen_test.go b/internal/service/iam/policy_tags_gen_test.go index bb372483308..6733b2f2a24 100644 --- a/internal/service/iam/policy_tags_gen_test.go +++ b/internal/service/iam/policy_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccIAMPolicy_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccIAMPolicy_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccIAMPolicy_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccIAMPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. CheckDestroy: testAccCheckPolicyDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccIAMPolicy_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Policy/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/role_tags_gen_test.go b/internal/service/iam/role_tags_gen_test.go index e69a9ef2ad5..b2bdd7d9cc3 100644 --- a/internal/service/iam/role_tags_gen_test.go +++ b/internal/service/iam/role_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccIAMRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccIAMRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccIAMRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccIAMRole_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccIAMRole_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccIAMRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccIAMRole_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccIAMRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccIAMRole_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccIAMRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccIAMRole_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Role/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/service_linked_role_tags_gen_test.go b/internal/service/iam/service_linked_role_tags_gen_test.go index 8073b84a094..1d8c80545b1 100644 --- a/internal/service/iam/service_linked_role_tags_gen_test.go +++ b/internal/service/iam/service_linked_role_tags_gen_test.go @@ -418,7 +418,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -432,7 +433,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -443,7 +445,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -460,7 +463,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +477,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -487,7 +492,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +540,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -552,7 +559,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -565,7 +573,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -587,7 +596,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -638,7 +648,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -655,7 +666,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -668,7 +680,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -691,7 +704,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -708,7 +722,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -725,7 +740,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -768,7 +784,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -782,7 +799,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToProviderOnly(t *testin ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -807,7 +825,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_updateToResourceOnly(t *testin CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -863,7 +882,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyResourceTag(t *testing.T) CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -880,7 +900,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_emptyResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -907,7 +928,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullOverlappingResourceTag(t * CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -922,7 +944,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullOverlappingResourceTag(t * ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -948,7 +971,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullNonOverlappingResourceTag( CheckDestroy: testAccCheckServiceLinkedRoleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -963,7 +987,8 @@ func TestAccIAMServiceLinkedRole_tags_DefaultTags_nullNonOverlappingResourceTag( ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/ServiceLinkedRole/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/user_tags_gen_test.go b/internal/service/iam/user_tags_gen_test.go index 6cbead48f62..f74c39dfe80 100644 --- a/internal/service/iam/user_tags_gen_test.go +++ b/internal/service/iam/user_tags_gen_test.go @@ -459,7 +459,8 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +474,8 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +489,8 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -504,7 +507,8 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -520,7 +524,8 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +539,8 @@ func TestAccIAMUser_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -588,7 +594,8 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -606,7 +613,8 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -622,7 +630,8 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -644,7 +653,8 @@ func TestAccIAMUser_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -702,7 +712,8 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -719,7 +730,8 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +747,8 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -758,7 +771,8 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -778,7 +792,8 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -795,7 +810,8 @@ func TestAccIAMUser_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -842,7 +858,8 @@ func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -856,7 +873,8 @@ func TestAccIAMUser_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -885,7 +903,8 @@ func TestAccIAMUser_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -945,7 +964,8 @@ func TestAccIAMUser_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -962,7 +982,8 @@ func TestAccIAMUser_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -993,7 +1014,8 @@ func TestAccIAMUser_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1008,7 +1030,8 @@ func TestAccIAMUser_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1038,7 +1061,8 @@ func TestAccIAMUser_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckUserDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1053,7 +1077,8 @@ func TestAccIAMUser_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/User/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/iam/virtual_mfa_device_tags_gen_test.go b/internal/service/iam/virtual_mfa_device_tags_gen_test.go index decb0fa57c4..24b4aa9a968 100644 --- a/internal/service/iam/virtual_mfa_device_tags_gen_test.go +++ b/internal/service/iam/virtual_mfa_device_tags_gen_test.go @@ -459,7 +459,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -473,7 +474,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +489,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -504,7 +507,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -520,7 +524,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -534,7 +539,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -588,7 +594,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -606,7 +613,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -622,7 +630,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -644,7 +653,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -702,7 +712,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -719,7 +730,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +747,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -758,7 +771,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -778,7 +792,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -795,7 +810,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -842,7 +858,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -856,7 +873,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToProviderOnly(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -885,7 +903,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_updateToResourceOnly(t *testing CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -945,7 +964,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyResourceTag(t *testing.T) CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -962,7 +982,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_emptyResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -993,7 +1014,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullOverlappingResourceTag(t *t CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1008,7 +1030,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullOverlappingResourceTag(t *t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1038,7 +1061,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullNonOverlappingResourceTag(t CheckDestroy: testAccCheckVirtualMFADeviceDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1053,7 +1077,8 @@ func TestAccIAMVirtualMFADevice_tags_DefaultTags_nullNonOverlappingResourceTag(t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/VirtualMFADevice/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/servicecatalog/portfolio_tags_gen_test.go b/internal/service/servicecatalog/portfolio_tags_gen_test.go index f4b3b8eda66..cb19c4e2e4d 100644 --- a/internal/service/servicecatalog/portfolio_tags_gen_test.go +++ b/internal/service/servicecatalog/portfolio_tags_gen_test.go @@ -432,7 +432,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -446,7 +447,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -457,7 +459,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -474,7 +477,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -487,7 +491,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -501,7 +506,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_providerOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -549,7 +555,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -567,7 +574,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -580,7 +588,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -602,7 +611,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nonOverlapping(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -654,7 +664,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -671,7 +682,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -684,7 +696,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -707,7 +720,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -724,7 +738,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -741,7 +756,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -785,7 +801,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -799,7 +816,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToProviderOnly(t *tes ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -825,7 +843,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_updateToResourceOnly(t *tes CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -884,7 +903,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -901,7 +921,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_emptyResourceTag(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -929,7 +950,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -944,7 +966,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullOverlappingResourceTag( ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -971,7 +994,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT CheckDestroy: testAccCheckPortfolioDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -986,7 +1010,8 @@ func TestAccServiceCatalogPortfolio_tags_DefaultTags_nullNonOverlappingResourceT ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Portfolio/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/servicecatalog/product_tags_gen_test.go b/internal/service/servicecatalog/product_tags_gen_test.go index 0832359c818..425d300a3b0 100644 --- a/internal/service/servicecatalog/product_tags_gen_test.go +++ b/internal/service/servicecatalog/product_tags_gen_test.go @@ -457,7 +457,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -471,7 +472,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -485,7 +487,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -502,7 +505,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -518,7 +522,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -532,7 +537,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -585,7 +591,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -603,7 +610,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -619,7 +627,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) }, }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -641,7 +650,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nonOverlapping(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -698,7 +708,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -715,7 +726,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -731,7 +743,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -754,7 +767,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -774,7 +788,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -791,7 +806,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -837,7 +853,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -851,7 +868,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToProviderOnly(t *testi ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -879,7 +897,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_updateToResourceOnly(t *testi CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -940,7 +959,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -957,7 +977,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_emptyResourceTag(t *testing.T ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -987,7 +1008,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1002,7 +1024,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullOverlappingResourceTag(t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -1031,7 +1054,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag CheckDestroy: testAccCheckProductDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -1046,7 +1070,8 @@ func TestAccServiceCatalogProduct_tags_DefaultTags_nullNonOverlappingResourceTag ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Product/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/xray/group_tags_gen_test.go b/internal/service/xray/group_tags_gen_test.go index 30c981f7387..1985d8ebad9 100644 --- a/internal/service/xray/group_tags_gen_test.go +++ b/internal/service/xray/group_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccXRayGroup_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccXRayGroup_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccXRayGroup_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccXRayGroup_tags_DefaultTags_updateToProviderOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccXRayGroup_tags_DefaultTags_updateToResourceOnly(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccXRayGroup_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccXRayGroup_tags_DefaultTags_nullOverlappingResourceTag(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. CheckDestroy: testAccCheckGroupDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccXRayGroup_tags_DefaultTags_nullNonOverlappingResourceTag(t *testing. ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/Group/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), diff --git a/internal/service/xray/sampling_rule_tags_gen_test.go b/internal/service/xray/sampling_rule_tags_gen_test.go index ff371eb4233..98f2abbfb75 100644 --- a/internal/service/xray/sampling_rule_tags_gen_test.go +++ b/internal/service/xray/sampling_rule_tags_gen_test.go @@ -426,7 +426,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -440,7 +441,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -451,7 +453,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -468,7 +471,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -481,7 +485,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -495,7 +500,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_providerOnly(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key2"), @@ -543,7 +549,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -561,7 +568,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -574,7 +582,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -596,7 +605,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nonOverlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -648,7 +658,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -665,7 +676,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -678,7 +690,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -701,7 +714,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default2/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags2_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -718,7 +732,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -735,7 +750,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_overlapping(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), @@ -779,7 +795,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -793,7 +810,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToProviderOnly(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -819,7 +837,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_updateToResourceOnly(t *testing.T) CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags0_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -876,7 +895,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -893,7 +913,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_emptyResourceTag(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tags1_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -921,7 +942,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -936,7 +958,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullOverlappingResourceTag(t *test ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), @@ -963,7 +986,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t CheckDestroy: testAccCheckSamplingRuleDestroy(ctx), Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), @@ -978,7 +1002,8 @@ func TestAccXRaySamplingRule_tags_DefaultTags_nullNonOverlappingResourceTag(t *t ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), + ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, + ConfigDirectory: config.StaticDirectory("testdata/SamplingRule/tagsNull_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), From 9bd71467f1ecbe54a0b5ab5e1712e333205ee6dc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 30 Apr 2024 12:15:38 -0700 Subject: [PATCH 19/23] Uses `config.MapVariable` for resource tags --- internal/generate/tagstests/main.go | 11 +- internal/generate/tagstests/test.go.tmpl | 267 +++++++------ internal/generate/tagstests/test.tf.tmpl | 37 +- .../accessanalyzer/analyzer_tags_gen_test.go | 297 ++++++++------- .../Analyzer/{tags1 => tags}/main_gen.tf | 13 +- .../testdata/Analyzer/tags2/main_gen.tf | 39 -- .../Analyzer/tags2_default2/main_gen.tf | 68 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../certificate_authority_tags_gen_test.go | 297 ++++++++------- .../{tags1 => tags}/main_gen.tf | 13 +- .../CertificateAuthority/tags2/main_gen.tf | 49 --- .../tags2_default2/main_gen.tf | 78 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../compute_environment_tags_gen_test.go | 297 ++++++++------- .../batch/job_definition_tags_gen_test.go | 297 ++++++++------- .../service/batch/job_queue_tags_gen_test.go | 297 ++++++++------- .../batch/scheduling_policy_tags_gen_test.go | 297 ++++++++------- .../{tags1 => tags}/main_gen.tf | 13 +- .../ComputeEnvironment/tags2/main_gen.tf | 98 ----- .../tags2_default2/main_gen.tf | 127 ------- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../JobDefinition/{tags1 => tags}/main_gen.tf | 13 +- .../testdata/JobDefinition/tags2/main_gen.tf | 46 --- .../JobDefinition/tags2_default2/main_gen.tf | 75 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../JobQueue/{tags1 => tags}/main_gen.tf | 13 +- .../batch/testdata/JobQueue/tags2/main_gen.tf | 106 ------ .../JobQueue/tags2_default2/main_gen.tf | 135 ------- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../{tags1 => tags}/main_gen.tf | 13 +- .../SchedulingPolicy/tags2/main_gen.tf | 44 --- .../tags2_default2/main_gen.tf | 73 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../iam/instance_profile_tags_gen_test.go | 297 ++++++++------- .../openid_connect_provider_tags_gen_test.go | 297 ++++++++------- internal/service/iam/policy_tags_gen_test.go | 297 ++++++++------- internal/service/iam/role_tags_gen_test.go | 297 ++++++++------- .../iam/service_linked_role_tags_gen_test.go | 297 ++++++++------- .../{tags1 => tags}/main_gen.tf | 13 +- .../InstanceProfile/tags2/main_gen.tf | 63 ---- .../tags2_default2/main_gen.tf | 92 ----- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../{tags1 => tags}/main_gen.tf | 13 +- .../OpenIDConnectProvider/tags2/main_gen.tf | 45 --- .../tags2_default2/main_gen.tf | 74 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../Policy/{tags1 => tags}/main_gen.tf | 13 +- .../iam/testdata/Policy/tags2/main_gen.tf | 58 --- .../Policy/tags2_default2/main_gen.tf | 87 ----- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../testdata/Role/{tags1 => tags}/main_gen.tf | 13 +- .../iam/testdata/Role/tags2/main_gen.tf | 53 --- .../testdata/Role/tags2_default2/main_gen.tf | 82 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../{tags1 => tags}/main_gen.tf | 13 +- .../ServiceLinkedRole/tags2/main_gen.tf | 40 -- .../tags2_default2/main_gen.tf | 69 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../testdata/User/{tags1 => tags}/main_gen.tf | 13 +- .../iam/testdata/User/tags2/main_gen.tf | 39 -- .../testdata/User/tags2_default2/main_gen.tf | 68 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../{tags1 => tags}/main_gen.tf | 13 +- .../VirtualMFADevice/tags2/main_gen.tf | 39 -- .../tags2_default2/main_gen.tf | 68 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- internal/service/iam/user_tags_gen_test.go | 297 ++++++++------- .../iam/virtual_mfa_device_tags_gen_test.go | 297 ++++++++------- .../servicecatalog/portfolio_tags_gen_test.go | 297 ++++++++------- .../servicecatalog/product_tags_gen_test.go | 297 ++++++++------- .../provisioned_product_tags_test.go | 351 ++++++++++-------- .../Portfolio/{tags1 => tags}/main_gen.tf | 13 +- .../testdata/Portfolio/tags2/main_gen.tf | 41 -- .../Portfolio/tags2_default2/main_gen.tf | 70 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../Product/{tags1 => tags}/main_gen.tf | 13 +- .../testdata/Product/tags2/main_gen.tf | 85 ----- .../Product/tags2_default2/main_gen.tf | 114 ------ .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../{tags1 => tags}/main_gen.tf | 13 +- .../ProvisionedProduct/tags2/main_gen.tf | 132 ------- .../tags2_default2/main_gen.tf | 161 -------- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- internal/service/xray/group_tags_gen_test.go | 297 ++++++++------- .../xray/sampling_rule_tags_gen_test.go | 297 ++++++++------- .../Group/{tags1 => tags}/main_gen.tf | 13 +- .../xray/testdata/Group/tags2/main_gen.tf | 40 -- .../testdata/Group/tags2_default2/main_gen.tf | 69 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- .../SamplingRule/{tags1 => tags}/main_gen.tf | 13 +- .../testdata/SamplingRule/tags2/main_gen.tf | 53 --- .../SamplingRule/tags2_default2/main_gen.tf | 82 ---- .../main_gen.tf | 13 +- .../main_gen.tf | 22 +- 111 files changed, 3347 insertions(+), 5894 deletions(-) rename internal/service/accessanalyzer/testdata/Analyzer/{tags1 => tags}/main_gen.tf (59%) delete mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags2/main_gen.tf delete mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags2_default2/main_gen.tf rename internal/service/accessanalyzer/testdata/Analyzer/{tags1_default1 => tags_default1}/main_gen.tf (75%) rename internal/service/accessanalyzer/testdata/Analyzer/{tags2_default1 => tags_default2}/main_gen.tf (71%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags1 => tags}/main_gen.tf (75%) delete mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags2/main_gen.tf delete mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags2_default2/main_gen.tf rename internal/service/acmpca/testdata/CertificateAuthority/{tags1_default1 => tags_default1}/main_gen.tf (82%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags2_default1 => tags_default2}/main_gen.tf (77%) rename internal/service/batch/testdata/ComputeEnvironment/{tags1 => tags}/main_gen.tf (91%) delete mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags2/main_gen.tf delete mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags2_default2/main_gen.tf rename internal/service/batch/testdata/ComputeEnvironment/{tags1_default1 => tags_default1}/main_gen.tf (92%) rename internal/service/batch/testdata/ComputeEnvironment/{tags2_default1 => tags_default2}/main_gen.tf (89%) rename internal/service/batch/testdata/JobDefinition/{tags1 => tags}/main_gen.tf (70%) delete mode 100644 internal/service/batch/testdata/JobDefinition/tags2/main_gen.tf delete mode 100644 internal/service/batch/testdata/JobDefinition/tags2_default2/main_gen.tf rename internal/service/batch/testdata/JobDefinition/{tags1_default1 => tags_default1}/main_gen.tf (80%) rename internal/service/batch/testdata/JobDefinition/{tags2_default1 => tags_default2}/main_gen.tf (75%) rename internal/service/batch/testdata/JobQueue/{tags1 => tags}/main_gen.tf (92%) delete mode 100644 internal/service/batch/testdata/JobQueue/tags2/main_gen.tf delete mode 100644 internal/service/batch/testdata/JobQueue/tags2_default2/main_gen.tf rename internal/service/batch/testdata/JobQueue/{tags1_default1 => tags_default1}/main_gen.tf (93%) rename internal/service/batch/testdata/JobQueue/{tags2_default1 => tags_default2}/main_gen.tf (90%) rename internal/service/batch/testdata/SchedulingPolicy/{tags1 => tags}/main_gen.tf (66%) delete mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags2/main_gen.tf delete mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags2_default2/main_gen.tf rename internal/service/batch/testdata/SchedulingPolicy/{tags1_default1 => tags_default1}/main_gen.tf (78%) rename internal/service/batch/testdata/SchedulingPolicy/{tags2_default1 => tags_default2}/main_gen.tf (73%) rename internal/service/iam/testdata/InstanceProfile/{tags1 => tags}/main_gen.tf (78%) delete mode 100644 internal/service/iam/testdata/InstanceProfile/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/InstanceProfile/tags2_default2/main_gen.tf rename internal/service/iam/testdata/InstanceProfile/{tags1_default1 => tags_default1}/main_gen.tf (84%) rename internal/service/iam/testdata/InstanceProfile/{tags2_default1 => tags_default2}/main_gen.tf (79%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags1 => tags}/main_gen.tf (73%) delete mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags2_default2/main_gen.tf rename internal/service/iam/testdata/OpenIDConnectProvider/{tags1_default1 => tags_default1}/main_gen.tf (81%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags2_default1 => tags_default2}/main_gen.tf (76%) rename internal/service/iam/testdata/Policy/{tags1 => tags}/main_gen.tf (80%) delete mode 100644 internal/service/iam/testdata/Policy/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/Policy/tags2_default2/main_gen.tf rename internal/service/iam/testdata/Policy/{tags1_default1 => tags_default1}/main_gen.tf (85%) rename internal/service/iam/testdata/Policy/{tags2_default1 => tags_default2}/main_gen.tf (80%) rename internal/service/iam/testdata/Role/{tags1 => tags}/main_gen.tf (76%) delete mode 100644 internal/service/iam/testdata/Role/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/Role/tags2_default2/main_gen.tf rename internal/service/iam/testdata/Role/{tags1_default1 => tags_default1}/main_gen.tf (83%) rename internal/service/iam/testdata/Role/{tags2_default1 => tags_default2}/main_gen.tf (78%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags1 => tags}/main_gen.tf (64%) delete mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags2_default2/main_gen.tf rename internal/service/iam/testdata/ServiceLinkedRole/{tags1_default1 => tags_default1}/main_gen.tf (77%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags2_default1 => tags_default2}/main_gen.tf (72%) rename internal/service/iam/testdata/User/{tags1 => tags}/main_gen.tf (57%) delete mode 100644 internal/service/iam/testdata/User/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/User/tags2_default2/main_gen.tf rename internal/service/iam/testdata/User/{tags1_default1 => tags_default1}/main_gen.tf (74%) rename internal/service/iam/testdata/User/{tags2_default1 => tags_default2}/main_gen.tf (70%) rename internal/service/iam/testdata/VirtualMFADevice/{tags1 => tags}/main_gen.tf (60%) delete mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags2/main_gen.tf delete mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags2_default2/main_gen.tf rename internal/service/iam/testdata/VirtualMFADevice/{tags1_default1 => tags_default1}/main_gen.tf (76%) rename internal/service/iam/testdata/VirtualMFADevice/{tags2_default1 => tags_default2}/main_gen.tf (71%) rename internal/service/servicecatalog/testdata/Portfolio/{tags1 => tags}/main_gen.tf (65%) delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2/main_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags2_default2/main_gen.tf rename internal/service/servicecatalog/testdata/Portfolio/{tags1_default1 => tags_default1}/main_gen.tf (77%) rename internal/service/servicecatalog/testdata/Portfolio/{tags2_default1 => tags_default2}/main_gen.tf (73%) rename internal/service/servicecatalog/testdata/Product/{tags1 => tags}/main_gen.tf (89%) delete mode 100644 internal/service/servicecatalog/testdata/Product/tags2/main_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/Product/tags2_default2/main_gen.tf rename internal/service/servicecatalog/testdata/Product/{tags1_default1 => tags_default1}/main_gen.tf (90%) rename internal/service/servicecatalog/testdata/Product/{tags2_default1 => tags_default2}/main_gen.tf (87%) rename internal/service/servicecatalog/testdata/ProvisionedProduct/{tags1 => tags}/main_gen.tf (94%) delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2/main_gen.tf delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags2_default2/main_gen.tf rename internal/service/servicecatalog/testdata/ProvisionedProduct/{tags1_default1 => tags_default1}/main_gen.tf (95%) rename internal/service/servicecatalog/testdata/ProvisionedProduct/{tags2_default1 => tags_default2}/main_gen.tf (93%) rename internal/service/xray/testdata/Group/{tags1 => tags}/main_gen.tf (63%) delete mode 100644 internal/service/xray/testdata/Group/tags2/main_gen.tf delete mode 100644 internal/service/xray/testdata/Group/tags2_default2/main_gen.tf rename internal/service/xray/testdata/Group/{tags1_default1 => tags_default1}/main_gen.tf (77%) rename internal/service/xray/testdata/Group/{tags2_default1 => tags_default2}/main_gen.tf (72%) rename internal/service/xray/testdata/SamplingRule/{tags1 => tags}/main_gen.tf (76%) delete mode 100644 internal/service/xray/testdata/SamplingRule/tags2/main_gen.tf delete mode 100644 internal/service/xray/testdata/SamplingRule/tags2_default2/main_gen.tf rename internal/service/xray/testdata/SamplingRule/{tags1_default1 => tags_default1}/main_gen.tf (82%) rename internal/service/xray/testdata/SamplingRule/{tags2_default1 => tags_default2}/main_gen.tf (78%) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index cc07fdaad04..8babf699e60 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -119,15 +119,13 @@ func main() { if resource.GenerateConfig { testDirPath := path.Join("testdata", resource.Name) + generateTestConfig(g, testDirPath, "tags", 0, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags", 1, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags", 2, configTmplFile, configTmpl) generateTestConfig(g, testDirPath, "tags0", 0, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags1", 0, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags2", 0, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tagsNull", 0, configTmplFile, configTmpl) generateTestConfig(g, testDirPath, "tags0", 1, configTmplFile, configTmpl) generateTestConfig(g, testDirPath, "tags0", 2, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags1", 1, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags2", 1, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags2", 2, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tagsNull", 0, configTmplFile, configTmpl) generateTestConfig(g, testDirPath, "tagsNull", 1, configTmplFile, configTmpl) } } @@ -331,6 +329,7 @@ func (v *visitor) processFuncDecl(funcDecl *ast.FuncDecl) { case "config-only": d.GenerateTests = false + v.g.Warnf("Only generating configurations for %s.%s: verify tests manually", v.packageName, v.functionName) default: v.errs = append(v.errs, fmt.Errorf("invalid tagsTest value: %q at %s.", attr, fmt.Sprintf("%s.%s", v.packageName, v.functionName))) diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index cc37fdc46e4..3011f9fa52a 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -88,11 +88,12 @@ func {{ template "testname" . }}_tags(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -101,22 +102,23 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -126,22 +128,23 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -150,11 +153,12 @@ func {{ template "testname" . }}_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -236,11 +240,12 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -249,11 +254,12 @@ func {{ template "testname" . }}_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -271,11 +277,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -284,11 +291,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -323,11 +331,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -336,13 +345,13 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -352,22 +361,23 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -376,11 +386,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -398,11 +409,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { {{ template "TestCaseSetup" . }} Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -411,11 +423,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -424,11 +437,12 @@ func {{ template "testname" . }}_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -554,13 +568,14 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -573,27 +588,28 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -608,15 +624,15 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -652,13 +668,14 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -670,29 +687,30 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -706,29 +724,30 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -740,13 +759,14 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -762,11 +782,12 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -828,11 +849,12 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -844,11 +866,12 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -867,13 +890,14 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -885,13 +909,14 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, diff --git a/internal/generate/tagstests/test.tf.tmpl b/internal/generate/tagstests/test.tf.tmpl index e302fdb27d4..5a618e9a11c 100644 --- a/internal/generate/tagstests/test.tf.tmpl +++ b/internal/generate/tagstests/test.tf.tmpl @@ -3,10 +3,8 @@ {{ define "tags" }} {{ if eq . "tags0" -}} -{{- else if eq . "tags1" }} - tags = { - (var.tagKey1) = var.tagValue1 - } +{{- else if eq . "tags" }} + tags = var.tags {{- else if eq . "tags2" }} tags = { (var.tagKey1) = var.tagValue1 @@ -42,34 +40,9 @@ variable "rName" { nullable = false } {{ if eq .Tags "tags0" -}} -{{ else if eq .Tags "tags1" }} -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} -{{ else if eq .Tags "tags2" }} -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string +{{ else if eq .Tags "tags" }} +variable "tags" { + type = map(string) nullable = false } {{ else if eq .Tags "tagsNull" }} diff --git a/internal/service/accessanalyzer/analyzer_tags_gen_test.go b/internal/service/accessanalyzer/analyzer_tags_gen_test.go index 4f7b9f9b208..087e7117854 100644 --- a/internal/service/accessanalyzer/analyzer_tags_gen_test.go +++ b/internal/service/accessanalyzer/analyzer_tags_gen_test.go @@ -45,11 +45,12 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -58,24 +59,25 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -85,24 +87,25 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -111,11 +114,12 @@ func testAccAccessAnalyzerAnalyzer_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -212,11 +216,12 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -225,11 +230,12 @@ func testAccAccessAnalyzerAnalyzer_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -252,11 +258,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -265,11 +272,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -311,11 +319,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -324,13 +333,13 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -340,24 +349,25 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -366,11 +376,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -393,11 +404,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -406,11 +418,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -419,11 +432,12 @@ func testAccAccessAnalyzerAnalyzer_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -569,13 +583,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -588,13 +603,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -602,15 +618,15 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -625,15 +641,15 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -678,13 +694,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -696,13 +713,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -710,17 +728,17 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -734,17 +752,17 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -752,13 +770,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -770,13 +789,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -799,11 +819,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -872,11 +893,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -888,11 +910,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -915,13 +938,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -933,13 +957,14 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags1/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf similarity index 59% rename from internal/service/accessanalyzer/testdata/Analyzer/tags1/main_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf index 74a62d1920b..415406af048 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags1/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf @@ -4,9 +4,7 @@ resource "aws_accessanalyzer_analyzer" "test" { analyzer_name =var.rName - tags = { - (var.tagKey1) = var.tagValue1 - } + tags = var.tags } @@ -15,13 +13,8 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string +variable "tags" { + type = map(string) nullable = false } diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2/main_gen.tf deleted file mode 100644 index 5b0227f8b94..00000000000 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags2/main_gen.tf +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2/main_gen.tf deleted file mode 100644 index 1104047ad29..00000000000 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default2/main_gen.tf +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags_default1/main_gen.tf similarity index 75% rename from internal/service/accessanalyzer/testdata/Analyzer/tags1_default1/main_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags_default1/main_gen.tf index 6af610f497e..ccb3d1c7fd4 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags1_default1/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags_default1/main_gen.tf @@ -12,9 +12,7 @@ provider "aws" { resource "aws_accessanalyzer_analyzer" "test" { analyzer_name =var.rName - tags = { - (var.tagKey1) = var.tagValue1 - } + tags = var.tags } @@ -23,13 +21,8 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string +variable "tags" { + type = map(string) nullable = false } diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf similarity index 71% rename from internal/service/accessanalyzer/testdata/Analyzer/tags2_default1/main_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf index 71e15c43d86..a6a40594726 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags2_default1/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf @@ -5,6 +5,7 @@ provider "aws" { default_tags { tags = { (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 } } } @@ -12,10 +13,7 @@ provider "aws" { resource "aws_accessanalyzer_analyzer" "test" { analyzer_name =var.rName - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } + tags = var.tags } @@ -24,33 +22,29 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string +variable "tags" { + type = map(string) nullable = false } -variable "tagValue1" { - type = string - nullable = false -} -variable "tagKey2" { +variable "providerTagKey1" { type = string nullable = false } -variable "tagValue2" { +variable "providerTagValue1" { type = string nullable = false } -variable "providerTagKey1" { +variable "providerTagKey2" { type = string nullable = false } -variable "providerTagValue1" { +variable "providerTagValue2" { type = string nullable = false } diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index 3cebc657e00..9afe5ae7a73 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -25,11 +25,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -38,11 +39,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -52,13 +54,13 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -68,13 +70,13 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -84,11 +86,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -97,11 +100,12 @@ func TestAccACMPCACertificateAuthority_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -207,11 +211,12 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -220,11 +225,12 @@ func TestAccACMPCACertificateAuthority_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -250,11 +256,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -263,11 +270,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -315,11 +323,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -328,13 +337,13 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -344,13 +353,13 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -360,11 +369,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) }, }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -373,11 +383,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Add(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -403,11 +414,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -416,11 +428,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -429,11 +442,12 @@ func TestAccACMPCACertificateAuthority_tags_EmptyTag_OnUpdate_Replace(t *testing ), }, { - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -594,13 +608,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -613,13 +628,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -630,15 +646,15 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -653,15 +669,15 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -712,13 +728,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -730,13 +747,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -747,17 +765,17 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -771,17 +789,17 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -792,13 +810,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -810,13 +829,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -842,11 +862,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -918,11 +939,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -934,11 +956,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -964,13 +987,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -982,13 +1006,14 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags1/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags/main_gen.tf similarity index 75% rename from internal/service/acmpca/testdata/CertificateAuthority/tags1/main_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags/main_gen.tf index e61b1948bd4..63420cc1b91 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags1/main_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags/main_gen.tf @@ -14,9 +14,7 @@ resource "aws_acmpca_certificate_authority" "test" { } } - tags = { - (var.tagKey1) = var.tagValue1 - } + tags = var.tags } @@ -25,13 +23,8 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string +variable "tags" { + type = map(string) nullable = false } diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2/main_gen.tf deleted file mode 100644 index 45dceb03677..00000000000 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags2/main_gen.tf +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = var.rName - } - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2/main_gen.tf deleted file mode 100644 index 84c53791cee..00000000000 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default2/main_gen.tf +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = var.rName - } - } - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string - nullable = false -} - -variable "tagKey2" { - type = string - nullable = false -} - -variable "tagValue2" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags_default1/main_gen.tf similarity index 82% rename from internal/service/acmpca/testdata/CertificateAuthority/tags1_default1/main_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags_default1/main_gen.tf index b650c27f538..b224b7e5f64 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags1_default1/main_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags_default1/main_gen.tf @@ -22,9 +22,7 @@ resource "aws_acmpca_certificate_authority" "test" { } } - tags = { - (var.tagKey1) = var.tagValue1 - } + tags = var.tags } @@ -33,13 +31,8 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string +variable "tags" { + type = map(string) nullable = false } diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf similarity index 77% rename from internal/service/acmpca/testdata/CertificateAuthority/tags2_default1/main_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf index 5fc3039167d..1287716b999 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags2_default1/main_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf @@ -5,6 +5,7 @@ provider "aws" { default_tags { tags = { (var.providerTagKey1) = var.providerTagValue1 + (var.providerTagKey2) = var.providerTagValue2 } } } @@ -22,10 +23,7 @@ resource "aws_acmpca_certificate_authority" "test" { } } - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } + tags = var.tags } @@ -34,33 +32,29 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string +variable "tags" { + type = map(string) nullable = false } -variable "tagValue1" { - type = string - nullable = false -} -variable "tagKey2" { +variable "providerTagKey1" { type = string nullable = false } -variable "tagValue2" { +variable "providerTagValue1" { type = string nullable = false } -variable "providerTagKey1" { +variable "providerTagKey2" { type = string nullable = false } -variable "providerTagValue1" { +variable "providerTagValue2" { type = string nullable = false } diff --git a/internal/service/batch/compute_environment_tags_gen_test.go b/internal/service/batch/compute_environment_tags_gen_test.go index 52617a489ea..46b9f08ab7b 100644 --- a/internal/service/batch/compute_environment_tags_gen_test.go +++ b/internal/service/batch/compute_environment_tags_gen_test.go @@ -26,11 +26,12 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -39,24 +40,25 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -66,24 +68,25 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -92,11 +95,12 @@ func TestAccBatchComputeEnvironment_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -193,11 +197,12 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -206,11 +211,12 @@ func TestAccBatchComputeEnvironment_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -233,11 +239,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -246,11 +253,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -292,11 +300,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -305,13 +314,13 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -321,24 +330,25 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -347,11 +357,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -374,11 +385,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -387,11 +399,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -400,11 +413,12 @@ func TestAccBatchComputeEnvironment_tags_EmptyTag_OnUpdate_Replace(t *testing.T) ), }, { - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -550,13 +564,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -569,13 +584,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -583,15 +599,15 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -606,15 +622,15 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -659,13 +675,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -677,13 +694,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -691,17 +709,17 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -715,17 +733,17 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -733,13 +751,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -751,13 +770,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -780,11 +800,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -853,11 +874,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -869,11 +891,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -896,13 +919,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -914,13 +938,14 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index 46c148e1284..b251bc21de6 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -26,11 +26,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -39,11 +40,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -53,13 +55,13 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -69,13 +71,13 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -85,11 +87,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -98,11 +101,12 @@ func TestAccBatchJobDefinition_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -208,11 +212,12 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -221,11 +226,12 @@ func TestAccBatchJobDefinition_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -251,11 +257,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -264,11 +271,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -316,11 +324,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -329,13 +338,13 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -345,13 +354,13 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -361,11 +370,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { }, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -374,11 +384,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -404,11 +415,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -417,11 +429,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -430,11 +443,12 @@ func TestAccBatchJobDefinition_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -595,13 +609,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -614,13 +629,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -631,15 +647,15 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -654,15 +670,15 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -713,13 +729,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -731,13 +748,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -748,17 +766,17 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -772,17 +790,17 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -793,13 +811,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -811,13 +830,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -843,11 +863,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -919,11 +940,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -935,11 +957,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -965,13 +988,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -983,13 +1007,14 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/job_queue_tags_gen_test.go b/internal/service/batch/job_queue_tags_gen_test.go index cf7bf4e6d7e..4ab9065e0e4 100644 --- a/internal/service/batch/job_queue_tags_gen_test.go +++ b/internal/service/batch/job_queue_tags_gen_test.go @@ -26,11 +26,12 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -39,24 +40,25 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -66,24 +68,25 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -92,11 +95,12 @@ func TestAccBatchJobQueue_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -195,11 +199,12 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -208,11 +213,12 @@ func TestAccBatchJobQueue_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -235,11 +241,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -248,11 +255,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -294,11 +302,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -307,13 +316,13 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -323,24 +332,25 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -349,11 +359,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -376,11 +387,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -389,11 +401,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -402,11 +415,12 @@ func TestAccBatchJobQueue_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -552,13 +566,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -571,13 +586,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -585,15 +601,15 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -608,15 +624,15 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -661,13 +677,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -679,13 +696,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -693,17 +711,17 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -717,17 +735,17 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -735,13 +753,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -753,13 +772,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -782,11 +802,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -855,11 +876,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -871,11 +893,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -898,13 +921,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -916,13 +940,14 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 5e93325eb12..5cf91f82122 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -26,11 +26,12 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -39,24 +40,25 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -66,24 +68,25 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1updated"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -92,11 +95,12 @@ func TestAccBatchSchedulingPolicy_tags(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key2"), - "tagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -193,11 +197,12 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -206,11 +211,12 @@ func TestAccBatchSchedulingPolicy_tags_AddOnUpdate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -233,11 +239,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -246,11 +253,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnCreate(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -292,11 +300,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -305,13 +314,13 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -321,24 +330,25 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), - "tagKey2": config.StringVariable("key2"), - "tagValue2": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + "key2": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -347,11 +357,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Add(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -374,11 +385,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, Steps: []resource.TestStep{ { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -387,11 +399,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -400,11 +413,12 @@ func TestAccBatchSchedulingPolicy_tags_EmptyTag_OnUpdate_Replace(t *testing.T) { ), }, { - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, @@ -550,13 +564,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -569,13 +584,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -583,15 +599,15 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -606,15 +622,15 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("providerkey1"), "providerTagValue1": config.StringVariable("providervalue1updated"), - "tagKey1": config.StringVariable("resourcekey1"), - "tagValue1": config.StringVariable("resourcevalue1updated"), - "tagKey2": config.StringVariable("resourcekey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "resourcekey1": config.StringVariable("resourcevalue1updated"), + "resourcekey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -659,13 +675,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -677,13 +694,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -691,17 +709,17 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -715,17 +733,17 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags2_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default2/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), "providerTagKey2": config.StringVariable("overlapkey2"), "providerTagValue2": config.StringVariable("providervalue2"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue1"), - "tagKey2": config.StringVariable("overlapkey2"), - "tagValue2": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue1"), + "overlapkey2": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -733,13 +751,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -751,13 +770,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("overlapkey1"), "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("overlapkey1"), - "tagValue1": config.StringVariable("resourcevalue2"), + "tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("resourcevalue2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -780,11 +800,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -853,11 +874,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -869,11 +891,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -896,13 +919,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -914,13 +938,14 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags1_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), ConfigVariables: config.Variables{ "rName": config.StringVariable(rName), "providerTagKey1": config.StringVariable("key1"), "providerTagValue1": config.StringVariable("value1"), - "tagKey1": config.StringVariable("key1"), - "tagValue1": config.StringVariable(""), + "tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable(""), + }), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags1/main_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags/main_gen.tf similarity index 91% rename from internal/service/batch/testdata/ComputeEnvironment/tags1/main_gen.tf rename to internal/service/batch/testdata/ComputeEnvironment/tags/main_gen.tf index 839ecf43c39..1d427a980d2 100644 --- a/internal/service/batch/testdata/ComputeEnvironment/tags1/main_gen.tf +++ b/internal/service/batch/testdata/ComputeEnvironment/tags/main_gen.tf @@ -6,9 +6,7 @@ resource "aws_batch_compute_environment" "test" { service_role = aws_iam_role.batch_service.arn type = "UNMANAGED" - tags = { - (var.tagKey1) = var.tagValue1 - } + tags = var.tags depends_on = [aws_iam_role_policy_attachment.batch_service] } @@ -74,13 +72,8 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string - nullable = false -} - -variable "tagValue1" { - type = string +variable "tags" { + type = map(string) nullable = false } diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags2/main_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags2/main_gen.tf deleted file mode 100644 index 995ed7f6dcf..00000000000 --- a/internal/service/batch/testdata/ComputeEnvironment/tags2/main_gen.tf +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -resource "aws_batch_compute_environment" "test" { - compute_environment_name = var.rName - service_role = aws_iam_role.batch_service.arn - type = "UNMANAGED" - - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } - - depends_on = [aws_iam_role_policy_attachment.batch_service] -} - -data "aws_partition" "current" {} - -resource "aws_iam_role" "batch_service" { - name = "${var.rName}-batch-service" - - assume_role_policy = < Date: Tue, 30 Apr 2024 15:58:58 -0700 Subject: [PATCH 20/23] Uses `config.MapVariable` for provider tags --- internal/generate/tagstests/main.go | 34 +-- internal/generate/tagstests/test.go.tmpl | 247 ++++++++++-------- internal/generate/tagstests/test.tf.tmpl | 37 +-- .../accessanalyzer/analyzer_tags_gen_test.go | 245 +++++++++-------- .../Analyzer/tags0_default2/main_gen.tf | 44 ---- .../Analyzer/tags0_defaults/main_gen.tf | 25 ++ .../Analyzer/tagsNull_default1/main_gen.tf | 39 --- .../main_gen.tf | 14 +- .../Analyzer/tags_default2/main_gen.tf | 50 ---- .../main_gen.tf | 13 +- .../certificate_authority_tags_gen_test.go | 245 +++++++++-------- .../tags0_default2/main_gen.tf | 54 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 60 ----- .../main_gen.tf | 13 +- .../compute_environment_tags_gen_test.go | 245 +++++++++-------- .../batch/job_definition_tags_gen_test.go | 245 +++++++++-------- .../service/batch/job_queue_tags_gen_test.go | 245 +++++++++-------- .../batch/scheduling_policy_tags_gen_test.go | 245 +++++++++-------- .../tags0_default2/main_gen.tf | 103 -------- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 109 -------- .../main_gen.tf | 13 +- .../JobDefinition/tags0_default2/main_gen.tf | 51 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../JobDefinition/tags_default2/main_gen.tf | 57 ---- .../main_gen.tf | 13 +- .../JobQueue/tags0_default2/main_gen.tf | 111 -------- .../JobQueue/tags0_defaults/main_gen.tf | 92 +++++++ .../JobQueue/tagsNull_default1/main_gen.tf | 106 -------- .../main_gen.tf | 14 +- .../JobQueue/tags_default2/main_gen.tf | 117 --------- .../main_gen.tf | 13 +- .../tags0_default2/main_gen.tf | 49 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 55 ---- .../main_gen.tf | 13 +- .../iam/instance_profile_tags_gen_test.go | 245 +++++++++-------- .../openid_connect_provider_tags_gen_test.go | 245 +++++++++-------- internal/service/iam/policy_tags_gen_test.go | 245 +++++++++-------- internal/service/iam/role_tags_gen_test.go | 245 +++++++++-------- .../iam/service_linked_role_tags_gen_test.go | 245 +++++++++-------- .../tags0_default2/main_gen.tf | 68 ----- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../InstanceProfile/tags_default2/main_gen.tf | 74 ------ .../main_gen.tf | 13 +- .../tags0_default2/main_gen.tf | 50 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 56 ---- .../main_gen.tf | 13 +- .../Policy/tags0_default2/main_gen.tf | 63 ----- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../testdata/Policy/tags_default2/main_gen.tf | 69 ----- .../main_gen.tf | 13 +- .../testdata/Role/tags0_default2/main_gen.tf | 58 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../testdata/Role/tags_default2/main_gen.tf | 64 ----- .../main_gen.tf | 13 +- .../tags0_default2/main_gen.tf | 45 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 51 ---- .../main_gen.tf | 13 +- .../testdata/User/tags0_default2/main_gen.tf | 44 ---- .../testdata/User/tags0_defaults/main_gen.tf | 25 ++ .../User/tagsNull_default1/main_gen.tf | 39 --- .../main_gen.tf | 14 +- .../testdata/User/tags_default2/main_gen.tf | 50 ---- .../main_gen.tf | 13 +- .../tags0_default2/main_gen.tf | 44 ---- .../tags0_defaults/main_gen.tf | 25 ++ .../tagsNull_default1/main_gen.tf | 39 --- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 50 ---- .../main_gen.tf | 13 +- internal/service/iam/user_tags_gen_test.go | 245 +++++++++-------- .../iam/virtual_mfa_device_tags_gen_test.go | 245 +++++++++-------- .../servicecatalog/portfolio_tags_gen_test.go | 245 +++++++++-------- .../servicecatalog/product_tags_gen_test.go | 245 +++++++++-------- .../provisioned_product_tags_test.go | 245 +++++++++-------- .../Portfolio/tags0_default2/main_gen.tf | 46 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../Portfolio/tags_default2/main_gen.tf | 52 ---- .../main_gen.tf | 13 +- .../Product/tags0_default2/main_gen.tf | 90 ------- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../Product/tags_default2/main_gen.tf | 96 ------- .../main_gen.tf | 13 +- .../tags0_default2/main_gen.tf | 137 ---------- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../tags_default2/main_gen.tf | 143 ---------- .../main_gen.tf | 13 +- internal/service/xray/group_tags_gen_test.go | 245 +++++++++-------- .../xray/sampling_rule_tags_gen_test.go | 245 +++++++++-------- .../testdata/Group/tags0_default2/main_gen.tf | 45 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../testdata/Group/tags_default2/main_gen.tf | 51 ---- .../main_gen.tf | 13 +- .../SamplingRule/tags0_default2/main_gen.tf | 58 ---- .../main_gen.tf | 20 +- .../main_gen.tf | 14 +- .../SamplingRule/tags_default2/main_gen.tf | 64 ----- .../main_gen.tf | 13 +- 115 files changed, 2936 insertions(+), 5376 deletions(-) delete mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags0_default2/main_gen.tf create mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf delete mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf rename internal/service/accessanalyzer/testdata/Analyzer/{tags0_default1 => tagsNull_defaults}/main_gen.tf (67%) delete mode 100644 internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf rename internal/service/accessanalyzer/testdata/Analyzer/{tags_default1 => tags_defaults}/main_gen.tf (64%) delete mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags0_default2/main_gen.tf rename internal/service/acmpca/testdata/CertificateAuthority/{tagsNull_default1 => tags0_defaults}/main_gen.tf (63%) rename internal/service/acmpca/testdata/CertificateAuthority/{tags0_default1 => tagsNull_defaults}/main_gen.tf (78%) delete mode 100644 internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf rename internal/service/acmpca/testdata/CertificateAuthority/{tags_default1 => tags_defaults}/main_gen.tf (75%) delete mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags0_default2/main_gen.tf rename internal/service/batch/testdata/ComputeEnvironment/{tagsNull_default1 => tags0_defaults}/main_gen.tf (85%) rename internal/service/batch/testdata/ComputeEnvironment/{tags0_default1 => tagsNull_defaults}/main_gen.tf (92%) delete mode 100644 internal/service/batch/testdata/ComputeEnvironment/tags_default2/main_gen.tf rename internal/service/batch/testdata/ComputeEnvironment/{tags_default1 => tags_defaults}/main_gen.tf (90%) delete mode 100644 internal/service/batch/testdata/JobDefinition/tags0_default2/main_gen.tf rename internal/service/batch/testdata/JobDefinition/{tagsNull_default1 => tags0_defaults}/main_gen.tf (58%) rename internal/service/batch/testdata/JobDefinition/{tags0_default1 => tagsNull_defaults}/main_gen.tf (74%) delete mode 100644 internal/service/batch/testdata/JobDefinition/tags_default2/main_gen.tf rename internal/service/batch/testdata/JobDefinition/{tags_default1 => tags_defaults}/main_gen.tf (72%) delete mode 100644 internal/service/batch/testdata/JobQueue/tags0_default2/main_gen.tf create mode 100644 internal/service/batch/testdata/JobQueue/tags0_defaults/main_gen.tf delete mode 100644 internal/service/batch/testdata/JobQueue/tagsNull_default1/main_gen.tf rename internal/service/batch/testdata/JobQueue/{tags0_default1 => tagsNull_defaults}/main_gen.tf (92%) delete mode 100644 internal/service/batch/testdata/JobQueue/tags_default2/main_gen.tf rename internal/service/batch/testdata/JobQueue/{tags_default1 => tags_defaults}/main_gen.tf (91%) delete mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags0_default2/main_gen.tf rename internal/service/batch/testdata/SchedulingPolicy/{tagsNull_default1 => tags0_defaults}/main_gen.tf (54%) rename internal/service/batch/testdata/SchedulingPolicy/{tags0_default1 => tagsNull_defaults}/main_gen.tf (71%) delete mode 100644 internal/service/batch/testdata/SchedulingPolicy/tags_default2/main_gen.tf rename internal/service/batch/testdata/SchedulingPolicy/{tags_default1 => tags_defaults}/main_gen.tf (69%) delete mode 100644 internal/service/iam/testdata/InstanceProfile/tags0_default2/main_gen.tf rename internal/service/iam/testdata/InstanceProfile/{tagsNull_default1 => tags0_defaults}/main_gen.tf (67%) rename internal/service/iam/testdata/InstanceProfile/{tags0_default1 => tagsNull_defaults}/main_gen.tf (81%) delete mode 100644 internal/service/iam/testdata/InstanceProfile/tags_default2/main_gen.tf rename internal/service/iam/testdata/InstanceProfile/{tags_default1 => tags_defaults}/main_gen.tf (78%) delete mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags0_default2/main_gen.tf rename internal/service/iam/testdata/OpenIDConnectProvider/{tagsNull_default1 => tags0_defaults}/main_gen.tf (61%) rename internal/service/iam/testdata/OpenIDConnectProvider/{tags0_default1 => tagsNull_defaults}/main_gen.tf (77%) delete mode 100644 internal/service/iam/testdata/OpenIDConnectProvider/tags_default2/main_gen.tf rename internal/service/iam/testdata/OpenIDConnectProvider/{tags_default1 => tags_defaults}/main_gen.tf (74%) delete mode 100644 internal/service/iam/testdata/Policy/tags0_default2/main_gen.tf rename internal/service/iam/testdata/Policy/{tagsNull_default1 => tags0_defaults}/main_gen.tf (69%) rename internal/service/iam/testdata/Policy/{tags0_default1 => tagsNull_defaults}/main_gen.tf (82%) delete mode 100644 internal/service/iam/testdata/Policy/tags_default2/main_gen.tf rename internal/service/iam/testdata/Policy/{tags_default1 => tags_defaults}/main_gen.tf (79%) delete mode 100644 internal/service/iam/testdata/Role/tags0_default2/main_gen.tf rename internal/service/iam/testdata/Role/{tagsNull_default1 => tags0_defaults}/main_gen.tf (64%) rename internal/service/iam/testdata/Role/{tags0_default1 => tagsNull_defaults}/main_gen.tf (79%) delete mode 100644 internal/service/iam/testdata/Role/tags_default2/main_gen.tf rename internal/service/iam/testdata/Role/{tags_default1 => tags_defaults}/main_gen.tf (76%) delete mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags0_default2/main_gen.tf rename internal/service/iam/testdata/ServiceLinkedRole/{tagsNull_default1 => tags0_defaults}/main_gen.tf (52%) rename internal/service/iam/testdata/ServiceLinkedRole/{tags0_default1 => tagsNull_defaults}/main_gen.tf (70%) delete mode 100644 internal/service/iam/testdata/ServiceLinkedRole/tags_default2/main_gen.tf rename internal/service/iam/testdata/ServiceLinkedRole/{tags_default1 => tags_defaults}/main_gen.tf (67%) delete mode 100644 internal/service/iam/testdata/User/tags0_default2/main_gen.tf create mode 100644 internal/service/iam/testdata/User/tags0_defaults/main_gen.tf delete mode 100644 internal/service/iam/testdata/User/tagsNull_default1/main_gen.tf rename internal/service/iam/testdata/User/{tags0_default1 => tagsNull_defaults}/main_gen.tf (65%) delete mode 100644 internal/service/iam/testdata/User/tags_default2/main_gen.tf rename internal/service/iam/testdata/User/{tags_default1 => tags_defaults}/main_gen.tf (63%) delete mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags0_default2/main_gen.tf create mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags0_defaults/main_gen.tf delete mode 100644 internal/service/iam/testdata/VirtualMFADevice/tagsNull_default1/main_gen.tf rename internal/service/iam/testdata/VirtualMFADevice/{tags0_default1 => tagsNull_defaults}/main_gen.tf (68%) delete mode 100644 internal/service/iam/testdata/VirtualMFADevice/tags_default2/main_gen.tf rename internal/service/iam/testdata/VirtualMFADevice/{tags_default1 => tags_defaults}/main_gen.tf (65%) delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags0_default2/main_gen.tf rename internal/service/servicecatalog/testdata/Portfolio/{tagsNull_default1 => tags0_defaults}/main_gen.tf (52%) rename internal/service/servicecatalog/testdata/Portfolio/{tags0_default1 => tagsNull_defaults}/main_gen.tf (70%) delete mode 100644 internal/service/servicecatalog/testdata/Portfolio/tags_default2/main_gen.tf rename internal/service/servicecatalog/testdata/Portfolio/{tags_default1 => tags_defaults}/main_gen.tf (68%) delete mode 100644 internal/service/servicecatalog/testdata/Product/tags0_default2/main_gen.tf rename internal/service/servicecatalog/testdata/Product/{tagsNull_default1 => tags0_defaults}/main_gen.tf (81%) rename internal/service/servicecatalog/testdata/Product/{tags0_default1 => tagsNull_defaults}/main_gen.tf (90%) delete mode 100644 internal/service/servicecatalog/testdata/Product/tags_default2/main_gen.tf rename internal/service/servicecatalog/testdata/Product/{tags_default1 => tags_defaults}/main_gen.tf (88%) delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags0_default2/main_gen.tf rename internal/service/servicecatalog/testdata/ProvisionedProduct/{tagsNull_default1 => tags0_defaults}/main_gen.tf (90%) rename internal/service/servicecatalog/testdata/ProvisionedProduct/{tags0_default1 => tagsNull_defaults}/main_gen.tf (95%) delete mode 100644 internal/service/servicecatalog/testdata/ProvisionedProduct/tags_default2/main_gen.tf rename internal/service/servicecatalog/testdata/ProvisionedProduct/{tags_default1 => tags_defaults}/main_gen.tf (94%) delete mode 100644 internal/service/xray/testdata/Group/tags0_default2/main_gen.tf rename internal/service/xray/testdata/Group/{tagsNull_default1 => tags0_defaults}/main_gen.tf (50%) rename internal/service/xray/testdata/Group/{tags0_default1 => tagsNull_defaults}/main_gen.tf (69%) delete mode 100644 internal/service/xray/testdata/Group/tags_default2/main_gen.tf rename internal/service/xray/testdata/Group/{tags_default1 => tags_defaults}/main_gen.tf (66%) delete mode 100644 internal/service/xray/testdata/SamplingRule/tags0_default2/main_gen.tf rename internal/service/xray/testdata/SamplingRule/{tagsNull_default1 => tags0_defaults}/main_gen.tf (64%) rename internal/service/xray/testdata/SamplingRule/{tags0_default1 => tagsNull_defaults}/main_gen.tf (79%) delete mode 100644 internal/service/xray/testdata/SamplingRule/tags_default2/main_gen.tf rename internal/service/xray/testdata/SamplingRule/{tags_default1 => tags_defaults}/main_gen.tf (76%) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 8babf699e60..d7dc3edec50 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -119,14 +119,12 @@ func main() { if resource.GenerateConfig { testDirPath := path.Join("testdata", resource.Name) - generateTestConfig(g, testDirPath, "tags", 0, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags", 1, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags", 2, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags0", 0, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags0", 1, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tags0", 2, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tagsNull", 0, configTmplFile, configTmpl) - generateTestConfig(g, testDirPath, "tagsNull", 1, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags", false, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags", true, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags0", false, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tags0", true, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tagsNull", false, configTmplFile, configTmpl) + generateTestConfig(g, testDirPath, "tagsNull", true, configTmplFile, configTmpl) } } @@ -166,9 +164,8 @@ type goImport struct { } type ConfigDatum struct { - Name string - Tags string - DefaultTags int + Tags string + WithDefaultTags bool } //go:embed test.go.tmpl @@ -365,14 +362,11 @@ func (v *visitor) Visit(node ast.Node) ast.Visitor { return v } -func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount int, configTmplFile, configTmpl string) { - var testName string - if defaultCount > 0 { - testName = fmt.Sprintf("%s_default%d", test, defaultCount) - } else { - testName = fmt.Sprintf("%s", test) +func generateTestConfig(g *common.Generator, dirPath, test string, withDefaults bool, configTmplFile, configTmpl string) { + testName := test + if withDefaults { + testName += "_defaults" } - dirPath = path.Join(dirPath, testName) if err := os.MkdirAll(dirPath, 0755); err != nil { g.Fatalf("creating test directory %q: %w", dirPath, err) @@ -392,8 +386,8 @@ func generateTestConfig(g *common.Generator, dirPath, test string, defaultCount } configData := ConfigDatum{ - Tags: test, - DefaultTags: defaultCount, + Tags: test, + WithDefaultTags: withDefaults, } if err := tf.WriteTemplateSet(tfTemplates, configData); err != nil { g.Fatalf("error generating Terraform file %q: %s", mainPath, err) diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.tmpl index 3011f9fa52a..af0e7237b73 100644 --- a/internal/generate/tagstests/test.go.tmpl +++ b/internal/generate/tagstests/test.go.tmpl @@ -458,11 +458,12 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -473,23 +474,24 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -501,23 +503,24 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -528,11 +531,12 @@ func {{ template "testname" . }}_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -568,11 +572,12 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -588,11 +593,12 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -601,11 +607,12 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -624,11 +631,12 @@ func {{ template "testname" . }}_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -668,11 +676,12 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -687,11 +696,12 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -700,13 +710,13 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -724,13 +734,13 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -740,11 +750,12 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -759,11 +770,12 @@ func {{ template "testname" . }}_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -784,7 +796,7 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), + "rName": config.StringVariable(rName), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable("value1"), }), @@ -799,11 +811,12 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -814,11 +827,12 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToProviderOnly(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -834,11 +848,12 @@ func {{ template "testname" . }}_tags_DefaultTags_updateToResourceOnly(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -890,11 +905,12 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -909,11 +925,12 @@ func {{ template "testname" . }}_tags_DefaultTags_emptyResourceTag(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -935,12 +952,13 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -951,12 +969,13 @@ func {{ template "testname" . }}_tags_DefaultTags_nullOverlappingResourceTag(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, {{- template "ImportBody" .ImportIgnore -}} }, @@ -975,12 +994,13 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( {{- template "ExistsCheck" . -}} @@ -991,12 +1011,13 @@ func {{ template "testname" . }}_tags_DefaultTags_nullNonOverlappingResourceTag( }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/{{ .Name }}/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, {{- template "ImportBody" .ImportIgnore -}} }, diff --git a/internal/generate/tagstests/test.tf.tmpl b/internal/generate/tagstests/test.tf.tmpl index 5a618e9a11c..0b19ccea3a5 100644 --- a/internal/generate/tagstests/test.tf.tmpl +++ b/internal/generate/tagstests/test.tf.tmpl @@ -5,11 +5,6 @@ {{ if eq . "tags0" -}} {{- else if eq . "tags" }} tags = var.tags -{{- else if eq . "tags2" }} - tags = { - (var.tagKey1) = var.tagValue1 - (var.tagKey2) = var.tagValue2 - } {{- else if eq . "tagsNull" }} tags = { (var.tagKey1) = null @@ -17,15 +12,10 @@ {{- end -}} {{ end -}} -{{- if gt .DefaultTags 0 -}} +{{- if .WithDefaultTags -}} provider "aws" { default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 -{{- if gt .DefaultTags 1 }} - (var.providerTagKey2) = var.providerTagValue2 -{{- end }} - } + tags = var.provider_tags } } @@ -52,26 +42,9 @@ variable "tagKey1" { } {{- end }} -{{ if gt .DefaultTags 0 -}} -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} -{{ if gt .DefaultTags 1 }} - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string +{{ if .WithDefaultTags -}} +variable "provider_tags" { + type = map(string) nullable = false } {{ end -}} -{{ end -}} diff --git a/internal/service/accessanalyzer/analyzer_tags_gen_test.go b/internal/service/accessanalyzer/analyzer_tags_gen_test.go index 087e7117854..82eb66123d5 100644 --- a/internal/service/accessanalyzer/analyzer_tags_gen_test.go +++ b/internal/service/accessanalyzer/analyzer_tags_gen_test.go @@ -460,11 +460,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -475,11 +476,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -487,13 +489,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -505,13 +507,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -519,11 +521,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -534,11 +537,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -583,11 +587,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -603,11 +608,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -618,11 +624,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -641,11 +648,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -694,11 +702,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -713,11 +722,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -728,13 +738,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -752,13 +762,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -770,11 +780,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -789,11 +800,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -836,11 +848,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -851,11 +864,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToProviderOnly(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -878,11 +892,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_updateToResourceOnly(t *test Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -938,11 +953,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -957,11 +973,12 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_emptyResourceTag(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -987,12 +1004,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -1003,12 +1021,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullOverlappingResourceTag(t }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, ResourceName: resourceName, ImportState: true, @@ -1031,12 +1050,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAnalyzerExists(ctx, resourceName, &v), @@ -1047,12 +1067,13 @@ func testAccAccessAnalyzerAnalyzer_tags_DefaultTags_nullNonOverlappingResourceTa }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/Analyzer/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2/main_gen.tf deleted file mode 100644 index 73247985566..00000000000 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default2/main_gen.tf +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName - -} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf new file mode 100644 index 00000000000..6b8a3b8eb90 --- /dev/null +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf @@ -0,0 +1,25 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "aws" { + default_tags { + tags = var.provider_tags + } +} + +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name =var.rName + +} + + +variable "rName" { + type = string + nullable = false +} + + +variable "provider_tags" { + type = map(string) + nullable = false +} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf deleted file mode 100644 index 01735ea5376..00000000000 --- a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_default1/main_gen.tf +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } - } -} - -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName - - tags = { - (var.tagKey1) = null - } -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tagKey1" { - type = string - nullable = false -} - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf similarity index 67% rename from internal/service/accessanalyzer/testdata/Analyzer/tags0_default1/main_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf index c29739f43d5..c4a6502034e 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags0_default1/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf @@ -3,15 +3,16 @@ provider "aws" { default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } + tags = var.provider_tags } } resource "aws_accessanalyzer_analyzer" "test" { analyzer_name =var.rName + tags = { + (var.tagKey1) = null + } } @@ -20,13 +21,12 @@ variable "rName" { nullable = false } - -variable "providerTagKey1" { +variable "tagKey1" { type = string nullable = false } -variable "providerTagValue1" { - type = string +variable "provider_tags" { + type = map(string) nullable = false } diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf deleted file mode 100644 index a6a40594726..00000000000 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags_default2/main_gen.tf +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName - - tags = var.tags -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tags" { - type = map(string) - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags_default1/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf similarity index 64% rename from internal/service/accessanalyzer/testdata/Analyzer/tags_default1/main_gen.tf rename to internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf index ccb3d1c7fd4..3da076f33cc 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags_default1/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf @@ -3,9 +3,7 @@ provider "aws" { default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } + tags = var.provider_tags } } @@ -27,12 +25,7 @@ variable "tags" { } -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string +variable "provider_tags" { + type = map(string) nullable = false } diff --git a/internal/service/acmpca/certificate_authority_tags_gen_test.go b/internal/service/acmpca/certificate_authority_tags_gen_test.go index 9afe5ae7a73..bced886dfe0 100644 --- a/internal/service/acmpca/certificate_authority_tags_gen_test.go +++ b/internal/service/acmpca/certificate_authority_tags_gen_test.go @@ -473,11 +473,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -488,11 +489,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -503,13 +505,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -521,13 +523,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -538,11 +540,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -553,11 +556,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_providerOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -608,11 +612,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -628,11 +633,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -646,11 +652,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -669,11 +676,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nonOverlapping(t *testin }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -728,11 +736,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -747,11 +756,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -765,13 +775,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -789,13 +799,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -810,11 +820,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -829,11 +840,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_overlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -879,11 +891,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -894,11 +907,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToProviderOnly(t * }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -924,11 +938,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_updateToResourceOnly(t * Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -987,11 +1002,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -1006,11 +1022,12 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_emptyResourceTag(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -1039,12 +1056,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -1055,12 +1073,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullOverlappingResourceT }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, ResourceName: resourceName, ImportState: true, @@ -1086,12 +1105,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckCertificateAuthorityExists(ctx, resourceName, &v), @@ -1102,12 +1122,13 @@ func TestAccACMPCACertificateAuthority_tags_DefaultTags_nullNonOverlappingResour }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/CertificateAuthority/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2/main_gen.tf deleted file mode 100644 index 366b46cea8d..00000000000 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default2/main_gen.tf +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = var.rName - } - } - -} - - -variable "rName" { - type = string - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags0_defaults/main_gen.tf similarity index 63% rename from internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1/main_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags0_defaults/main_gen.tf index 759cb970e24..007cf6e5233 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_default1/main_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags0_defaults/main_gen.tf @@ -3,9 +3,7 @@ provider "aws" { default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } + tags = var.provider_tags } } @@ -22,9 +20,6 @@ resource "aws_acmpca_certificate_authority" "test" { } } - tags = { - (var.tagKey1) = null - } } @@ -33,17 +28,8 @@ variable "rName" { nullable = false } -variable "tagKey1" { - type = string - nullable = false -} - -variable "providerTagKey1" { - type = string - nullable = false -} -variable "providerTagValue1" { - type = string +variable "provider_tags" { + type = map(string) nullable = false } diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_defaults/main_gen.tf similarity index 78% rename from internal/service/acmpca/testdata/CertificateAuthority/tags0_default1/main_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tagsNull_defaults/main_gen.tf index 2353de482fc..16224034d81 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags0_default1/main_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tagsNull_defaults/main_gen.tf @@ -3,9 +3,7 @@ provider "aws" { default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } + tags = var.provider_tags } } @@ -22,6 +20,9 @@ resource "aws_acmpca_certificate_authority" "test" { } } + tags = { + (var.tagKey1) = null + } } @@ -30,13 +31,12 @@ variable "rName" { nullable = false } - -variable "providerTagKey1" { +variable "tagKey1" { type = string nullable = false } -variable "providerTagValue1" { - type = string +variable "provider_tags" { + type = map(string) nullable = false } diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf deleted file mode 100644 index 1287716b999..00000000000 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags_default2/main_gen.tf +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_acmpca_certificate_authority" "test" { - permanent_deletion_time_in_days = 7 - usage_mode = "SHORT_LIVED_CERTIFICATE" - - certificate_authority_configuration { - key_algorithm = "RSA_4096" - signing_algorithm = "SHA512WITHRSA" - - subject { - common_name = var.rName - } - } - - tags = var.tags -} - - -variable "rName" { - type = string - nullable = false -} - -variable "tags" { - type = map(string) - nullable = false -} - - -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string - nullable = false -} - - -variable "providerTagKey2" { - type = string - nullable = false -} - -variable "providerTagValue2" { - type = string - nullable = false -} diff --git a/internal/service/acmpca/testdata/CertificateAuthority/tags_default1/main_gen.tf b/internal/service/acmpca/testdata/CertificateAuthority/tags_defaults/main_gen.tf similarity index 75% rename from internal/service/acmpca/testdata/CertificateAuthority/tags_default1/main_gen.tf rename to internal/service/acmpca/testdata/CertificateAuthority/tags_defaults/main_gen.tf index b224b7e5f64..ae3513d3bd9 100644 --- a/internal/service/acmpca/testdata/CertificateAuthority/tags_default1/main_gen.tf +++ b/internal/service/acmpca/testdata/CertificateAuthority/tags_defaults/main_gen.tf @@ -3,9 +3,7 @@ provider "aws" { default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - } + tags = var.provider_tags } } @@ -37,12 +35,7 @@ variable "tags" { } -variable "providerTagKey1" { - type = string - nullable = false -} - -variable "providerTagValue1" { - type = string +variable "provider_tags" { + type = map(string) nullable = false } diff --git a/internal/service/batch/compute_environment_tags_gen_test.go b/internal/service/batch/compute_environment_tags_gen_test.go index 46b9f08ab7b..8ad2c7febb5 100644 --- a/internal/service/batch/compute_environment_tags_gen_test.go +++ b/internal/service/batch/compute_environment_tags_gen_test.go @@ -441,11 +441,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -456,11 +457,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -468,13 +470,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -486,13 +488,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -500,11 +502,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -515,11 +518,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_providerOnly(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -564,11 +568,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -584,11 +589,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -599,11 +605,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -622,11 +629,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nonOverlapping(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -675,11 +683,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -694,11 +703,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -709,13 +719,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -733,13 +743,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -751,11 +761,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -770,11 +781,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -817,11 +829,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -832,11 +845,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToProviderOnly(t *tes }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -859,11 +873,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_updateToResourceOnly(t *tes Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -919,11 +934,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -938,11 +954,12 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_emptyResourceTag(t *testing }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -968,12 +985,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -984,12 +1002,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullOverlappingResourceTag( }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, ResourceName: resourceName, ImportState: true, @@ -1012,12 +1031,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckComputeEnvironmentExists(ctx, resourceName, &v), @@ -1028,12 +1048,13 @@ func TestAccBatchComputeEnvironment_tags_DefaultTags_nullNonOverlappingResourceT }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/ComputeEnvironment/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/job_definition_tags_gen_test.go b/internal/service/batch/job_definition_tags_gen_test.go index b251bc21de6..21ce0f1adcd 100644 --- a/internal/service/batch/job_definition_tags_gen_test.go +++ b/internal/service/batch/job_definition_tags_gen_test.go @@ -474,11 +474,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -489,11 +490,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -504,13 +506,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -522,13 +524,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -539,11 +541,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -554,11 +557,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -609,11 +613,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -629,11 +634,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -647,11 +653,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -670,11 +677,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -729,11 +737,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -748,11 +757,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -766,13 +776,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -790,13 +800,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -811,11 +821,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -830,11 +841,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -880,11 +892,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -895,11 +908,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToProviderOnly(t *testing. }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -925,11 +939,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_updateToResourceOnly(t *testing. Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -988,11 +1003,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -1007,11 +1023,12 @@ func TestAccBatchJobDefinition_tags_DefaultTags_emptyResourceTag(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -1040,12 +1057,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -1056,12 +1074,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullOverlappingResourceTag(t *te }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, ResourceName: resourceName, ImportState: true, @@ -1087,12 +1106,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobDefinitionExists(ctx, resourceName, &v), @@ -1103,12 +1123,13 @@ func TestAccBatchJobDefinition_tags_DefaultTags_nullNonOverlappingResourceTag(t }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobDefinition/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/job_queue_tags_gen_test.go b/internal/service/batch/job_queue_tags_gen_test.go index 4ab9065e0e4..f50c3ed1306 100644 --- a/internal/service/batch/job_queue_tags_gen_test.go +++ b/internal/service/batch/job_queue_tags_gen_test.go @@ -443,11 +443,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -458,11 +459,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -470,13 +472,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -488,13 +490,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -502,11 +504,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -517,11 +520,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -566,11 +570,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -586,11 +591,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -601,11 +607,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -624,11 +631,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_nonOverlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -677,11 +685,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -696,11 +705,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -711,13 +721,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -735,13 +745,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -753,11 +763,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -772,11 +783,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -819,11 +831,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -834,11 +847,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToProviderOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -861,11 +875,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_updateToResourceOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -921,11 +936,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -940,11 +956,12 @@ func TestAccBatchJobQueue_tags_DefaultTags_emptyResourceTag(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -972,12 +989,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -988,12 +1006,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullOverlappingResourceTag(t *testing }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, ResourceName: resourceName, ImportState: true, @@ -1018,12 +1037,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckJobQueueExists(ctx, resourceName, &v), @@ -1034,12 +1054,13 @@ func TestAccBatchJobQueue_tags_DefaultTags_nullNonOverlappingResourceTag(t *test }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/JobQueue/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/scheduling_policy_tags_gen_test.go b/internal/service/batch/scheduling_policy_tags_gen_test.go index 5cf91f82122..856050e6949 100644 --- a/internal/service/batch/scheduling_policy_tags_gen_test.go +++ b/internal/service/batch/scheduling_policy_tags_gen_test.go @@ -441,11 +441,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -456,11 +457,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -468,13 +470,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -486,13 +488,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1updated"), - "providerTagKey2": config.StringVariable("key2"), - "providerTagValue2": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1updated"), + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -500,11 +502,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -515,11 +518,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_providerOnly(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key2"), - "providerTagValue1": config.StringVariable("value2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key2": config.StringVariable("value2"), + }), }, ResourceName: resourceName, ImportState: true, @@ -564,11 +568,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -584,11 +589,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1"), }), @@ -599,11 +605,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -622,11 +629,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nonOverlapping(t *testing.T) }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1updated"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1updated"), + }), "tags": config.MapVariable(map[string]config.Variable{ "resourcekey1": config.StringVariable("resourcevalue1updated"), "resourcekey2": config.StringVariable("resourcevalue2"), @@ -675,11 +683,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -694,11 +703,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), }), @@ -709,13 +719,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -733,13 +743,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default2/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "providerTagKey2": config.StringVariable("overlapkey2"), - "providerTagValue2": config.StringVariable("providervalue2"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + "overlapkey2": config.StringVariable("providervalue2"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue1"), "overlapkey2": config.StringVariable("resourcevalue2"), @@ -751,11 +761,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -770,11 +781,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_overlapping(t *testing.T) { }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("overlapkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "overlapkey1": config.StringVariable("providervalue1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "overlapkey1": config.StringVariable("resourcevalue2"), }), @@ -817,11 +829,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -832,11 +845,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToProviderOnly(t *testi }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, ResourceName: resourceName, ImportState: true, @@ -859,11 +873,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_updateToResourceOnly(t *testi Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags0_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -919,11 +934,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -938,11 +954,12 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_emptyResourceTag(t *testing.T }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tags_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("value1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("value1"), + }), "tags": config.MapVariable(map[string]config.Variable{ "key1": config.StringVariable(""), }), @@ -968,12 +985,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -984,12 +1002,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullOverlappingResourceTag(t }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("key1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("key1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "key1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("key1"), }, ResourceName: resourceName, ImportState: true, @@ -1012,12 +1031,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag Steps: []resource.TestStep{ { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, Check: resource.ComposeAggregateTestCheckFunc( testAccCheckSchedulingPolicyExists(ctx, resourceName, &v), @@ -1028,12 +1048,13 @@ func TestAccBatchSchedulingPolicy_tags_DefaultTags_nullNonOverlappingResourceTag }, { ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories, - ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_default1/"), + ConfigDirectory: config.StaticDirectory("testdata/SchedulingPolicy/tagsNull_defaults/"), ConfigVariables: config.Variables{ - "rName": config.StringVariable(rName), - "providerTagKey1": config.StringVariable("providerkey1"), - "providerTagValue1": config.StringVariable("providervalue1"), - "tagKey1": config.StringVariable("resourcekey1"), + "rName": config.StringVariable(rName), + "provider_tags": config.MapVariable(map[string]config.Variable{ + "providerkey1": config.StringVariable("providervalue1"), + }), + "tagKey1": config.StringVariable("resourcekey1"), }, ResourceName: resourceName, ImportState: true, diff --git a/internal/service/batch/testdata/ComputeEnvironment/tags0_default2/main_gen.tf b/internal/service/batch/testdata/ComputeEnvironment/tags0_default2/main_gen.tf deleted file mode 100644 index ebb792d1152..00000000000 --- a/internal/service/batch/testdata/ComputeEnvironment/tags0_default2/main_gen.tf +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -provider "aws" { - default_tags { - tags = { - (var.providerTagKey1) = var.providerTagValue1 - (var.providerTagKey2) = var.providerTagValue2 - } - } -} - -resource "aws_batch_compute_environment" "test" { - compute_environment_name = var.rName - service_role = aws_iam_role.batch_service.arn - type = "UNMANAGED" - - - depends_on = [aws_iam_role_policy_attachment.batch_service] -} - -data "aws_partition" "current" {} - -resource "aws_iam_role" "batch_service" { - name = "${var.rName}-batch-service" - - assume_role_policy = < Date: Tue, 30 Apr 2024 16:11:19 -0700 Subject: [PATCH 21/23] Renames templates for syntax colouring --- internal/generate/tagstests/main.go | 4 ++-- internal/generate/tagstests/{test.go.tmpl => test.go.gtpl} | 0 internal/generate/tagstests/{test.tf.tmpl => test.tf.gtpl} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename internal/generate/tagstests/{test.go.tmpl => test.go.gtpl} (100%) rename internal/generate/tagstests/{test.tf.tmpl => test.tf.gtpl} (100%) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index d7dc3edec50..06a920bc3c7 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -168,10 +168,10 @@ type ConfigDatum struct { WithDefaultTags bool } -//go:embed test.go.tmpl +//go:embed test.go.gtpl var testGoTmpl string -//go:embed test.tf.tmpl +//go:embed test.tf.gtpl var testTfTmpl string // Annotation processing. diff --git a/internal/generate/tagstests/test.go.tmpl b/internal/generate/tagstests/test.go.gtpl similarity index 100% rename from internal/generate/tagstests/test.go.tmpl rename to internal/generate/tagstests/test.go.gtpl diff --git a/internal/generate/tagstests/test.tf.tmpl b/internal/generate/tagstests/test.tf.gtpl similarity index 100% rename from internal/generate/tagstests/test.tf.tmpl rename to internal/generate/tagstests/test.tf.gtpl From 568d5764cad77c10988eebf3afe1fe43a617d2b2 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 2 May 2024 10:35:43 -0700 Subject: [PATCH 22/23] Renames resource templates for syntax colouring --- internal/generate/tagstests/main.go | 2 +- .../testdata/tmpl/{analyzer_tags.tmpl => analyzer_tags.gtpl} | 0 ...cate_authority_tags.tmpl => certificate_authority_tags.gtpl} | 0 ...pute_environment_tags.tmpl => compute_environment_tags.gtpl} | 0 .../tmpl/{job_definition_tags.tmpl => job_definition_tags.gtpl} | 0 .../testdata/tmpl/{job_queue_tags.tmpl => job_queue_tags.gtpl} | 0 ...{scheduling_policy_tags.tmpl => scheduling_policy_tags.gtpl} | 0 .../{instance_profile_tags.tmpl => instance_profile_tags.gtpl} | 0 ...ect_provider_tags.tmpl => openid_connect_provider_tags.gtpl} | 0 .../iam/testdata/tmpl/{policy_tags.tmpl => policy_tags.gtpl} | 0 .../iam/testdata/tmpl/{role_tags.tmpl => role_tags.gtpl} | 0 ...vice_linked_role_tags.tmpl => service_linked_role_tags.gtpl} | 0 .../iam/testdata/tmpl/{user_tags.tmpl => user_tags.gtpl} | 0 ...irtual_mfa_device_tags.tmpl => virtual_mfa_device_tags.gtpl} | 0 .../testdata/tmpl/{portfolio_tags.tmpl => portfolio_tags.gtpl} | 0 .../testdata/tmpl/{product_tags.tmpl => product_tags.gtpl} | 0 ...visioned_product_tags.tmpl => provisioned_product_tags.gtpl} | 0 .../xray/testdata/tmpl/{group_tags.tmpl => group_tags.gtpl} | 0 .../tmpl/{sampling_rule_tags.tmpl => sampling_rule_tags.gtpl} | 0 19 files changed, 1 insertion(+), 1 deletion(-) rename internal/service/accessanalyzer/testdata/tmpl/{analyzer_tags.tmpl => analyzer_tags.gtpl} (100%) rename internal/service/acmpca/testdata/tmpl/{certificate_authority_tags.tmpl => certificate_authority_tags.gtpl} (100%) rename internal/service/batch/testdata/tmpl/{compute_environment_tags.tmpl => compute_environment_tags.gtpl} (100%) rename internal/service/batch/testdata/tmpl/{job_definition_tags.tmpl => job_definition_tags.gtpl} (100%) rename internal/service/batch/testdata/tmpl/{job_queue_tags.tmpl => job_queue_tags.gtpl} (100%) rename internal/service/batch/testdata/tmpl/{scheduling_policy_tags.tmpl => scheduling_policy_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{instance_profile_tags.tmpl => instance_profile_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{openid_connect_provider_tags.tmpl => openid_connect_provider_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{policy_tags.tmpl => policy_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{role_tags.tmpl => role_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{service_linked_role_tags.tmpl => service_linked_role_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{user_tags.tmpl => user_tags.gtpl} (100%) rename internal/service/iam/testdata/tmpl/{virtual_mfa_device_tags.tmpl => virtual_mfa_device_tags.gtpl} (100%) rename internal/service/servicecatalog/testdata/tmpl/{portfolio_tags.tmpl => portfolio_tags.gtpl} (100%) rename internal/service/servicecatalog/testdata/tmpl/{product_tags.tmpl => product_tags.gtpl} (100%) rename internal/service/servicecatalog/testdata/tmpl/{provisioned_product_tags.tmpl => provisioned_product_tags.gtpl} (100%) rename internal/service/xray/testdata/tmpl/{group_tags.tmpl => group_tags.gtpl} (100%) rename internal/service/xray/testdata/tmpl/{sampling_rule_tags.tmpl => sampling_rule_tags.gtpl} (100%) diff --git a/internal/generate/tagstests/main.go b/internal/generate/tagstests/main.go index 06a920bc3c7..4eb2052e5b8 100644 --- a/internal/generate/tagstests/main.go +++ b/internal/generate/tagstests/main.go @@ -100,7 +100,7 @@ func main() { } } - configTmplFile := path.Join("testdata", "tmpl", fmt.Sprintf("%s_tags.tmpl", sourceName)) + configTmplFile := path.Join("testdata", "tmpl", fmt.Sprintf("%s_tags.gtpl", sourceName)) var configTmpl string if _, err := os.Stat(configTmplFile); err == nil { b, err := os.ReadFile(configTmplFile) diff --git a/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.tmpl b/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl similarity index 100% rename from internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.tmpl rename to internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl diff --git a/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl b/internal/service/acmpca/testdata/tmpl/certificate_authority_tags.gtpl similarity index 100% rename from internal/service/acmpca/testdata/tmpl/certificate_authority_tags.tmpl rename to internal/service/acmpca/testdata/tmpl/certificate_authority_tags.gtpl diff --git a/internal/service/batch/testdata/tmpl/compute_environment_tags.tmpl b/internal/service/batch/testdata/tmpl/compute_environment_tags.gtpl similarity index 100% rename from internal/service/batch/testdata/tmpl/compute_environment_tags.tmpl rename to internal/service/batch/testdata/tmpl/compute_environment_tags.gtpl diff --git a/internal/service/batch/testdata/tmpl/job_definition_tags.tmpl b/internal/service/batch/testdata/tmpl/job_definition_tags.gtpl similarity index 100% rename from internal/service/batch/testdata/tmpl/job_definition_tags.tmpl rename to internal/service/batch/testdata/tmpl/job_definition_tags.gtpl diff --git a/internal/service/batch/testdata/tmpl/job_queue_tags.tmpl b/internal/service/batch/testdata/tmpl/job_queue_tags.gtpl similarity index 100% rename from internal/service/batch/testdata/tmpl/job_queue_tags.tmpl rename to internal/service/batch/testdata/tmpl/job_queue_tags.gtpl diff --git a/internal/service/batch/testdata/tmpl/scheduling_policy_tags.tmpl b/internal/service/batch/testdata/tmpl/scheduling_policy_tags.gtpl similarity index 100% rename from internal/service/batch/testdata/tmpl/scheduling_policy_tags.tmpl rename to internal/service/batch/testdata/tmpl/scheduling_policy_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/instance_profile_tags.tmpl b/internal/service/iam/testdata/tmpl/instance_profile_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/instance_profile_tags.tmpl rename to internal/service/iam/testdata/tmpl/instance_profile_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/openid_connect_provider_tags.tmpl b/internal/service/iam/testdata/tmpl/openid_connect_provider_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/openid_connect_provider_tags.tmpl rename to internal/service/iam/testdata/tmpl/openid_connect_provider_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/policy_tags.tmpl b/internal/service/iam/testdata/tmpl/policy_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/policy_tags.tmpl rename to internal/service/iam/testdata/tmpl/policy_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/role_tags.tmpl b/internal/service/iam/testdata/tmpl/role_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/role_tags.tmpl rename to internal/service/iam/testdata/tmpl/role_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/service_linked_role_tags.tmpl b/internal/service/iam/testdata/tmpl/service_linked_role_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/service_linked_role_tags.tmpl rename to internal/service/iam/testdata/tmpl/service_linked_role_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/user_tags.tmpl b/internal/service/iam/testdata/tmpl/user_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/user_tags.tmpl rename to internal/service/iam/testdata/tmpl/user_tags.gtpl diff --git a/internal/service/iam/testdata/tmpl/virtual_mfa_device_tags.tmpl b/internal/service/iam/testdata/tmpl/virtual_mfa_device_tags.gtpl similarity index 100% rename from internal/service/iam/testdata/tmpl/virtual_mfa_device_tags.tmpl rename to internal/service/iam/testdata/tmpl/virtual_mfa_device_tags.gtpl diff --git a/internal/service/servicecatalog/testdata/tmpl/portfolio_tags.tmpl b/internal/service/servicecatalog/testdata/tmpl/portfolio_tags.gtpl similarity index 100% rename from internal/service/servicecatalog/testdata/tmpl/portfolio_tags.tmpl rename to internal/service/servicecatalog/testdata/tmpl/portfolio_tags.gtpl diff --git a/internal/service/servicecatalog/testdata/tmpl/product_tags.tmpl b/internal/service/servicecatalog/testdata/tmpl/product_tags.gtpl similarity index 100% rename from internal/service/servicecatalog/testdata/tmpl/product_tags.tmpl rename to internal/service/servicecatalog/testdata/tmpl/product_tags.gtpl diff --git a/internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.tmpl b/internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.gtpl similarity index 100% rename from internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.tmpl rename to internal/service/servicecatalog/testdata/tmpl/provisioned_product_tags.gtpl diff --git a/internal/service/xray/testdata/tmpl/group_tags.tmpl b/internal/service/xray/testdata/tmpl/group_tags.gtpl similarity index 100% rename from internal/service/xray/testdata/tmpl/group_tags.tmpl rename to internal/service/xray/testdata/tmpl/group_tags.gtpl diff --git a/internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl b/internal/service/xray/testdata/tmpl/sampling_rule_tags.gtpl similarity index 100% rename from internal/service/xray/testdata/tmpl/sampling_rule_tags.tmpl rename to internal/service/xray/testdata/tmpl/sampling_rule_tags.gtpl From df2a73e29bf7e6c72696bced090c9bf5a3a25d6f Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 2 May 2024 10:38:30 -0700 Subject: [PATCH 23/23] Formatting fix --- .../service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf | 2 +- .../service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf | 2 +- .../accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf | 2 +- .../accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf | 2 +- .../testdata/Analyzer/tagsNull_defaults/main_gen.tf | 2 +- .../accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf | 2 +- .../service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf index 415406af048..dbddbbc17a2 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags/main_gen.tf @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MPL-2.0 resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName tags = var.tags } diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf index d53964ee3e8..3c6f4e334dc 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags0/main_gen.tf @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MPL-2.0 resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName } diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf index 6b8a3b8eb90..e672bd4700f 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags0_defaults/main_gen.tf @@ -8,7 +8,7 @@ provider "aws" { } resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName } diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf index c4315436ba1..2c698c04093 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull/main_gen.tf @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MPL-2.0 resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName tags = { (var.tagKey1) = null diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf index c4a6502034e..07d6f122971 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tagsNull_defaults/main_gen.tf @@ -8,7 +8,7 @@ provider "aws" { } resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName tags = { (var.tagKey1) = null diff --git a/internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf b/internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf index 3da076f33cc..81fd630c8da 100644 --- a/internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf +++ b/internal/service/accessanalyzer/testdata/Analyzer/tags_defaults/main_gen.tf @@ -8,7 +8,7 @@ provider "aws" { } resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName tags = var.tags } diff --git a/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl b/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl index 266f6c2dd20..0b833387d90 100644 --- a/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl +++ b/internal/service/accessanalyzer/testdata/tmpl/analyzer_tags.gtpl @@ -1,4 +1,4 @@ resource "aws_accessanalyzer_analyzer" "test" { - analyzer_name =var.rName + analyzer_name = var.rName {{- template "tags" . }} }