driftctl/pkg/resource/aws/aws_iam_user.go

20 lines
621 B
Go
Raw Normal View History

package aws
2021-05-07 15:47:53 +00:00
import (
"github.com/cloudskiff/driftctl/pkg/resource"
)
2021-03-25 11:13:52 +00:00
const AwsIamUserResourceType = "aws_iam_user"
2021-05-07 15:47:53 +00:00
func initAwsIAMUserMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
2021-08-09 14:03:04 +00:00
resourceSchemaRepository.SetNormalizeFunc(AwsIamUserResourceType, func(res *resource.Resource) {
val := res.Attrs
2021-05-07 15:47:53 +00:00
permissionsBoundary, exist := val.Get("permissions_boundary")
if exist && permissionsBoundary == "" {
val.SafeDelete([]string{"permissions_boundary"})
}
val.SafeDelete([]string{"force_destroy"})
})
2021-09-17 15:16:06 +00:00
resourceSchemaRepository.SetFlags(AwsIamUserResourceType, resource.FlagDeepMode)
2021-05-07 15:47:53 +00:00
}