Skip to content

Commit

Permalink
Merge pull request #16245 from CDCgov/ms/devsecops/tf-timeouts
Browse files Browse the repository at this point in the history
add tf storage timeouts
  • Loading branch information
devopsmatt authored Oct 16, 2024
2 parents 204ddee + 19457a5 commit fa29642
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/deploy_terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
pre_job:
name: Set Build Environment
concurrency:
concurrency:
group: ${{ github.workflow }}-${{ needs.pre_job.outputs.env_name }}
cancel-in-progress: true
runs-on: ubuntu-latest
Expand All @@ -28,7 +28,7 @@ jobs:
confirm_changes:
name: Check Terraform Stats - ${{ needs.pre_job.outputs.env_name }}
if: ${{ needs.pre_job.outputs.tf_change == 'true' }}
concurrency:
concurrency:
group: ${{ github.workflow }}-${{ needs.pre_job.outputs.env_name }}
cancel-in-progress: true
needs:
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

approve_deploy:
name: Approve Deploy - ${{ needs.pre_job.outputs.env_name }}
concurrency:
concurrency:
group: ${{ github.workflow }}-${{ needs.pre_job.outputs.env_name }}
cancel-in-progress: true
needs:
Expand All @@ -75,7 +75,7 @@ jobs:

run_deploy:
name: Run Deploy - ${{ needs.pre_job.outputs.env_name }}
concurrency:
concurrency:
group: ${{ github.workflow }}-${{ needs.pre_job.outputs.env_name }}
cancel-in-progress: true
needs:
Expand Down Expand Up @@ -108,4 +108,7 @@ jobs:
- name: Run Terraform
run: |
terraform init -input=false
terraform apply -input=false -no-color -lock-timeout=600s -auto-approve
terraform validate
terraform fmt -recursive
terraform plan -out ${{ needs.pre_job.outputs.env_name }}-tf.plan
# terraform apply -input=false -no-color -lock-timeout=600s -auto-approve ${{ needs.pre_job.outputs.env_name }}-tf.plan
7 changes: 7 additions & 0 deletions operations/app/terraform/modules/storage/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ resource "azurerm_storage_account" "storage_account" {
tags = {
environment = var.environment
}

timeouts {
create = var.timeout_create
read = var.timeout_read
delete = var.timeout_delete
update = var.timeout_update
}
}

resource "azurerm_storage_queue" "storage_queue" {
Expand Down
25 changes: 25 additions & 0 deletions operations/app/terraform/modules/storage/~inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,29 @@ variable "storage_queue_name" {
description = "Default storage queue names that will be created in the storage account."
type = list(string)
default = ["proces"]
}

# TF timeouts for storage operations
variable "timeout_create" {
description = "Timeout for create operations"
type = string
default = "60m" # module default 60m
}

variable "timeout_read" {
description = "Timeout for read operations"
type = string
default = "615m" # module default 5m
}

variable "timeout_update" {
description = "Timeout for update operations"
type = string
default = "60m" # module default 60m
}

variable "timeout_delete" {
description = "Timeout for delete operations"
type = string
default = "60m" # module default 60m
}

0 comments on commit fa29642

Please sign in to comment.