driftctl/pkg/resource/aws/aws_route53_zone.go

23 lines
710 B
Go
Raw Normal View History

package aws
2021-05-17 15:03:10 +00:00
import (
"github.com/cloudskiff/driftctl/pkg/resource"
)
2021-03-25 11:13:52 +00:00
const AwsRoute53ZoneResourceType = "aws_route53_zone"
2021-05-17 15:03:10 +00:00
func initAwsRoute53ZoneMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
resourceSchemaRepository.SetNormalizeFunc(AwsRoute53ZoneResourceType, func(res *resource.AbstractResource) {
val := res.Attrs
2021-05-17 15:03:10 +00:00
val.SafeDelete([]string{"force_destroy"})
})
2021-05-21 14:09:45 +00:00
resourceSchemaRepository.SetHumanReadableAttributesFunc(AwsRoute53ZoneResourceType, func(res *resource.AbstractResource) map[string]string {
val := res.Attrs
attrs := make(map[string]string)
if name := val.GetString("name"); name != nil && *name != "" {
attrs["Name"] = *name
}
return attrs
})
2021-05-17 15:03:10 +00:00
}