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

Empty 'administrator_login_password' in azurerm_mariadb_server data source #6521

Closed
rmaziarka opened this issue Apr 17, 2020 · 8 comments
Closed

Comments

@rmaziarka
Copy link

rmaziarka commented Apr 17, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

  • Terraform: v0.12.24
  • AzureRM: v2.6.0

Affected Resource(s)

  • data source azurerm_mariadb_server

Terraform Configuration Files

resource "azurerm_mariadb_server" "server" {
  name                = "servername"
  location            = "WestEurope"
  resource_group_name = "resourcegroupname"
  sku_name            = "B_Gen5_1"

  storage_profile {
    storage_mb            = 51200
    backup_retention_days = 7
    geo_redundant_backup  = "Disabled"
  }

  administrator_login          = "admin"
  administrator_login_password = "password"
  version                      = "10.2"
  ssl_enforcement              = "Enabled"
}

data "azurerm_mariadb_server" "datasource" {
  name                = "servername"
  resource_group_name = "resourcegroupname"
}

output "mariadb_server_password" {
  value = data.azurerm_mariadb_server.datasource.administrator_login_password
}

Expected Behavior

In output I should get:
`mariadb_server_password = "password"

Actual Behavior

I get no information in output.

Steps to Reproduce

  • terraform apply -auto-approve

Additional information

In terraform state file I have null value for password:

{
    "schema_version": 0,
    "attributes": {
        "administrator_login": "admin",
        "administrator_login_password": null        
        ..
    }
}
@rmaziarka
Copy link
Author

rmaziarka commented Apr 17, 2020

Azure MariaDB data source was fixed in the last release (https://github.com/terraform-providers/terraform-provider-azurerm/issues/6483) but maybe this password was missed.

@tombuildsstuff
Copy link
Member

tombuildsstuff commented Apr 20, 2020

hey @rmaziarka

Thanks for opening this issue.

Taking a look through here the password won't be returned from the Azure API here for security reasons - as such this field probably shouldn't have been added to this data source. As such we should instead look to remove this field from this resource (and double-check the other SQL/MySql/Postgres server data sources to remove this if present looks like it's only MariaDB), since this field isn't returned from the API and thus'll always be null here.

Thanks!

@rmaziarka
Copy link
Author

rmaziarka commented Apr 20, 2020

Hey @tombuildsstuff,

Let me disagree with you. For example with data sources:

Therefore you provide this information for other services as well. Moreover removing this from the data source would force me to pass the password to the output (I am using a connection to MariaDB cluster from a different state). And it doesn't sound much secure than having it in the data source.

@tombuildsstuff
Copy link
Member

@rmaziarka different API's behave in different ways - for AKS and CosmosDB (and Storage Accounts etc) they provide a means of obtaining these tokens - unfortunately the Database API's (e.g. MariaDB/MySql/Postgres/SQL Server) don't return this field, so there's nothing for us to output from the API here - which is why this field wants removing

Hope that helps clarify that :)

@rmaziarka
Copy link
Author

rmaziarka commented Apr 20, 2020

OK, now it is clear :)

manicminer added a commit that referenced this issue May 11, 2020
- `create_mode`, `creation_source_server_id`

- Support replicas and point-in-time restores

- Use booleans for toggle properties, renaming
  * `auto_grow` -> `auto_grow_enabled`
  * `geo_redundant_backup` -> `geo_redundant_backup_enabled`
  * `ssl_enforcement` -> `ssl_enforcement_enabled`

- Remove redundant `storage_profile` block and move all properties
  within to top level

- Remove unpopulated attribute `administrator_login_password` from
  `mariadb_server` data source

Fixes: #4296, #6521
Related: #6459
manicminer added a commit that referenced this issue May 12, 2020
- `create_mode`, `creation_source_server_id`

- Support replicas and point-in-time restores

- Use booleans for toggle properties, renaming
  * `auto_grow` -> `auto_grow_enabled`
  * `geo_redundant_backup` -> `geo_redundant_backup_enabled`
  * `ssl_enforcement` -> `ssl_enforcement_enabled`

- Remove redundant `storage_profile` block and move all properties
  within to top level

- Remove unpopulated attribute `administrator_login_password` from
  `mariadb_server` data source

Fixes: #4296, #6521
Related: #6459
manicminer added a commit that referenced this issue May 12, 2020
- `create_mode`, `creation_source_server_id`,
  `public_network_access_enabled`

- Support replicas and point-in-time restores

- Use booleans for toggle properties, renaming
  * `auto_grow` -> `auto_grow_enabled`
  * `geo_redundant_backup` -> `geo_redundant_backup_enabled`
  * `ssl_enforcement` -> `ssl_enforcement_enabled`

- Remove redundant `storage_profile` block and move all properties
  within to top level

- Remove unpopulated attribute `administrator_login_password` from
  `mariadb_server` data source

Fixes: #4296, #6521
Related: #6459
@katbyte katbyte added this to the v2.10.0 milestone May 14, 2020
@katbyte
Copy link
Collaborator

katbyte commented May 14, 2020

closed by #6865

@katbyte katbyte closed this as completed May 14, 2020
@ghost
Copy link

ghost commented May 15, 2020

This has been released in version 2.10.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.10.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Jun 14, 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!

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

No branches or pull requests

3 participants