-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: bump tf requirement to 1.5; add checks (#21)
* feat: bump tf requirement to 1.5; add checks * misc: trigger a release job * misc: another noop to trigger release
- Loading branch information
Ao Zhang
authored
Mar 23, 2024
1 parent
4a7e739
commit 4c44fe8
Showing
4 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Provides some guardrails for common misconfiguration | ||
// Those are only available after Terraform v1.5. | ||
|
||
/* When we are doing a non-global/regional deployment, we expect some global resources | ||
to have been created. One way to check that is to ensure we can reference them via | ||
the global_module_reference attribute. | ||
*/ | ||
|
||
check "check_global_resource_condition" { | ||
assert { | ||
condition = var.global || ( | ||
length(var.global_module_reference.storage_account_id) > 0 && | ||
length(var.global_module_reference.scanning_subscription_role_definition_id) > 0 && | ||
length(var.global_module_reference.monitored_subscription_role_definition_id) > 0 && | ||
length(var.global_module_reference.blob_container_name) > 0 && | ||
length(var.global_module_reference.key_vault_id) > 0 && | ||
length(var.global_module_reference.sidekick_principal_id) > 0 && | ||
length(var.global_module_reference.sidekick_client_id) > 0 && | ||
length(var.global_module_reference.key_vault_secret_name) > 0 && | ||
length(var.global_module_reference.key_vault_uri) > 0 | ||
) | ||
error_message = "Some resources have not been referenced correctly during a non-global deployment" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters