Terraform 0.9.2, AWS, OS X 10.12.5 main.tf, shared .tfstate in a S3 bucket:
#=================
# Terraform
#=================
terraform {
backend "s3" {
bucket = "com.whd-design.terraform-s3-state-bucket"
key = "tfState/htmt-book"
region = "eu-west-2"
encrypt = true
lock_table = "terraform-state-lock"
}
}
This works fine, the state is written to the bucket (and I can see successive versions as changes are made), and a DynamoDB record is created. However trying to use the dot-notation bucket name in output causes an error:
output "State_S3_Bucket_ARN" {
value = "${aws_s3_bucket.com.whd-design.terraform-s3-state-bucket.arn}"
}
* output 'State_S3_Bucket_ARN': unknown resource 'aws_s3_bucket.com' referenced in variable aws_s3_bucket.com.whd-design.terraform-s3-state-bucket.arn
Other output statements without dots in the name work fine - is it just that dot format cannot be used? (Odd as it works to actually create & use the S3 object). Is there some escaping that can be used around the resource name?
Many Thanks