mirror of
https://github.com/bluxmit/alnoda-workspaces.git
synced 2024-09-04 12:10:56 +12:00
1.8 KiB
1.8 KiB
Terraform tools
Pre-commit hook
Blast-Radius
Serves folder /home/terraform
In order to serve another terraform folder, for example /home/project/my-terraform
blast-radius --serve --port 8030 /home/project/my-terraform
Terraform Visual
- Generate Terraform plan in json
terraform plan -out=plan.out # Run plan and output as a file
terraform show -json plan.out > plan.json # Read plan file and output it in JSON format
- Generate Terraform-visual report
terraform-visual --plan plan.json
Terraform Graph
- Create report
terraform graph | dot -Tsvg > graph.svg
Inframap
- Visualize terraform state
inframap generate terraform.tfstate | dot -Tpng > graph.png
Rover
- serve terraform visualisation
rover --workingDir /home/terraform
NOTE: Rover serves only on port 9000
UPDATE: made fork and configured to serve on any port
ISSUES: does not work, no resources displayed
In order to add Rover to the Workspace:
- Include in Dockerfile
cd /tmp && curl -Lo ./terraform-rover.zip https://github.com/bluxmit/rover/releases/download/v1.6-cust/w1.7.zip \
&& unzip /tmp/terraform-rover.zip -d /tmp/rover && rm terraform-rover.zip \
&& chmod +x /tmp/rover/rover \
&& mv /tmp/rover/rover /usr/bin/rover \
&& rm -rf /tmp/rover \
- Include in supervisord-infra.conf
[program:rover]
directory=/home/terraform
command=/bin/sh -c " rover --workingDir /home/terraform --port 8031 "