2021-11-22 16:55:11 +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 AzureLoadBalancerRuleResourceType = "azurerm_lb_rule"
|
2021-11-22 16:55:11 +00:00
|
|
|
|
2022-07-21 13:08:43 +00:00
|
|
|
func initAzureLoadBalancerRuleMetadata(resourceSchemaRepository dctlresource.SchemaRepositoryInterface) {
|
2022-07-21 08:37:03 +00:00
|
|
|
resourceSchemaRepository.SetNormalizeFunc(AzureLoadBalancerRuleResourceType, func(res *resource.Resource) {
|
2021-11-22 16:55:11 +00:00
|
|
|
res.Attributes().SafeDelete([]string{"timeouts"})
|
|
|
|
})
|
2022-07-21 08:37:03 +00:00
|
|
|
resourceSchemaRepository.SetHumanReadableAttributesFunc(AzureLoadBalancerRuleResourceType, func(res *resource.Resource) map[string]string {
|
|
|
|
attrs := make(map[string]string)
|
|
|
|
if name := res.Attributes().GetString("name"); name != nil && *name != "" {
|
|
|
|
attrs["Name"] = *name
|
|
|
|
}
|
|
|
|
return attrs
|
|
|
|
})
|
|
|
|
resourceSchemaRepository.SetFlags(AzureLoadBalancerRuleResourceType, resource.FlagDeepMode)
|
2021-11-22 16:55:11 +00:00
|
|
|
}
|