in tflint-ruleset-aws-serverless/rules/aws_sqs_queue_redrive_policy.go [46:78]
func (r *AwsSqsQueueRedrivePolicyRule) Check(runner tflint.Runner) error {
return runner.WalkResources(r.resourceType, func(resource *configs.Resource) error {
// Attribute
body, _, diags := resource.Config.PartialContent(&hcl.BodySchema{
Attributes: []hcl.AttributeSchema{
{
Name: r.attributeName,
},
},
})
if diags.HasErrors() {
return diags
}
var attrValue string
attribute, ok := body.Attributes[r.attributeName]
if !ok {
runner.EmitIssue(
r,
fmt.Sprintf("\"%s\" is not present.", r.attributeName),
body.MissingItemRange,
)
} else {
err := runner.EvaluateExpr(attribute.Expr, &attrValue, nil)
if err != nil {
return err
}
}
return nil
})
}