Skip to content
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

r/template_deployment: fixing support for nested template deployments #2514

Merged
merged 2 commits into from
Dec 17, 2018

Conversation

tombuildsstuff
Copy link
Contributor

As a part of switching over to the new Authentication library, we switched to using the Profile for resources. In retrospect it appears this broke support for Nested Template Deployments, which require an API version of 2017-05-10 or later, but the profile being used uses the API version 2016-02-01.

As such this PR vendors version 2018-05-01 of the Resources SDK such that this is now fixed. We were missing a test for Nested Template Deployments - but I've added one which confirms the bug & fix:

This new test currently fails on master:

$ acctests azurerm TestAccAzureRMTemplateDeployment_nestedTemplate
=== RUN   TestAccAzureRMTemplateDeployment_nestedTemplate
=== PAUSE TestAccAzureRMTemplateDeployment_nestedTemplate
=== CONT  TestAccAzureRMTemplateDeployment_nestedTemplate
--- FAIL: TestAccAzureRMTemplateDeployment_nestedTemplate (71.60s)
    testing.go:538: Step 0 error: Error applying: 1 error(s) occurred:

        * azurerm_template_deployment.test: 1 error(s) occurred:

        * azurerm_template_deployment.test: Error creating deployment: resources.DeploymentsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidTemplate" Message="Deployment template validation failed: 'The template resource 'nested-template-deployment' at line '1' and column '176' is invalid. The api-version '2016-02-01' used to deploy the template does not support 'ResourceGroup' property. Please use api-version '2017-05-10' or later to deploy the template. Please see https://aka.ms/arm-template/#resources for usage details.'."
FAIL
FAIL	github.com/terraform-providers/terraform-provider-azurerm/azurerm	72.635s

But passes in this branch, containing the SDK upgrade:

$ acctests azurerm TestAccAzureRMTemplateDeployment_nestedTemplate

=== RUN   TestAccAzureRMTemplateDeployment_nestedTemplate
=== PAUSE TestAccAzureRMTemplateDeployment_nestedTemplate
=== CONT  TestAccAzureRMTemplateDeployment_nestedTemplate


--- PASS: TestAccAzureRMTemplateDeployment_nestedTemplate (978.70s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	979.175s

Fixes #2507

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ghost
Copy link

ghost commented Mar 5, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The nested deployment has api-version '2017-05-10', which is not supported in api-version '2016-02-01'
2 participants