Skip to content

Commit

Permalink
Rename property, add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
favoretti committed Sep 5, 2023
1 parent 7a88113 commit fe3dc1d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
23 changes: 10 additions & 13 deletions internal/services/storage/storage_account_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,14 @@ func resourceStorageAccount() *pluginsdk.Resource {
Default: true,
},

"dns_endpoint_type_azure_enabled": {
Type: pluginsdk.TypeBool,
"dns_endpoint_type": {
Type: pluginsdk.TypeString,
Optional: true,
Default: false,
ValidateFunc: validation.StringInSlice([]string{
string(storage.DNSEndpointTypeStandard),
string(storage.DNSEndpointTypeAzureDNSZone),
}, false),
Default: string(storage.DNSEndpointTypeStandard),
ForceNew: true,
},

Expand Down Expand Up @@ -1026,11 +1030,6 @@ func resourceStorageAccount() *pluginsdk.Resource {
Sensitive: true,
},

"azure_dns_zone_name": {
Type: pluginsdk.TypeString,
Computed: true,
},

"tags": {
Type: pluginsdk.TypeMap,
Optional: true,
Expand Down Expand Up @@ -1123,10 +1122,7 @@ func resourceStorageAccountCreate(d *pluginsdk.ResourceData, meta interface{}) e
if d.Get("public_network_access_enabled").(bool) {
publicNetworkAccess = storage.PublicNetworkAccessEnabled
}
dnsEndpointType := storage.DNSEndpointTypeStandard
if d.Get("dns_endpoint_type_azure_enabled").(bool) {
dnsEndpointType = storage.DNSEndpointTypeAzureDNSZone
}
dnsEndpointType := d.Get("dns_endpoint_type").(string)

accountTier := d.Get("account_tier").(string)
replicationType := d.Get("account_replication_type").(string)
Expand All @@ -1151,7 +1147,7 @@ func resourceStorageAccountCreate(d *pluginsdk.ResourceData, meta interface{}) e
AllowCrossTenantReplication: &crossTenantReplication,
SasPolicy: expandStorageAccountSASPolicy(d.Get("sas_policy").([]interface{})),
IsSftpEnabled: &isSftpEnabled,
DNSEndpointType: dnsEndpointType,
DNSEndpointType: storage.DNSEndpointType(dnsEndpointType),
},
}

Expand Down Expand Up @@ -1987,6 +1983,7 @@ func resourceStorageAccountRead(d *pluginsdk.ResourceData, meta interface{}) err
publicNetworkAccessEnabled = false
}
d.Set("public_network_access_enabled", publicNetworkAccessEnabled)
d.Set("dns_endpoint_type", props.DNSEndpointType)

if crossTenantReplication := props.AllowCrossTenantReplication; crossTenantReplication != nil {
d.Set("cross_tenant_replication_enabled", crossTenantReplication)
Expand Down
2 changes: 1 addition & 1 deletion internal/services/storage/storage_account_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ resource "azurerm_storage_account" "test" {
account_tier = "Premium"
account_replication_type = "LRS"
dns_endpoint_type_azure_enabled = true
dns_endpoint_type = "AzureDnsZone"
allow_nested_items_to_be_public = false
tags = {
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/storage_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ The following arguments are supported:

* `sftp_enabled` - (Optional) Boolean, enable SFTP for the storage account

* `dns_endpoint_type` - (Optional) Which DNS endpoint type to use. Possible values are `Standard` and `AzureDnsZone`. Defailts to `Standard`. Changing this forces a new resource to be created.

-> **NOTE:** SFTP support requires `is_hns_enabled` set to `true`. [More information on SFTP support can be found here](https://learn.microsoft.com/azure/storage/blobs/secure-file-transfer-protocol-support). Defaults to `false`

* `tags` - (Optional) A mapping of tags to assign to the resource.
Expand Down

0 comments on commit fe3dc1d

Please sign in to comment.