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

Default for undefined booleans without default (azurerm_storage_account/enable_blob_encryption) #1028

Closed
anoff opened this issue Mar 26, 2018 · 7 comments · Fixed by #1380
Closed

Comments

@anoff
Copy link

anoff commented Mar 26, 2018

Terraform Version

Terraform v0.11.5

  • provider.azurerm v1.3.0

Affected Resource(s)

  • azurerm_storage_account

Terraform Configuration Files

resource "azurerm_storage_account" "backend" {
  name                     = "mybackend"
  resource_group_name      = "${azurerm_resource_group.backend.name}"
  location                 = "${azurerm_resource_group.backend.name.location}"
  account_tier             = "Standard"
  account_kind             = "StorageV2"
  account_replication_type = "GRS"
}

I was wondering how TF handles boolean values that are set to computed if there is no default present.
The one I am especially interested in is enable_blob_encryption option. I assume since the code does not specify a default: true it will go to 0 -> false.

However since Azure enforces encryption on all storage accounts per default I wonder how Terraform behaves in this scenario.

@achandmsft achandmsft added this to the Soon milestone Apr 20, 2018
@MMollyy
Copy link

MMollyy commented Jun 11, 2018

+1
I am noticing the behaviour where terraform defaults to False - while the azure platform defaults to true.
Multiple storage accounts.

@katbyte
Copy link
Collaborator

katbyte commented Jun 12, 2018

Hello @anoff,

While the code does not specify a default of true, it only passing a value of true or false to the API if the property is set that then defaults to true. However i understand the confusion so have opened #1380 to explicitly set the default to true.

@MarcoMol, could you provide some example terraform where the provider ends up defaulting to false? thank you

@katbyte katbyte modified the milestones: Soon, 1.7.0 Jun 12, 2018
@MMollyy
Copy link

MMollyy commented Jun 12, 2018

Hi @katbyte,

of course, here goes:

resource "azurerm_storage_account" "id" {
  account_tier             = "Standard"
  resource_group_name      = "${azurerm_resource_group.name.name}"
  name                     = "name"
  account_replication_type = "GRS"
  location                 = "westeurope"
  account_kind             = "StorageV2"
}

the other storage account is the same, but LRS.

@katbyte
Copy link
Collaborator

katbyte commented Jun 12, 2018

Hi @MarcoMol,

Thank you for providing the config, updated #1380 as a result and this should be fixed in 1.7.0.

@katbyte
Copy link
Collaborator

katbyte commented Jun 16, 2018

Hey @anoff @MarcoMol,

We just released 1.7 today that included the fix for this issue, hope it solves it for you two!

@anoff
Copy link
Author

anoff commented Jun 16, 2018

@katbyte thanks a lot for keeping us updated

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants