Fix false positive drift on aws_db_instance

main
Elie 2021-03-11 10:58:37 +01:00
parent 9fd09d9710
commit 64ee24ced8
No known key found for this signature in database
GPG Key ID: 399AF69092C727B6
2 changed files with 23 additions and 1 deletions

View File

@ -34,7 +34,7 @@ type AwsDbInstance struct {
InstanceClass *string `cty:"instance_class"`
Iops *int `cty:"iops"`
KmsKeyId *string `cty:"kms_key_id" computed:"true"`
LatestRestorableTime *string `cty:"latest_restorable_time" computed:"true"`
LatestRestorableTime *string `cty:"latest_restorable_time" computed:"true" diff:"-"`
LicenseModel *string `cty:"license_model" computed:"true"`
MaintenanceWindow *string `cty:"maintenance_window" computed:"true"`
MaxAllocatedStorage *int `cty:"max_allocated_storage"`

View File

@ -0,0 +1,22 @@
package aws
import (
"github.com/cloudskiff/driftctl/pkg/resource"
)
func (r *AwsDbInstance) NormalizeForState() (resource.Resource, error) {
if r.SnapshotIdentifier != nil && *r.SnapshotIdentifier == "" {
r.SnapshotIdentifier = nil
}
if r.AllowMajorVersionUpgrade != nil && !*r.AllowMajorVersionUpgrade {
r.AllowMajorVersionUpgrade = nil
}
if r.ApplyImmediately != nil && !*r.ApplyImmediately {
r.ApplyImmediately = nil
}
return r, nil
}
func (r *AwsDbInstance) NormalizeForProvider() (resource.Resource, error) {
return r, nil
}