terraform-provider-random
terraform-provider-random copied to clipboard
Terraform apply crashed
Hi there,
Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.
Terraform version
Terraform v0.13.2
issue with below module
module.cluster.module.eks.random_pet.workers_launch_template
Debug Output
Please provider a link to a GitHub Gist containing the complete debug output: https://www.terraform.io/docs/internals/debugging.html. Please do NOT paste the debug output in the issue; just paste a link to the Gist.
Panic Output
Error: Provider produced inconsistent final plan
When expanding the plan for module.cluster.module.eks.random_pet.workers_launch_template[0] to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/random" changed the planned action from CreateThenDelete to DeleteThenCreate.
This is a bug in the provider, which should be reported in the provider's own issue tracker.
Error: Invalid function argument: Invalid value for "vars" parameter: invalid vars value: must be a map.
Error: Invalid function argument: Invalid value for "vars" parameter: invalid vars value: must be a map.
Expected Behavior
execute the changes for the worker launch template
Actual Behavior
end up with error
Steps to Reproduce
-
terraform apply
Please post the Terraform config you were using when you got this error, or preferably a minimal reproduction case. Otherwise it is impossible to investigate what happened here.
terraform version Terraform v0.13.2
- provider registry.terraform.io/hashicorp/aws v3.27.0
- provider registry.terraform.io/hashicorp/external v2.0.0
- provider registry.terraform.io/hashicorp/helm v1.3.0
- provider registry.terraform.io/hashicorp/kubernetes v1.13.1
- provider registry.terraform.io/hashicorp/local v2.0.0
- provider registry.terraform.io/hashicorp/null v3.0.0
- provider registry.terraform.io/hashicorp/random v3.0.1
terraform apply crashed to launch below resource , note i have removed user and account details as part of not exposing to external world. Please let me know incase any other details needed.
module.cluster.module.eks.aws_launch_template.workers_launch_template[0] will be updated in-place
~ resource "aws_launch_template" "workers_launch_template" { arn = "arn:aws:ec2:eu-west-1:xxxxx:launch-template/lt-0b69f750ce74b89c2" default_version = 1 disable_api_termination = false ebs_optimized = "true" id = "lt-0b69f750ce74b89c2" ~ image_id = "ami-0b5a529a30d0d9712" -> "ami-0bd8fbcb6205c927e" instance_type = "m4.large" ~ latest_version = 13 -> (known after apply) name = "test-test-spot2020041714483171970000000f" name_prefix = "test-test-spot" security_group_names = [] tags = { "Environment" = "test" } user_data = x.x.x. vpc_security_group_ids = []
block_device_mappings {
device_name = "/dev/xvda"
ebs {
delete_on_termination = "true"
encrypted = "false"
iops = 0
throughput = 0
volume_size = 100
volume_type = "gp2"
}
}
credit_specification {
cpu_credits = "standard"
}
iam_instance_profile {
name = "test2020041714482793830000000e"
}
monitoring {
enabled = true
}
network_interfaces {
associate_public_ip_address = "false"
delete_on_termination = "true"
device_index = 0
ipv4_address_count = 0
ipv4_addresses = []
ipv6_address_count = 0
ipv6_addresses = []
security_groups = [
"sg-0249a7ddedbdfaec5",
]
}
tag_specifications {
resource_type = "volume"
tags = {
"Environment" = "test"
"Name" = "test-test-spot-eks_asg"
}
}
tag_specifications {
resource_type = "instance"
tags = {
"Environment" = "test"
"Name" = "test-test-spot-eks_asg"
}
}
}
module.cluster.module.eks.random_pet.workers[0] must be replaced
+/- resource "random_pet" "workers" { ~ id = "engaging-toucan" -> (known after apply) ~ keepers = { - "lc_name" = "test-test-on-demand20210127083059558600000002" } -> (known after apply) # forces replacement length = 2 separator = "-" }
module.cluster.module.eks.random_pet.workers_launch_template[0] must be replaced
+/- resource "random_pet" "workers_launch_template" { ~ id = "epic-honeybee" -> (known after apply) ~ keepers = { - "lt_name" = "test-test-spot2020041714483171970000000f-13" } -> (known after apply) # forces replacement length = 2 separator = "-" }
I have remove state and then it were able to create newly, I am not sure what's the permanent way to create it.
Hi @Snehil03 👋 Apologies for the long silence here, but I'm going to optimistically guess that a Terraform version upgrade (e.g. 0.14) likely resolved this particular issue at some point. Terraform 0.13 had a lot of quirks and I vaguely remember the "changed the planned action from CreateThenDelete to DeleteThenCreate" error being something that was submitted for a bunch of providers around that time depending on resource configurations. If you are still having trouble with more recent versions of Terraform (1.x), please reach out in a fresh issue with the same level of details and we will take a fresh look. 👍
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.