terraform 0.6.12
I'm trying to create a set of generic scripts, where a variable in 
variables.tf will create the proper SG, etc.
This is the relevant part; "application" is "foobar". If I can get this to work then I might use "deploymentType" as "dev", "prod", "uat", etc. First things first.
resource "aws_security_group" "SG_USE1_${upper(${var.application})}DEV_PRIVATE_ELB_V01" {
# The next line causes a syntax error
#    name = "${upper(SG_USE1_${var.application}${var.deploymentType}_PRIVATE_ELB_V${var.version})}"
# So we hard code it, but we don't want that.
    name = "SG_USE1_FOOBARDEV_PRIVATE_ELB_V01"
    description = "SG to allow access from the ELB"
    vpc_id = "${var.aws_vpc_id}"
and
resource "aws_launch_configuration" "lan-lc" {
    name_prefix = "lan-${var.deploymentType}-"
    image_id = "${lookup(var.awsAMIs, var.awsRegion)}"
    instance_type = "${lookup(var.instanceType, var.deploymentType)}"
    iam_instance_profile = "S3-SSI-LAN-RW"
    lifecycle {
        create_before_destroy = true
    }
Error validating: 1 error(s) occurred:
It also fails in the launch config if I replace the second security group with the same resource name structure that I use in the security group:
"parse error: syntax error"