28mm / blast-radius

Interactive visualizations of Terraform dependency graphs using d3.js
https://28mm.github.io/blast-radius-docs/
MIT License
2.03k stars 256 forks source link

blast-radius not working with latest terraform version #71

Open ltomes opened 4 years ago

ltomes commented 4 years ago

blast-radius is not working with latest terraform version. On inspection, blast-radius builds out terraform version 0.12.3, if a user is using a newer version of terraform they will get the following error: Error refreshing state: state snapshot was created by Terraform v0.12.12, which is newer than current v0.12.3; upgrade to Terraform v0.12.12 or greater to work with this state

I have updated the terraform version in this PR: #70

Temporary mediation for compose users: Create a docker-compose file like so:

version: '3.7'
services:
  graph:
    cap_add:
      - SYS_ADMIN
    image: gemini-blast-radius # 28mm/blast-radius
    build:
      context: ./
      dockerfile: ./Dockerfile
    ports:
      - "5000:5000"
    expose:
      - "5000"
    volumes:
      - "./:/data"

Create a Dockerfile with the following properties:

ARG TF_VERSION=0.12.12
ARG PYTHON_VERSION=3.7

FROM hashicorp/terraform:$TF_VERSION AS terraform_latest
FROM 28mm/blast-radius

COPY --from=terraform_latest /bin/terraform /bin/terraform

The above compose file pulls blast-radius as is, and then forces the terraform 0.12.12 binary into the blast radius container.

To call blast-radius just call docker--compose graph from the working directory of your terraform files.