Back to Terraform Provider Aws

AWSR002

.ci/providerlint/passes/AWSR002/README.md

6.44.01008 B
Original Source
<!-- Copyright IBM Corp. 2014, 2026 --> <!-- SPDX-License-Identifier: MPL-2.0 -->

AWSR002

The AWSR002 analyzer reports when a (schema.ResourceData).Set() call with the tags key is missing a call to (keyvaluetags.KeyValueTags).IgnoreConfig() in the value, which ensures any provider level ignore tags configuration is applied.

Flagged Code

go
d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().Map())

Passing Code

go
ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig(ctx)

d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map())

Ignoring Check

The check can be ignored for a certain line via a //lintignore:AWSR002 comment on the previous line or at the end of the offending line, e.g.

go
//lintignore:AWSR002
d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().Map())