driftctl/pkg/resource/aws/aws_iam_user.go

20 lines
621 B
Go

package aws
import (
"github.com/cloudskiff/driftctl/pkg/resource"
)
const AwsIamUserResourceType = "aws_iam_user"
func initAwsIAMUserMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
resourceSchemaRepository.SetNormalizeFunc(AwsIamUserResourceType, func(res *resource.Resource) {
val := res.Attrs
permissionsBoundary, exist := val.Get("permissions_boundary")
if exist && permissionsBoundary == "" {
val.SafeDelete([]string{"permissions_boundary"})
}
val.SafeDelete([]string{"force_destroy"})
})
resourceSchemaRepository.SetFlags(AwsIamUserResourceType, resource.FlagDeepMode)
}