From f0e7f3e0cb74620569b4416143f5d045abd9d9d4 Mon Sep 17 00:00:00 2001 From: Bryant Biggs Date: Mon, 27 Nov 2023 21:22:38 -0500 Subject: [PATCH] fix: Remove tag manipulation logic --- .../service/eks/pod_identity_association.go | 20 +------------------ .../eks/pod_identity_association_test.go | 4 ++++ internal/service/eks/service_package_gen.go | 2 +- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/internal/service/eks/pod_identity_association.go b/internal/service/eks/pod_identity_association.go index abe5c57fff4a..74a04f4a341a 100644 --- a/internal/service/eks/pod_identity_association.go +++ b/internal/service/eks/pod_identity_association.go @@ -32,7 +32,7 @@ import ( // Function annotations are used for resource registration to the Provider. DO NOT EDIT. // @FrameworkResource(name="Pod Identity Association") -// @Tags(identifierAttribute="association_id") +// @Tags(identifierAttribute="association_arn") func newResourcePodIdentityAssociation(_ context.Context) (resource.ResourceWithConfigure, error) { r := &resourcePodIdentityAssociation{} @@ -195,16 +195,6 @@ func (r *resourcePodIdentityAssociation) Read(ctx context.Context, req resource. return } - tags, err := listTags(ctx, conn, data.AssociationArn.ValueString()) - - if err != nil { - resp.Diagnostics.AddError(fmt.Sprintf("listing tags for Pod Identity Association (%s)", data.AssociationId.ValueString()), err.Error()) - - return - } - - setTagsOut(ctx, Tags(tags)) - resp.Diagnostics.Append(resp.State.Set(ctx, &data)...) } @@ -252,14 +242,6 @@ func (r *resourcePodIdentityAssociation) Update(ctx context.Context, req resourc plan.ModifiedAt = fwflex.StringToFramework(ctx, aws.String(out.Association.ModifiedAt.Format(time.RFC3339))) } - if oldTagsAll, newTagsAll := state.TagsAll, plan.TagsAll; !newTagsAll.Equal(oldTagsAll) { - if err := updateTags(ctx, conn, plan.AssociationArn.ValueString(), oldTagsAll, newTagsAll); err != nil { - resp.Diagnostics.AddError(fmt.Sprintf("updating tags for Pod Identity Association (%s)", plan.AssociationId.ValueString()), err.Error()) - - return - } - } - resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) } diff --git a/internal/service/eks/pod_identity_association_test.go b/internal/service/eks/pod_identity_association_test.go index f2f63245ff97..44fa5b7c517e 100644 --- a/internal/service/eks/pod_identity_association_test.go +++ b/internal/service/eks/pod_identity_association_test.go @@ -263,6 +263,10 @@ resource "aws_eks_pod_identity_association" "test" { namespace = %[1]q service_account = "%[1]s-sa" role_arn = aws_iam_role.test.arn + + tags = { + Name = %[1]q + } } `, rName)) } diff --git a/internal/service/eks/service_package_gen.go b/internal/service/eks/service_package_gen.go index 99ef9c90bd3f..1b613524db27 100644 --- a/internal/service/eks/service_package_gen.go +++ b/internal/service/eks/service_package_gen.go @@ -24,7 +24,7 @@ func (p *servicePackage) FrameworkResources(ctx context.Context) []*types.Servic Factory: newResourcePodIdentityAssociation, Name: "Pod Identity Association", Tags: &types.ServicePackageResourceTags{ - IdentifierAttribute: "association_id", + IdentifierAttribute: "association_arn", }, }, }