-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/azurerm: catch azurerm_template_deployment errors #7644
Conversation
The error was ignored causing Terraform to report that the deployments was successful rather than in a bad state. This commit cause the apply operation to report the error. Added a test which attempts to create a storage account with a name longer than the maximum permitted length to force a failure. ``` TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTemplateDeployment_ -timeout 120m === RUN TestAccAzureRMTemplateDeployment_basic --- PASS: TestAccAzureRMTemplateDeployment_basic (377.78s) === RUN TestAccAzureRMTemplateDeployment_withParams --- PASS: TestAccAzureRMTemplateDeployment_withParams (327.89s) === RUN TestAccAzureRMTemplateDeployment_withError --- PASS: TestAccAzureRMTemplateDeployment_withError (226.64s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 932.440s ```
I looked at the history of the file and couldn't find a reason for why the error wasn't being passed by up the chain. The error reported is now:
which isn't the best but at least indicates that the deployment failed. |
Thanks for the work here @pmcatominey You are opening them faster than I can close them :) will run the tests once I am finished running a set on VMs Paul |
The tests look good sir! Thanks so much - great catch :)
|
…#7644) The error was ignored causing Terraform to report that the deployments was successful rather than in a bad state. This commit cause the apply operation to report the error. Added a test which attempts to create a storage account with a name longer than the maximum permitted length to force a failure. ``` TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMTemplateDeployment_ -timeout 120m === RUN TestAccAzureRMTemplateDeployment_basic --- PASS: TestAccAzureRMTemplateDeployment_basic (377.78s) === RUN TestAccAzureRMTemplateDeployment_withParams --- PASS: TestAccAzureRMTemplateDeployment_withParams (327.89s) === RUN TestAccAzureRMTemplateDeployment_withError --- PASS: TestAccAzureRMTemplateDeployment_withError (226.64s) PASS ok github.com/hashicorp/terraform/builtin/providers/azurerm 932.440s ```
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The error was ignored causing Terraform to report that the deployments was
successful rather than in a bad state. This commit cause the apply operation
to report the error.
Added a test which attempts to create a storage account with a name longer
than the maximum permitted length to force a failure.