2020-12-09 15:31:34 +00:00
|
|
|
package aws
|
|
|
|
|
2021-02-08 18:59:55 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/cloudskiff/driftctl/pkg/resource"
|
|
|
|
)
|
2020-12-09 15:31:34 +00:00
|
|
|
|
|
|
|
func (r *AwsIamAccessKey) NormalizeForState() (resource.Resource, error) {
|
|
|
|
// As we can't read secrets from aws API once access_key created we need to set
|
|
|
|
// fields retrieved from state to nil to avoid drift
|
|
|
|
// We can't detect drift if we cannot retrieve latest value from aws API for fields like secrets, passwords etc ...
|
|
|
|
r.Secret = nil
|
|
|
|
r.SesSmtpPasswordV4 = nil
|
|
|
|
return r, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *AwsIamAccessKey) NormalizeForProvider() (resource.Resource, error) {
|
|
|
|
return r, nil
|
|
|
|
}
|
2021-02-08 18:59:55 +00:00
|
|
|
|
|
|
|
func (r *AwsIamAccessKey) String() string {
|
|
|
|
if r.User == nil {
|
|
|
|
return r.TerraformId()
|
|
|
|
}
|
|
|
|
return fmt.Sprintf("%s (User: %s)", r.TerraformId(), *r.User)
|
|
|
|
}
|