driftctl/pkg/resource/aws/aws_sqs_queue_policy.go

19 lines
548 B
Go

package aws
import (
"github.com/snyk/driftctl/enumeration/resource"
"github.com/snyk/driftctl/enumeration/resource/aws"
"github.com/snyk/driftctl/pkg/helpers"
)
func initAwsSQSQueuePolicyMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
resourceSchemaRepository.SetNormalizeFunc(aws.AwsSqsQueuePolicyResourceType, func(res *resource.Resource) {
val := res.Attrs
jsonString, err := helpers.NormalizeJsonString((*val)["policy"])
if err != nil {
return
}
_ = val.SafeSet([]string{"policy"}, jsonString)
})
}