Skip to content

Commit

Permalink
r/storage_account: defaulting the value for dns_endpoint_type
Browse files Browse the repository at this point in the history
This field defaults to `null` if unset in the API response, therefore needs to be explicitly defaulted on our side
  • Loading branch information
tombuildsstuff committed Mar 22, 2024
1 parent f93702e commit 5738f92
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/services/storage/storage_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -2116,7 +2116,14 @@ func resourceStorageAccountRead(d *pluginsdk.ResourceData, meta interface{}) err
publicNetworkAccessEnabled = false
}
d.Set("public_network_access_enabled", publicNetworkAccessEnabled)
d.Set("dns_endpoint_type", props.DNSEndpointType)

// DNSEndpointType is null when unconfigured - therefore default this to Standard
dnsEndpointType := storage.DNSEndpointTypeStandard
if props.DNSEndpointType != "" {
// TODO: when this is ported over to `hashicorp/go-azure-sdk` this should be able to become != nil
dnsEndpointType = props.DNSEndpointType
}
d.Set("dns_endpoint_type", dnsEndpointType)

if crossTenantReplication := props.AllowCrossTenantReplication; crossTenantReplication != nil {
d.Set("cross_tenant_replication_enabled", crossTenantReplication)
Expand Down

0 comments on commit 5738f92

Please sign in to comment.