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_mssql_database - support for the restore_long_term_retention_backup_id property is not working #25163

Closed
1 task done
mglarauzo opened this issue Mar 6, 2024 · 4 comments
Labels

Comments

@mglarauzo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

Terraform Version

1.6.6

AzureRM Provider Version

3.94.0

Affected Resource(s)/Data Source(s)

azurerm_mssql_database

Terraform Configuration Files

resource "azurerm_mssql_database" "example_ltr" {
  name           = "testpitrdb"
  server_id      = "/subscriptions/000000000-0000-0000-0000-000000000000/resourceGroups/resgroup1/providers/Microsoft.Sql/servers/testsqlsrv"
  collation      = "SQL_Latin1_General_CP1_CI_AS"
  max_size_gb    = 2
  sku_name       = "S0"
  create_mode    = "RestoreLongTermRetentionBackup"
  restore_long_term_retention_backup_id = "anystring"
}

Debug Output/Panic Output

Error: 'long_term_retention_backup_id' is required for create_mode RestoreLongTermRetentionBackup
│
│   with azurerm_mssql_database.example_ltr,
│   on sqldb_restore.tf line 22, in resource "azurerm_mssql_database" "example_ltr":
│   22: resource "azurerm_mssql_database" "example_ltr" {

Expected Behaviour

A new database should be created with data restored from the specified LTR backup.

Actual Behaviour

Error output asking for an attribute named 'long_term_retention_backup_id'.

Resource docs and schema contain a new attribute named 'restore_long_term_retention_backup_id', but it seems that resource implementation at "internal/services/mssql/mssql_database_resource.go" looks for a different name during validations:

case databases.CreateModeRestoreLongTermRetentionBackup:
	if _, dbok := d.GetOk("long_term_retention_backup_id"); !dbok {
		return fmt.Errorf("'long_term_retention_backup_id' is required for create_mode %s", createMode)
	}

Steps to Reproduce

terraform apply

Important Factoids

No response

References

#24904

@sinbai
Copy link
Contributor

sinbai commented Mar 8, 2024

Hi @mglarauzo thanks for opening this issue. PR has been submitted to fix this issue. Could you please track it for more updates?

@mglarauzo
Copy link
Author

Thanks, @sinbai. Already subscribed to the PR!

@rcskosir
Copy link
Contributor

Thanks for taking the time to submit this issue. It looks like this has been resolved as of #25180. As such, I am going to mark this issue as closed. If that is not the case, please provide additional information including the version in which you are still experiencing this issue, thanks!

Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants