2022-07-21 08:37:03 +00:00
|
|
|
package azurerm
|
|
|
|
|
2022-07-21 13:08:43 +00:00
|
|
|
import (
|
|
|
|
"github.com/snyk/driftctl/enumeration/resource"
|
|
|
|
dctlresource "github.com/snyk/driftctl/pkg/resource"
|
|
|
|
)
|
2022-07-21 08:37:03 +00:00
|
|
|
|
|
|
|
const AzurePostgresqlServerResourceType = "azurerm_postgresql_server"
|
|
|
|
|
2022-07-21 13:08:43 +00:00
|
|
|
func initAzurePostgresqlServerMetadata(resourceSchemaRepository dctlresource.SchemaRepositoryInterface) {
|
2022-07-21 08:37:03 +00:00
|
|
|
resourceSchemaRepository.SetHumanReadableAttributesFunc(AzurePostgresqlServerResourceType, func(res *resource.Resource) map[string]string {
|
|
|
|
val := res.Attrs
|
|
|
|
attrs := make(map[string]string)
|
|
|
|
if name := val.GetString("name"); name != nil && *name != "" {
|
|
|
|
attrs["Name"] = *name
|
|
|
|
}
|
|
|
|
return attrs
|
|
|
|
})
|
|
|
|
}
|