Skip to content

Commit

Permalink
azurerm_storage_account encryption now on by defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Jun 12, 2018
1 parent 438ea1e commit 0667879
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
16 changes: 7 additions & 9 deletions azurerm/resource_arm_storage_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ func resourceArmStorageAccount() *schema.Resource {
"enable_blob_encryption": {
Type: schema.TypeBool,
Optional: true,
Computed: true,
Default: true,
},

"enable_file_encryption": {
Type: schema.TypeBool,
Optional: true,
Computed: true,
Default: true,
},

"enable_https_traffic_only": {
Expand Down Expand Up @@ -275,6 +275,7 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
location := azureRMNormalizeLocation(d.Get("location").(string))
tags := d.Get("tags").(map[string]interface{})
enableBlobEncryption := d.Get("enable_blob_encryption").(bool)
enableFileEncryption := d.Get("enable_file_encryption").(bool)
enableHTTPSTrafficOnly := d.Get("enable_https_traffic_only").(bool)

accountTier := d.Get("account_tier").(string)
Expand All @@ -296,20 +297,17 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
Services: &storage.EncryptionServices{
Blob: &storage.EncryptionService{
Enabled: utils.Bool(enableBlobEncryption),
}},
},
File: &storage.EncryptionService{
Enabled: utils.Bool(enableFileEncryption),
}},
KeySource: storage.KeySource(storageAccountEncryptionSource),
},
EnableHTTPSTrafficOnly: &enableHTTPSTrafficOnly,
NetworkRuleSet: networkRules,
},
}

if v, ok := d.GetOk("enable_file_encryption"); ok {
parameters.Encryption.Services.File = &storage.EncryptionService{
Enabled: utils.Bool(v.(bool)),
}
}

if _, ok := d.GetOk("custom_domain"); ok {
parameters.CustomDomain = expandStorageAccountCustomDomain(d)
}
Expand Down
8 changes: 2 additions & 6 deletions website/docs/r/storage_account.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,9 @@ The following arguments are supported:

* `access_tier` - (Optional) Defines the access tier for `BlobStorage` and `StorageV2` accounts. Valid options are `Hot` and `Cold`, defaults to `Hot`.

* `enable_blob_encryption` - (Optional) Boolean flag which controls if Encryption
Services are enabled for Blob storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/)
for more information.
* `enable_blob_encryption` - (Optional) Boolean flag which controls if Encryption Services are enabled for Blob storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.

* `enable_file_encryption` - (Optional) Boolean flag which controls if Encryption
Services are enabled for File storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/)
for more information.
* `enable_file_encryption` - (Optional) Boolean flag which controls if Encryption Services are enabled for File storage, see [here](https://azure.microsoft.com/en-us/documentation/articles/storage-service-encryption/) for more information. Defaults to `true`.

* `enable_https_traffic_only` - (Optional) Boolean flag which forces HTTPS if enabled, see [here](https://docs.microsoft.com/en-us/azure/storage/storage-require-secure-transfer/)
for more information.
Expand Down

0 comments on commit 0667879

Please sign in to comment.