mirror of https://github.com/hashicorp/terraform
stacks: pre-destroy refresh should use a normal plan (#36696)
* stacks: pre-destroy refresh should use a normal plan * formatpull/36710/head
parent
c16d466773
commit
9bbe34daa4
@ -0,0 +1,23 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
testing = {
|
||||
source = "hashicorp/testing"
|
||||
version = "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "id" {
|
||||
type = string
|
||||
default = null
|
||||
nullable = true # We'll generate an ID if none provided.
|
||||
}
|
||||
|
||||
variable "input" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "testing_resource" "data" {
|
||||
id = var.id
|
||||
value = var.input
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
testing = {
|
||||
source = "hashicorp/testing"
|
||||
version = "0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
variable "create" {
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "id" {
|
||||
type = string
|
||||
default = null
|
||||
nullable = true # We'll generate an ID if none provided.
|
||||
}
|
||||
|
||||
variable "input" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "testing_resource" "resource" {
|
||||
count = var.create ? 1 : 0
|
||||
}
|
||||
|
||||
|
||||
module "module" {
|
||||
source = "./module"
|
||||
|
||||
providers = {
|
||||
testing = testing
|
||||
}
|
||||
|
||||
id = testing_resource.resource[0].id
|
||||
input = var.input
|
||||
}
|
||||
|
||||
resource "testing_resource" "outside" {
|
||||
id = var.id
|
||||
value = var.input
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
required_providers {
|
||||
testing = {
|
||||
source = "hashicorp/testing"
|
||||
version = "0.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
provider "testing" "default" {}
|
||||
|
||||
variable "input" {
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "id" {
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
component "self" {
|
||||
source = "./"
|
||||
|
||||
providers = {
|
||||
testing = provider.testing.default
|
||||
}
|
||||
|
||||
inputs = {
|
||||
id = var.id
|
||||
input = var.input
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue