Merge pull request #329 from cloudskiff/fix_aws_db_instance

Fix false positive drift on aws_db_instance
main
Elie 2021-03-11 11:17:52 +01:00 committed by GitHub
commit 14cb69a9bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -34,7 +34,7 @@ type AwsDbInstance struct {
InstanceClass *string `cty:"instance_class"` InstanceClass *string `cty:"instance_class"`
Iops *int `cty:"iops"` Iops *int `cty:"iops"`
KmsKeyId *string `cty:"kms_key_id" computed:"true"` 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"` LicenseModel *string `cty:"license_model" computed:"true"`
MaintenanceWindow *string `cty:"maintenance_window" computed:"true"` MaintenanceWindow *string `cty:"maintenance_window" computed:"true"`
MaxAllocatedStorage *int `cty:"max_allocated_storage"` 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
}