Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_storage_account encryption now on by default #1380

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 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,6 +297,9 @@ 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),
},
Expand All @@ -304,12 +308,6 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
},
}

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