Skip to content

Commit 700fc94

Browse files
committed
Supports IdentityDuplicateAttrs for Custom Inherent Region in Resource Identity test generation
1 parent 1a00f6b commit 700fc94

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/generate/identitytests/resource_test.go.gtpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ ImportPlanChecks: resource.ImportPlanChecks{
148148
{{ end -}}
149149
{{ else if ne .IdentityAttribute "" -}}
150150
plancheck.ExpectKnownValue(resourceName, tfjsonpath.New({{ .IdentityAttribute }}), knownvalue.NotNull()),
151+
{{ if .HasIdentityDuplicateAttrs -}}
152+
{{ range .IdentityDuplicateAttrs -}}
153+
plancheck.ExpectKnownValue(resourceName, tfjsonpath.New({{ . }}), knownvalue.NotNull()),
154+
{{ end -}}
155+
{{ end -}}
151156
{{ end -}}
152157
{{ if not .IsGlobal -}}
153158
plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.Region())),
@@ -190,6 +195,11 @@ ImportPlanChecks: resource.ImportPlanChecks{
190195
{{ end -}}
191196
{{ else if ne .IdentityAttribute "" -}}
192197
plancheck.ExpectKnownValue(resourceName, tfjsonpath.New({{ .IdentityAttribute }}), knownvalue.NotNull()),
198+
{{ if .HasIdentityDuplicateAttrs -}}
199+
{{ range .IdentityDuplicateAttrs -}}
200+
plancheck.ExpectKnownValue(resourceName, tfjsonpath.New({{ . }}), knownvalue.NotNull()),
201+
{{ end -}}
202+
{{ end -}}
193203
{{ end -}}
194204
{{ if not .IsGlobal -}}
195205
plancheck.ExpectKnownValue(resourceName, tfjsonpath.New(names.AttrRegion), knownvalue.StringExact(acctest.AlternateRegion())),

0 commit comments

Comments
 (0)