-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unexpected identifier error #63
Comments
Getting this as well, I actually had an error manifest when installing the blastradius package, probably related:
|
@yourbuddyconner please have a look at obourdon@2ed0191 which should fix your issue |
@mattsawyer77 I found it very difficult to run this great piece of software which is blast-radius natively on my systems due to all these messy environments where python versions and dependencies are not always what you would expect them to be (both MacOSX and Linux [several flavours]). However using the docker container to do so worked like a charm. |
@obourdon I think you're definitely on the right track here, I'll fiddle with it! |
Please note that the only "messy part" with docker container, can be if, like me, you are using remote states (S3 bucket+DynamoDB locks) as you'll have to pay close attention to the volumes you mount to be able to access the proper infos |
@obourdon Literally running into that problem right now, considering mounting the EDIT: this worked exactly how I expected it would. I cloned the repo, made minor updates as reflected in Oliver's linked commit above, built the container, and ran this command: Still running into the error @mattsawyer77 encountered though, so not 100% working. |
Relevant error: Coincidentally, due to my plugins being out of date, my IDE tells me this this line is wrong when in reality it's perfectly valid in TF 0.12.x:
When changed to the following, the error in blast-radius goes away:
And I run into another one stemming from my use of the This leads me to believe it's just an out of date HCL parser that doesn't support TF 0.12.x. |
@yourbuddyconner very good analysis (and usage of .aws bind mount) and I guess the error comes from this line in the pyhcl module which has already been reported as issue #55 a few days ago. |
I used the container cmd to run, but it still have the same error:
|
…8mm#71: work around pyhcl virtuald/pyhcl#55: pyhcl doesn't support terraform v0.12 Resolve this temporarily by using the go library `hcl2json` which allows colorization and rendering to still work. JSON references don't appear to work, but the package is still usable. Add pipenv support and update documentation and Makefile to support the external go package.
Did anyone who used the Docker Image get around this issue / work out what caused it? It seems ok to me when using on small TF projects, but occurs when using it on bigger projects. |
@obourdon I used your repo to run and got the errors, 172.17.0.1 - - [14/May/2020 08:31:00] "GET / HTTP/1.1" 200 - |
I'm having the same problem with this main.tf provider "aws" {
region = var.aws_region
access_key = var.access_key
secret_key = var.secret_key
}
data "aws_availability_zones" "available" {
state = "available"
}
terraform {
required_version = "0.12.3"
}
resource "aws_vpc" "my_vpc" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "${var.name_prefix}-vpc"
}
}
#internet gateway
resource "aws_internet_gateway" "my_internet_gateway" {
vpc_id = aws_vpc.my_vpc.id
tags = {
Name = "${var.name_prefix}-internet_gateway"
}
}
# Route tables
resource "aws_default_route_table" "my_private_rt" {
default_route_table_id = aws_vpc.my_vpc.default_route_table_id
route {
cidr_block = "0.0.0.0/0"
nat_gateway_id = aws_nat_gateway.my-nat.id
}
tags = {
Name = "${var.name_prefix}-private-rTable"
}
}
resource "aws_subnet" "my_public_subnet" {
vpc_id = aws_vpc.my_vpc.id
cidr_block = "10.0.1.0/24"
map_public_ip_on_launch = true
availability_zone = data.aws_availability_zones.available.names[1]
tags = {
Name = "${var.name_prefix}-_public2"
}
}
resource "aws_subnet" "my_private1_subnet" {
vpc_id = aws_vpc.my_vpc.id
cidr_block = "10.0.2.0/24"
map_public_ip_on_launch = false
availability_zone = data.aws_availability_zones.available.names[0]
tags = {
Name = "${var.name_prefix}-_private1"
}
}
resource "aws_subnet" "my_private2_subnet" {
vpc_id = aws_vpc.my_vpc.id
cidr_block = "10.0.3.0/24"
map_public_ip_on_launch = false
availability_zone = data.aws_availability_zones.available.names[1]
tags = {
Name = "${var.name_prefix}-_private2"
}
}
resource "aws_subnet" "my_rds1_subnet" {
vpc_id = aws_vpc.my_vpc.id
cidr_block = "10.0.4.0/24"
map_public_ip_on_launch = false
availability_zone = data.aws_availability_zones.available.names[1]
tags = {
Name = "${var.name_prefix}-_rds1"
}
}
resource "aws_subnet" "my_rds2_subnet" {
vpc_id = aws_vpc.my_vpc.id
cidr_block = "10.0.5.0/24"
map_public_ip_on_launch = false
availability_zone = data.aws_availability_zones.available.names[2]
tags = {
Name = "${var.name_prefix}-_rds2"
}
}
resource "aws_db_subnet_group" "my_rds_subnetgroup" {
name = lower("${var.name_prefix}-subnetgroup-rds")
subnet_ids = [
aws_subnet.my_rds1_subnet.id,
aws_subnet.my_rds2_subnet.id
]
tags = {
Name = "${var.name_prefix}-rds_subnetgroup"
}
} whether I use the docker container or the native command
|
I have ran into the same issue. For exemple,
needs to be changed to:
I don't know the effort to make this work, but it would be great. Thanks |
Hello, I'm trying this out with a terraform 0.12 project (which I suspect could be the root issue). The terraform is planned/applied successfully. The blast-radius graph draws on the screen but is not interactive. The blast-radius server shows this output:
Is there a way to find the unexpected identifier to debug further? I tried running
blast-radius
with--debug
but it was not a valid flag.The text was updated successfully, but these errors were encountered: