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

try to retrieve apiVersion for all sub-resources #9364

Merged
merged 3 commits into from Nov 18, 2020

Conversation

evertonmc
Copy link
Contributor

Fixes #9003 by retrieving API Versions for ResourceProviders of sub-resources even if the resourceTypeName don't exactly match the template's resourceType by matching the prefix

@ghost ghost added the size/XS label Nov 17, 2020
@ghost ghost added size/M and removed size/XS labels Nov 18, 2020
@evertonmc
Copy link
Contributor Author

before fix:

TF_ACC=1 go test -v ./azurerm/internal/services/resource/tests/ -run=TestAccResourceGroupTemplateDeployment_childItems -timeout 60m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccResourceGroupTemplateDeployment_childItems
=== PAUSE TestAccResourceGroupTemplateDeployment_childItems
=== CONT  TestAccResourceGroupTemplateDeployment_childItems
    testing.go:745: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        
        Error: errors during apply: removing items provisioned by this Template Deployment: determining API Versions for Resource Providers: unable to determine API version for Resource Type "routeTables/routes" (Resource Provider "Microsoft.Network")

after fix:

TF_ACC=1 go test -v ./azurerm/internal/services/resource/tests/ -run=TestAccResourceGroupTemplateDeployment_childItems -timeout 60m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccResourceGroupTemplateDeployment_childItems
=== PAUSE TestAccResourceGroupTemplateDeployment_childItems
=== CONT  TestAccResourceGroupTemplateDeployment_childItems
--- PASS: TestAccResourceGroupTemplateDeployment_childItems (214.38s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/resource/tests      215.698s

@evertonmc evertonmc marked this pull request as ready for review November 18, 2020 13:09
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for this @evertonmc 👍

@tombuildsstuff tombuildsstuff added this to the v2.37.0 milestone Nov 18, 2020
@tombuildsstuff
Copy link
Member

Tests pass:

Screenshot 2020-11-18 at 14 53 19

@tombuildsstuff tombuildsstuff merged commit af613fe into hashicorp:master Nov 18, 2020
tombuildsstuff added a commit that referenced this pull request Nov 18, 2020
@ghost
Copy link

ghost commented Nov 20, 2020

This has been released in version 2.37.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.37.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Dec 18, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

terraform destroy for resource azurerm_resource_group_template_deployment fails
2 participants