2020-12-09 15:31:34 +00:00
|
|
|
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
|
|
|
|
2020-12-09 15:31:34 +00:00
|
|
|
const AwsRoute53ZoneResourceType = "aws_route53_zone"
|
|
|
|
|
2021-05-17 15:03:10 +00:00
|
|
|
func initAwsRoute53ZoneMetaData(resourceSchemaRepository resource.SchemaRepositoryInterface) {
|
2021-05-24 15:19:06 +00:00
|
|
|
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
|
|
|
}
|