Skip to content

Commit

Permalink
Fix deleting a naming instance causes "Provider configuration not pre…
Browse files Browse the repository at this point in the history
…sent" errors (Azure#30)

* Fix bug where deleting a naming module instance causes "Provider configuration not present" errors.

The code as it stood breaks parent modules when they remove references to a naming module instance and violates the Hashicorp guidlines of "Do not explicitly declare providers in modules that are intended to be used by other modules". References:

https://www.terraform.io/docs/configuration/modules.html#providers-within-modules 
hashicorp/terraform#22907 (comment)

* Surround with terraform block
  • Loading branch information
EklipZgit authored Sep 14, 2020
1 parent 21ab565 commit fba0aaa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
provider "random" {
version = "~> 2.2"
terraform {
required_providers {
random = {
source = "hashicorp/random"
version = "~> 2.2"
}
}
}

resource "random_string" "main" {
Expand Down

0 comments on commit fba0aaa

Please sign in to comment.