ฮป terraform version
Terraform v0.12.28
+ provider.archive v1.3.0
+ provider.aws v2.70.0
resource "aws_dynamodb_table" "file_service_requests" {
count = 1
name = "file-service-requests-${terraform.workspace}"
hash_key = "Ref"
billing_mode = "PAY_PER_REQUEST"
attribute {
name = "Ref"
type = "S"
}
ttl {
attribute_name = "Ttl"
enabled = true
}
}
output "dynamodb_table_name" {
value = aws_dynamodb_table.file_service_requests[0].name
description = "Name of the dynamodb for inbound requests"
}
After removing count:
resource "aws_dynamodb_table" "file_service_requests" {
name = "file-service-requests-${terraform.workspace}"
hash_key = "Ref"
billing_mode = "PAY_PER_REQUEST"
attribute {
name = "Ref"
type = "S"
}
ttl {
attribute_name = "Ttl"
enabled = true
}
}
output "dynamodb_table_name" {
value = aws_dynamodb_table.file_service_requests.name
description = "Name of the dynamodb for inbound requests"
}
The plan should not show any changes and should not fail
Plan fails:
Error: Unsupported attribute
on modules/file_service/outputs.tf line 7, in output "dynamodb_table_name":
7: value = aws_dynamodb_table.file_service_requests.name
|----------------
| aws_dynamodb_table.file_service_requests is empty tuple
This value does not have any attributes.
I've confirmed this is fixed in the latest 0.13 release.
Thanks for reporting it @TomTucka!
0.13 has been released: https://www.terraform.io/downloads.html
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.