You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
After importing elasticstack_elasticsearch_index_lifecycle, the resource name in terraform state is null resulting in resource destroy & create upon next apply.
To Reproduce
Steps to reproduce the behavior:
Create a new index lifecycle policy independently of terraform
Create a matching terraform resource template
Initialize terraform state and import the index lifecycle policy
Run terraform plan. The expected result is no change.
Expected behavior
The imported resource is not destroyed or altered if there is no difference in configuration.
$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding latest version of hashicorp/elasticstack...
- Installing hashicorp/elasticstack v0.3.2...
- Installed hashicorp/elasticstack v0.3.2 (unauthenticated)
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init"in the future.
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
$ terraform import elasticstack_elasticsearch_index_lifecycle.import_test ${CLUSTER_UUID}/import_test
elasticstack_elasticsearch_index_lifecycle.import_test: Importing from ID "oG8TX0pmTwKyMCC2_sRMqw/import_test"...
elasticstack_elasticsearch_index_lifecycle.import_test: Import prepared!
Prepared elasticstack_elasticsearch_index_lifecycle for import
elasticstack_elasticsearch_index_lifecycle.import_test: Refreshing state... [id=oG8TX0pmTwKyMCC2_sRMqw/import_test]
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
$ terraform plan
elasticstack_elasticsearch_index_lifecycle.import_test: Refreshing state... [id=oG8TX0pmTwKyMCC2_sRMqw/import_test]
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# elasticstack_elasticsearch_index_lifecycle.import_test must be replaced
-/+ resource "elasticstack_elasticsearch_index_lifecycle""import_test" {
~ id = "oG8TX0pmTwKyMCC2_sRMqw/import_test" -> (known after apply)
~ modified_date = "2022-03-14T13:47:03.254Z" -> (known after apply)
+ name = "import_test"# forces replacement~ hot {
# (1 unchanged attribute hidden)~ rollover {
# (3 unchanged attributes hidden)
}
# (1 unchanged block hidden)
}
}
Plan: 1 to add, 0 to change, 1 to destroy.
Describe the bug
After importing
elasticstack_elasticsearch_index_lifecycle
, the resource name in terraform state isnull
resulting in resource destroy & create upon next apply.To Reproduce
Steps to reproduce the behavior:
terraform plan
. The expected result is no change.Expected behavior
The imported resource is not destroyed or altered if there is no difference in configuration.
Debug output
Create ILM Policy
Content of import_test.tf
Terraform import and plan output
Content of terraform.tfstate after import
Note
Adding the resource name
import_test
toterraform.tfstate
manually results in the expected behavior on next plan/apply.Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Windows AMD64
v1.1.5
v0.3.2
v7.16.3
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: