Skip to content

Commit 14cb69a

Browse files
authored
Merge pull request #329 from cloudskiff/fix_aws_db_instance
Fix false positive drift on aws_db_instance
2 parents de0dac7 + 16a3c44 commit 14cb69a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

pkg/resource/aws/aws_db_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ type AwsDbInstance struct {
3434
InstanceClass *string `cty:"instance_class"`
3535
Iops *int `cty:"iops"`
3636
KmsKeyId *string `cty:"kms_key_id" computed:"true"`
37-
LatestRestorableTime *string `cty:"latest_restorable_time" computed:"true"`
37+
LatestRestorableTime *string `cty:"latest_restorable_time" computed:"true" diff:"-"`
3838
LicenseModel *string `cty:"license_model" computed:"true"`
3939
MaintenanceWindow *string `cty:"maintenance_window" computed:"true"`
4040
MaxAllocatedStorage *int `cty:"max_allocated_storage"`
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package aws
2+
3+
import (
4+
"github.com/cloudskiff/driftctl/pkg/resource"
5+
)
6+
7+
func (r *AwsDbInstance) NormalizeForState() (resource.Resource, error) {
8+
if r.SnapshotIdentifier != nil && *r.SnapshotIdentifier == "" {
9+
r.SnapshotIdentifier = nil
10+
}
11+
if r.AllowMajorVersionUpgrade != nil && !*r.AllowMajorVersionUpgrade {
12+
r.AllowMajorVersionUpgrade = nil
13+
}
14+
if r.ApplyImmediately != nil && !*r.ApplyImmediately {
15+
r.ApplyImmediately = nil
16+
}
17+
return r, nil
18+
}
19+
20+
func (r *AwsDbInstance) NormalizeForProvider() (resource.Resource, error) {
21+
return r, nil
22+
}

0 commit comments

Comments
 (0)