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

Expected auto_pause_delay_in_minutes in azurerm_mssql_database should support accurate values #27664

Open
1 task done
dc-g9 opened this issue Oct 16, 2024 · 0 comments
Open
1 task done

Comments

@dc-g9
Copy link

dc-g9 commented Oct 16, 2024

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 comments along the lines of "+1", "me too" or "any updates", 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.9.*

AzureRM Provider Version

3.111.0/4.*

Affected Resource(s)/Data Source(s)

azurerm_mssql_database

Terraform Configuration Files

Hello!

Here is example TF code to create serverless SQL database:

resource "azurerm_mssql_database" "sqldb" {
  name                        = var.resource
  server_id                   = var.server_id
  collation                   = var.collation
  create_mode                 = var.create_mode
  license_type                = var.license_type
  max_size_gb                 = var.max_size_gb
  sku_name                    = "GP_S_Gen5_1"
  auto_pause_delay_in_minutes = 15
  min_capacity                = var.min_capacity
}

Based on the Azure documentation, 15min is the minimum acceptable value for database auto pause: https://learn.microsoft.com/en-us/azure/azure-sql/database/serverless-tier-overview?view=azuresql&tabs=general-purpose#create-a-new-serverless-database

Auto-pause delay	Minimum: 15 minutes
Maximum: 10,080 minutes (seven days)
Increments: 1 minute
Disable auto-pause: -1

But resource azurerm_mssql_database accepts only range 60 - 10080 minutes.
Link to code that enforce value to be minimum 60 minutes: https://github.com/hashicorp/terraform-provider-azurerm/blob/main/internal/services/mssql/validate/database_auto_pause_delay.go#L14



### Debug Output/Panic Output

```shell
Error after running `terraform plan`:

│ Error: expected auto_pause_delay_in_minutes to be in the range (60 - 10080) and divisible by 10 or -1, got 15
│
│   with module.root_sqldb_archive["omgmt"].azurerm_mssql_database.sqldb,
│   on ../modules/sqldbsingle/main.tf line 10, in resource "azurerm_mssql_database" "sqldb":
│   10:   auto_pause_delay_in_minutes = var.deploy_sqldb_single == false ? null : var.auto_pause_delay_in_minutes


### Expected Behaviour

15 minutes should be acceptable value by this resource.

 auto_pause_delay_in_minutes in the range (15 - 10080) or -1

### Actual Behaviour

 auto_pause_delay_in_minutes needs to be in the range (60 - 10080) and divisible by 10 or -1

### Steps to Reproduce

terraform plan

### Important Factoids

_No response_

### References

_No response_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants