mirror of
https://github.com/bluxmit/alnoda-workspaces.git
synced 2024-09-29 08:51:45 +13:00
terrafrom-report util back
This commit is contained in:
parent
aaa4474d64
commit
289e27abbb
3 changed files with 28 additions and 2 deletions
26
utils/terraform-report.sh
Normal file
26
utils/terraform-report.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
while getopts i:o: flag
|
||||
do
|
||||
case "${flag}" in
|
||||
i) inventory=${OPTARG};;
|
||||
o) output_dir=${OPTARG};;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "${output_dir}" ]; then output_dir="/home/static-server/terraform-reports/"; fi
|
||||
project_name=${PWD##*/}
|
||||
printf '%s\n' "project name - ${project_name}"
|
||||
report_dir="${output_dir}/${project_name}/$(date +"%d-%m-%Y-%H-%M-%S")"
|
||||
mkdir -p "$report_dir"
|
||||
|
||||
# terraform-docs
|
||||
terrascan scan > ${report_dir}/terrascan.txt
|
||||
|
||||
# Terraform Graph
|
||||
terraform graph | dot -Tsvg > .${report_dir}/graph.svg
|
||||
|
||||
# Terraform Visual
|
||||
terraform plan -out=${report_dir}/plan.out
|
||||
terraform show -json ${report_dir}/plan.out > ${report_dir}/plan.json
|
||||
cd ${report_dir} && terraform-visual --plan ${report_dir}/plan.json
|
|
@ -128,4 +128,4 @@ RUN echo "------------------------------------------------------ ansible ara" \
|
|||
USER abc
|
||||
|
||||
COPY README.md /home/docs/docs/docs.md
|
||||
COPY ./examples/terraform-scaleway /home/terraform
|
||||
COPY ./examples/terraform-scaleway /home/examples/
|
|
@ -9,7 +9,7 @@ Serves folder `/home/terraform`
|
|||
|
||||
In order to serve another terraform folder, for example `/home/project/my-terraform`
|
||||
```
|
||||
blast-radius --serve --port 8033 /home/project/my-terraform
|
||||
blast-radius --serve --port 8030 /home/project/my-terraform
|
||||
```
|
||||
|
||||
### [Terraform Visual](https://github.com/hieven/terraform-visual)
|
||||
|
|
Loading…
Reference in a new issue