Skip to content

Commit

Permalink
Uses transparent tagging for aws_lb_listener_rule data source
Browse files Browse the repository at this point in the history
  • Loading branch information
gdavison committed Oct 25, 2024
1 parent f7d89ff commit 3e79eb4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
11 changes: 1 addition & 10 deletions internal/service/elbv2/listener_rule_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import (
)

// @FrameworkDataSource("aws_lb_listener_rule", name="Listener Rule")
// @Testing(tagsTest=true)
// @Testing(tagsIdentifierAttribute="arn")
// @Tags(identifierAttribute="arn")
func newDataSourceListenerRule(context.Context) (datasource.DataSourceWithConfigure, error) {
return &dataSourceListenerRule{}, nil
}
Expand Down Expand Up @@ -349,14 +348,6 @@ func (d *dataSourceListenerRule) Read(ctx context.Context, req datasource.ReadRe
}
data.Priority = types.Int32Value(int32(priority))

tags, err := listTags(ctx, conn, aws.ToString(out.RuleArn))
if err != nil {
resp.Diagnostics.AddError("listing tags for ELBv2 Listener Rule", err.Error())
return
}
ignoreTagsConfig := d.Meta().IgnoreTagsConfig(ctx)
data.Tags = tftags.FlattenStringValueMap(ctx, tags.IgnoreAWS().IgnoreConfig(ignoreTagsConfig).Map())

resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
}

Expand Down
14 changes: 2 additions & 12 deletions internal/service/elbv2/listener_rule_data_source_tags_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions internal/service/elbv2/service_package_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e79eb4

Please sign in to comment.