fix: disable instance_initiated_shutdown_behavior field

main
sundowndev 2021-06-14 11:26:47 +02:00
parent d4b4ed9365
commit dd3c3107f4
1 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package aws
import (
"github.com/cloudskiff/driftctl/pkg/resource"
"github.com/hashicorp/go-version"
)
const AwsInstanceResourceType = "aws_instance"
@ -10,7 +11,10 @@ func initAwsInstanceMetaData(resourceSchemaRepository resource.SchemaRepositoryI
resourceSchemaRepository.SetNormalizeFunc(AwsInstanceResourceType, func(res *resource.AbstractResource) {
val := res.Attrs
val.SafeDelete([]string{"timeouts"})
val.SafeDelete([]string{"instance_initiated_shutdown_behavior"})
if v, _ := version.NewVersion("3.38.0"); res.Schema().ProviderVersion.LessThan(v) {
val.SafeDelete([]string{"instance_initiated_shutdown_behavior"})
}
})
resourceSchemaRepository.SetHumanReadableAttributesFunc(AwsInstanceResourceType, func(res *resource.AbstractResource) map[string]string {
val := res.Attrs