Skip to content

Commit

Permalink
Terraform v4 upgrade (#222)
Browse files Browse the repository at this point in the history
* Update Task Version to V4

* update providers.tf version numbers

* Add resource provider registrations = none

* Health check eviction time default value

* storage name character limit

* remove $ from sql server password generation
  • Loading branch information
paintedrust authored Nov 21, 2024
1 parent 12436da commit a7b17ef
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resource "random_password" "sql_server_password" {
min_numeric = 1
min_upper = 1
min_special = 1
override_special = "!#$%*-_+?@.[]()"
override_special = "!#%*-_+?@.[]()"

lifecycle {
ignore_changes = [
Expand Down
5 changes: 3 additions & 2 deletions devops/Terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.116.0"
version = "4.10.0"
}
azuread = {
source = "hashicorp/azuread"
version = "2.53.1"
version = "3.0.2"
}
mssql = {
source = "betr-io/mssql"
Expand All @@ -22,6 +22,7 @@ terraform {

provider "azurerm" {
subscription_id = "5c41ba40-6ca2-4e8a-9646-d3585df38b5a"
resource_provider_registrations = "none"

features {
resource_group {
Expand Down
2 changes: 1 addition & 1 deletion devops/Terraform/storage.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resource "azurerm_storage_account" "stage" {
name = "${replace(local.resource_prefix, "-", "")}storage"
name = "${replace(replace(local.resource_prefix, "-", ""), "backend", "be")}storage" # must be between 3 & 24 chars
resource_group_name = azurerm_resource_group.stage.name
location = azurerm_resource_group.stage.location
account_tier = "Standard"
Expand Down
1 change: 1 addition & 0 deletions devops/Terraform/web-api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ resource "azurerm_linux_web_app" "web_api" {
use_32_bit_worker = false
websockets_enabled = true
health_check_path = "/health/ready"
health_check_eviction_time_in_min = 10
application_stack {
dotnet_version = "8.0"
}
Expand Down
4 changes: 2 additions & 2 deletions devops/infra-build-tfp-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ steps:
inputs:
terraformVersion: latest

- task: TerraformTaskV3@3
- task: TerraformTaskV4@4
displayName: 'Initialize TF'
inputs:
workingDirectory: '${{parameters.tfWorkingDirectory}}'
Expand All @@ -44,7 +44,7 @@ steps:
displayName: 'Select TF Workspace'
workingDirectory: '${{parameters.tfWorkingDirectory}}'
- task: TerraformTaskV3@3
- task: TerraformTaskV4@4
name: Terraform_Plan
displayName: 'Build TF Plan'
inputs:
Expand Down
2 changes: 1 addition & 1 deletion devops/rollout-deploy-stage-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
inputs:
terraformVersion: latest

- task: TerraformTaskV3@3
- task: TerraformTaskV4@4
displayName: "Apply TF Plan"
inputs:
workingDirectory: "$(tf.workingDirectory)"
Expand Down

0 comments on commit a7b17ef

Please sign in to comment.