From 79f185ff1a767fc396bb503f33a5d238336b7178 Mon Sep 17 00:00:00 2001 From: Anthony Wat Date: Sun, 7 Jul 2024 04:38:34 -0400 Subject: [PATCH] fix: Remove extra closing bracket in Tags annotation for aws_ecr_repository data source --- .changelog/38272.txt | 3 +++ internal/service/ecr/repository_data_source.go | 2 +- internal/service/ecr/repository_data_source_test.go | 4 ++-- internal/service/ecr/service_package_gen.go | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changelog/38272.txt diff --git a/.changelog/38272.txt b/.changelog/38272.txt new file mode 100644 index 00000000000..3004fe6db6d --- /dev/null +++ b/.changelog/38272.txt @@ -0,0 +1,3 @@ +```release-note:bug +data-source/aws_ecr_repository: Fix issue where the `tags` attribute is not set +``` \ No newline at end of file diff --git a/internal/service/ecr/repository_data_source.go b/internal/service/ecr/repository_data_source.go index 355dcdb75c4..f042d7a64a2 100644 --- a/internal/service/ecr/repository_data_source.go +++ b/internal/service/ecr/repository_data_source.go @@ -19,7 +19,7 @@ import ( ) // @SDKDataSource("aws_ecr_repository", name="Repository") -// @Tags(identifierAttribute="arn")) +// @Tags(identifierAttribute="arn") func dataSourceRepository() *schema.Resource { return &schema.Resource{ ReadWithoutTimeout: dataSourceRepositoryRead, diff --git a/internal/service/ecr/repository_data_source_test.go b/internal/service/ecr/repository_data_source_test.go index 0a3fa673bf9..a4acda2cb80 100644 --- a/internal/service/ecr/repository_data_source_test.go +++ b/internal/service/ecr/repository_data_source_test.go @@ -31,7 +31,7 @@ func TestAccECRRepositoryDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, names.AttrARN, dataSourceName, names.AttrARN), resource.TestCheckResourceAttrPair(resourceName, "registry_id", dataSourceName, "registry_id"), resource.TestCheckResourceAttrPair(resourceName, "repository_url", dataSourceName, "repository_url"), - resource.TestCheckResourceAttrPair(resourceName, names.AttrTags, dataSourceName, names.AttrTags), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsPercent, dataSourceName, acctest.CtTagsPercent), resource.TestCheckResourceAttrPair(resourceName, "image_scanning_configuration.#", dataSourceName, "image_scanning_configuration.#"), resource.TestCheckResourceAttrPair(resourceName, "image_tag_mutability", dataSourceName, "image_tag_mutability"), resource.TestCheckResourceAttrPair(resourceName, "encryption_configuration.#", dataSourceName, "encryption_configuration.#"), @@ -59,7 +59,7 @@ func TestAccECRRepositoryDataSource_encryption(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, names.AttrARN, dataSourceName, names.AttrARN), resource.TestCheckResourceAttrPair(resourceName, "registry_id", dataSourceName, "registry_id"), resource.TestCheckResourceAttrPair(resourceName, "repository_url", dataSourceName, "repository_url"), - resource.TestCheckResourceAttrPair(resourceName, names.AttrTags, dataSourceName, names.AttrTags), + resource.TestCheckResourceAttrPair(resourceName, acctest.CtTagsPercent, dataSourceName, acctest.CtTagsPercent), resource.TestCheckResourceAttrPair(resourceName, "image_scanning_configuration.#", dataSourceName, "image_scanning_configuration.#"), resource.TestCheckResourceAttrPair(resourceName, "image_tag_mutability", dataSourceName, "image_tag_mutability"), resource.TestCheckResourceAttrPair(resourceName, "encryption_configuration.#", dataSourceName, "encryption_configuration.#"), diff --git a/internal/service/ecr/service_package_gen.go b/internal/service/ecr/service_package_gen.go index d04ab8e2aa7..200916df88b 100644 --- a/internal/service/ecr/service_package_gen.go +++ b/internal/service/ecr/service_package_gen.go @@ -52,6 +52,9 @@ func (p *servicePackage) SDKDataSources(ctx context.Context) []*types.ServicePac Factory: dataSourceRepository, TypeName: "aws_ecr_repository", Name: "Repository", + Tags: &types.ServicePackageResourceTags{ + IdentifierAttribute: names.AttrARN, + }, }, } }