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

azurerm_template_deployment doesn't support import #7268

Closed
shawnferry opened this issue Jun 9, 2020 · 5 comments
Closed

azurerm_template_deployment doesn't support import #7268

shawnferry opened this issue Jun 9, 2020 · 5 comments

Comments

@shawnferry
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.26

  • provider.azuread v0.10.0
  • provider.azurerm v2.13.0
  • provider.external v1.2.0
  • provider.null v2.1.2
  • provider.random v2.2.1
  • provider.tls v2.1.1

Affected Resource(s)

  • azurerm_template_deployment

Terraform Configuration Files

https://www.terraform.io/docs/providers/azurerm/r/template_deployment.html

Debug Output

Panic Output

Expected Behavior

Pre-existing template deployments should be importable to allow plans with resources dependent on their creation to be applied.

Actual Behavior

  1. A long running (3+h) template runs and sometimes fails in terraform apply while eventually succeeding in Azure.
  2. Subsequent applys fail due to dependencies on the existing resource.

Error: resource azurerm_template_deployment doesn't support import

Steps to Reproduce

  1. Manually create a deployment in an azure resource group called acctesttemplate-01
  2. Terraform apply provider example resource
    1. Resource exists and must be imported
    2. Cannot import this type of resource

Important Factoids

I've worked around this by making deployment names unique and allowing for a toggle and dependencies but I still believe it should be possible to import the template resources.

References

#6045

@ArcturusZhang

This comment has been minimized.

@ArcturusZhang
Copy link
Contributor

ArcturusZhang commented Oct 9, 2020

Hi @shawnferry we have introduced two new resources azurerm_(resource_group|subscription)_template_deployment to supersede the old azurerm_template_deployment resource to provide more detailed control of the ARM templates, and the old azurerm_template_deployment resource will be deprecated in v3.0 of the provider. Therefore could you please try our new resource azurerm_resource_group_template_deployment as a workaround?

@jishnu-codes
Copy link

The new resource mentioned is not detecting the deployment and throws the below error:
Error: Cannot import non-existent remote object

@tombuildsstuff
Copy link
Contributor

Closing this out since the new resources support importing

@github-actions
Copy link

github-actions bot commented Sep 4, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants