mirror of https://github.com/hashicorp/terraform
stacks: ensure consistent sources between removed blocks (#36915)
parent
dcff9e4d2c
commit
96e50f680f
@ -0,0 +1,17 @@
|
||||
variable "name" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "null_resource" "example" {
|
||||
triggers = {
|
||||
name = var.name
|
||||
}
|
||||
}
|
||||
|
||||
output "greeting" {
|
||||
value = "Hello, ${var.name}!"
|
||||
}
|
||||
|
||||
output "resource_id" {
|
||||
value = null_resource.example.id
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
required_providers {
|
||||
null = {
|
||||
source = "hashicorp/null"
|
||||
version = "3.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
provider "null" "a" {}
|
||||
|
||||
removed {
|
||||
from = stack.a.component.a // bad, stack.a is undefined so this is orphaned
|
||||
|
||||
source = "./"
|
||||
|
||||
providers = {
|
||||
null = provider.null.a
|
||||
}
|
||||
}
|
||||
|
||||
removed {
|
||||
from = stack.a.stack.b // bad, stack.a is undefined so this is orphaned
|
||||
source = "./subdir"
|
||||
}
|
||||
|
||||
removed {
|
||||
from = stack.b["a"]
|
||||
source = "./subdir"
|
||||
}
|
||||
|
||||
removed {
|
||||
from = stack.b["b"]
|
||||
source = "./" // bad, the sources should be the same for stack.b
|
||||
}
|
||||
|
||||
removed {
|
||||
from = stack.a.component.b["a"]
|
||||
|
||||
source = "./"
|
||||
|
||||
providers = {
|
||||
null = provider.null.a
|
||||
}
|
||||
}
|
||||
|
||||
removed {
|
||||
from = stack.a.component.b["b"] // bad, the sources should be the same for component.b
|
||||
|
||||
source = "./subdir"
|
||||
|
||||
providers = {
|
||||
null = provider.null.a
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
required_providers {
|
||||
null = {
|
||||
source = "hashicorp/null"
|
||||
version = "3.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
provider "null" "a" {}
|
||||
|
||||
component "a" {
|
||||
source = "../"
|
||||
|
||||
inputs = {
|
||||
name = var.name
|
||||
}
|
||||
|
||||
providers = {
|
||||
null = provider.null.a
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue