Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
This change enables the built-in provider's terraform_data managed resource to work with the moved configuration block where the from address is a null_resource managed resource type from the official hashicorp/null provider. It produces no plan differences for typical configurations and specifically helps practitioners from re-running provisioners while moving resource types.
In addition to the unit testing, this was manually tested with the following configurations and outputs:
resource "terraform_data" "example" {
provisioner "local-exec" {
command = "echo 'Hello, World!'"
}
}
moved {
from = null_resource.example
to = terraform_data.example
}
Moved output (no triggers):
$ terraform apply
terraform_data.example: Refreshing state... [id=892002337455008838]
Terraform will perform the following actions:
# null_resource.example has moved to terraform_data.example
resource "terraform_data" "example" {
id = "892002337455008838"
}
Plan: 0 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
resource "terraform_data" "example" {
triggers_replace = {
examplekey = "examplevalue"
}
provisioner "local-exec" {
command = "echo 'Hello, World!'"
}
}
moved {
from = null_resource.example
to = terraform_data.example
}
Moved output (with triggers):
$ terraform apply
terraform_data.example: Refreshing state... [id=1651348367769440250]
Terraform will perform the following actions:
# null_resource.example has moved to terraform_data.example
resource "terraform_data" "example" {
id = "1651348367769440250"
# (1 unchanged attribute hidden)
}
Plan: 0 to add, 0 to change, 0 to destroy.
Do you want to perform these actions?
Terraform will perform the actions described above.
Only 'yes' will be accepted to approve.
Enter a value: yes
Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
Target Release
1.9.0
Draft CHANGELOG entry
ENHANCEMENTS
terraform_data: Enabled moved configuration refactoring from the hashicorp/null provider null_resource managed resource
This change enables the built-in provider's
terraform_data
managed resource to work with themoved
configuration block where thefrom
address is anull_resource
managed resource type from the officialhashicorp/null
provider. It produces no plan differences for typical configurations and specifically helps practitioners from re-running provisioners while moving resource types.In addition to the unit testing, this was manually tested with the following configurations and outputs:
Initial configuration (no
triggers
):Moved configuration (no
triggers
):Moved output (no
triggers
):Initial configuration (with
triggers
):Moved configuration (with
triggers
):Moved output (with
triggers
):Target Release
1.9.0
Draft CHANGELOG entry
ENHANCEMENTS
moved
configuration refactoring from thehashicorp/null
providernull_resource
managed resource