-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not install VM extensions when
var.allow_extension_operations
is…
… `false` (#37) * Updated the for_each block to dynamically control extension creation. Signed-off-by: Melody Sofia Eroshevich <[email protected]> * Updated the for_each block to dynamically control extension creation Signed-off-by: Melody Sofia Eroshevich <[email protected]> * UUpdate variables.tf Signed-off-by: Melody Sofia Eroshevich <[email protected]> * Add tests for 'allow_extension_operations' Signed-off-by: philthoennissen <[email protected]> --------- Signed-off-by: Melody Sofia Eroshevich <[email protected]> Signed-off-by: philthoennissen <[email protected]> Co-authored-by: philthoennissen <[email protected]>
- Loading branch information
1 parent
cc38860
commit 5c2d0aa
Showing
4 changed files
with
36 additions
and
1 deletion.
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
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,31 @@ | ||
mock_provider "azapi" { source = "tests/local/mocks" } | ||
mock_provider "azurerm" { source = "tests/local/mocks" } | ||
mock_provider "random" { source = "tests/local/mocks" } | ||
mock_provider "tls" { source = "tests/local/mocks" } | ||
|
||
run "no_extension_should_be_created" { | ||
command = plan | ||
|
||
variables { | ||
allow_extension_operations = false | ||
extensions = [] | ||
} | ||
|
||
assert { | ||
condition = length(azurerm_virtual_machine_extension.this) == 0 | ||
error_message = "It is not possible to install extension with 'allow_extension_operations = false'. The azurerm_virtual_machine_extension.this length is ${length(azurerm_virtual_machine_extension.this)}." | ||
} | ||
} | ||
|
||
run "no_extension_should_be_created_2" { | ||
command = plan | ||
|
||
variables { | ||
allow_extension_operations = false | ||
} | ||
|
||
assert { | ||
condition = length(azurerm_virtual_machine_extension.this) == 0 | ||
error_message = "It is not possible to install extension with 'allow_extension_operations = false'. The azurerm_virtual_machine_extension.this length is ${length(azurerm_virtual_machine_extension.this)}." | ||
} | ||
} |
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