2021-04-01 13:42:58 +00:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/cloudskiff/driftctl/pkg/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (r *AwsIamPolicyAttachment) NormalizeForState() (resource.Resource, error) {
|
2021-04-02 13:17:41 +00:00
|
|
|
if r.Groups != nil && len(*r.Groups) == 0 {
|
|
|
|
r.Groups = nil
|
|
|
|
}
|
|
|
|
if r.Users != nil && len(*r.Users) == 0 {
|
|
|
|
r.Users = nil
|
|
|
|
}
|
2021-04-01 13:42:58 +00:00
|
|
|
return r, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *AwsIamPolicyAttachment) NormalizeForProvider() (resource.Resource, error) {
|
|
|
|
if r.Groups != nil && len(*r.Groups) == 0 {
|
|
|
|
r.Groups = nil
|
|
|
|
}
|
|
|
|
if r.Users != nil && len(*r.Users) == 0 {
|
|
|
|
r.Users = nil
|
|
|
|
}
|
|
|
|
return r, nil
|
|
|
|
}
|