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
mikhasd opened this issue
Aug 10, 2020
· 3 comments
· Fixed by #28017
Labels
bugconfirmeda Terraform Core team member has reproduced this issuev0.12Issues (primarily bugs) reported against v0.12 releasesv0.13Issues (primarily bugs) reported against v0.13 releases
provider"aws" {
# ...
}
resource"aws_cloudformation_stack""failing_resource" {
name="FailingResource"template_body=jsonencode({
AWSTemplateFormatVersion ="2010-09-09"
Resources = {
FailingResource = {
Type ="Custom::FailingResource"
Properties = {
ServiceToken ="112233445566778899"
}
}
}
Outputs = {
MissingOutput = {
Value ="MissingValue"
}
}
})
}
data"aws_cloudformation_stack""missing_stack" {
name="TheStack${aws_cloudformation_stack.failing_resource.outputs["MissingOutput"]}"
}
output"missing_output" {
value="The the result is: ${aws_cloudformation_stack.failing_resource.outputs["MissingOutput"]}"
}
Debug Output
Crash Output
$ terraform destroy
aws_cloudformation_stack.failing_resource: Refreshing state... [id=arn:aws:cloudformation:us-east-1:************:stack/FailingResource/aeb06230-daf1-11ea-b81c-0a34514375d1]
Error: Invalid index
on main.tf line 70, in data "aws_cloudformation_stack" "missing_stack":
70: name = "TheStack${aws_cloudformation_stack.failing_resource.outputs["MissingOutput"]}"
|----------------
| aws_cloudformation_stack.failing_resource.outputs is empty map of string
The given key does not identify an element in this collection value.
Error: Invalid index
on main.tf line 74, in output "missing_output":
74: value = "The the result is: ${aws_cloudformation_stack.failing_resource.outputs["MissingOutput"]}"
|----------------
| aws_cloudformation_stack.failing_resource.outputs is empty map of string
The given key does not identify an element in this collection value.
Expected Behavior
Outputs and data sources should not be resolved as its dependencies are not in a valid state.
I should be able to destroy the my state and underlying resources.
Actual Behavior
The failure on executing the cloud formation stack cause its state to contains an empty map of outputs instead of the expected map.
It is causing the output and data source evaluation to fail, preventing it from destroying the invalid state.
Steps to Reproduce
terraform init
terraform apply
terraform destroy
Additional Context
References
The text was updated successfully, but these errors were encountered:
@mikhasd as a short-term workaround in case you're blocked ont his, you can use a terraform config with just your aws provider block to set the region and run a destroy just with that and your state.
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.
ghost
locked as resolved and limited conversation to collaborators
Apr 9, 2021
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bugconfirmeda Terraform Core team member has reproduced this issuev0.12Issues (primarily bugs) reported against v0.12 releasesv0.13Issues (primarily bugs) reported against v0.13 releases
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
Outputs and data sources should not be resolved as its dependencies are not in a valid state.
I should be able to destroy the my state and underlying resources.
Actual Behavior
The failure on executing the cloud formation stack cause its state to contains an empty map of outputs instead of the expected map.
It is causing the output and data source evaluation to fail, preventing it from destroying the invalid state.
Steps to Reproduce
terraform init
terraform apply
terraform destroy
Additional Context
References
The text was updated successfully, but these errors were encountered: