Terraform v0.11.8
This is a simplified call to the resource which illustrates the problem. Basically, when the scope is presented with empty strings for the attributes, the provider panics and crashes Terraform. The use case for doing this is the embedding of the aws_config_rule_resource in a module (which I am doing), and allowing the module users to optionally specify a scope. Works great when the scope is specified, obviously not so great when it is not.
resource "aws_config_config_rule" "rule" {
count = "${var.rules_count}"
depends_on = [
"aws_config_configuration_recorder.config"
]
input_parameters = "${lookup(var.input_parameters, element(var.rules, count.index), "")}"
name = "${element(var.rules, count.index)}"
scope {
tag_key = ""
tag_value = ""
}
source {
owner = "AWS"
source_identifier = "${lookup(local.source_identifiers, element(var.rules, count.index))}"
}
}
I believe that the aws_config_config_rule should treat empty strings in the scope attributes as if those attributes were never referenced.
panic
Simply try to create an aws_config_config_rule resources that references the tag_key and tag_value in scope, and supply those with empty strings. Then wait for the panic.
I couldn't find any.
Thanks for the report @joseph-wortmann and sorry you ran into trouble. Submitted a pull request to fix this crash that verifies the empty string configuration should work as expected afterwards: #5852
No need to apologize. Software has bugs. I'm a software guy too. Thank you for jumping on this so quickly!!!
The fix for this has been merged into master and will release with version 1.37.0 of the AWS provider, likely middle of next week. 👍
This has been released in version 1.37.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
The fix for this has been merged into master and will release with version 1.37.0 of the AWS provider, likely middle of next week. 👍