-
Notifications
You must be signed in to change notification settings - Fork 97
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
Inframap not showing all of my resources in graph + square instead of name of resources #112
Comments
What is/was the main issue? DOT font is not present on AlpineOS? Just to know as it could be ca common usecase to run InfraMap on "minima" setup (like a CI) to generate the graph and could be good to document it or try to find a solution 😄 Ok I would suggest to run On AWS the connections are detected using Also you can run |
I don't know, I installed graphviz, got dot, but it wasn't writing it correctly, so i tried on a CentOS and it worked.
I tried it yes, but ran into an error, something like "graph node already exist" for one of my resources (not AWS but in the same tf code).
So that's why my PG and NLB are not connected together ? Of course, how can I send it to you ? Here ? Private ? Thanks |
Whatever is more confortable for you :) I would prefer it on the issue as with the But if you prefer you can email me :) (info on GH profile 👍 ) Potentially the main issue is that there is no connection between those 2 resources, could you also explain me (in case I don't see anything on the State) what resource should be connecting those 2 elements in your opinion? Also, if you use more than 1 module on your TFState then #111 could be the issue (for what I see that you say when you use the |
Master now has #111 so if you have multiple modules you could try that and could fix your issue :) |
Hello, I used gitlab-ci, and use the image provide:
the image generate use the cicd as followed How can i fixed it? thanks |
Hi @ziyi-bear could you send me #112 (comment)? I may deduce that the resoruce you have we do not support connections for them, right now we'll only display (on AWS) connections by SecurityGroups. So if in you usecase there are not it's better of potentially using the |
Hello there, I've used successfully Inframap inside a GitLab CI pipeline. I've added this script inside my CI Pipeline and everything works fine:
|
Ou! Really good find @bollohz hehe @Nicolasvacher and @ziyi-bear could you test what @bollohz mentioned to see if it works? I'll also test it on my side with the Docker image and if it fails I think the solution would be for us to add those pkgs on the builded image. |
YES I have Test it and this setting works, thanks @bollohz |
This is my gitlab ci file: variables:
INFRAMAP_EXPORT_FILE_PREFIX: "inframap_export_"
INFRAMAP_EXPORT_FILENAME_STD: "std"
INFRAMAP_EXPORT_FILENAME_CONNECTIONS: "connections"
INFRAMAP_EXPORT_FILENAME_RAW: "raw"
terraform-inframap:
stage: build
tags:
- docker
- linux
image:
name: cycloid/inframap
entrypoint: [""]
variables:
INFRAMAP_EXTRA_ARGS: "--hcl --clean=false"
before_script:
- export PATH=/app:$PATH
- inframap version
- apk add graphviz
- apk add font-bitstream-type1 ghostscript-fonts ttf-cantarell
script:
- cd ${TF_ROOT}
## https://unix.stackexchange.com/questions/31947/how-to-add-a-newline-to-the-end-of-a-file
## add a newline to the end of a file
- sed -i -e '$a\' *.tf
- cat *.tf > temp_inframap.tf
- cat temp_inframap.tf
- inframap generate temp_inframap.tf ${INFRAMAP_EXTRA_ARGS} | dot -Tpng > ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_STD}.png
- inframap generate --connections=false temp_inframap.tf ${INFRAMAP_EXTRA_ARGS} | dot -Tpng > ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_CONNECTIONS}.png
- inframap generate temp_inframap.tf --raw ${INFRAMAP_EXTRA_ARGS} | dot -Tpng > ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_RAW}.png
artifacts:
paths:
# - "temp_inframap.tf"
- "inframap*.png"
untracked: false
expire_in: 90 days
## https://stackoverflow.com/questions/52928915/cant-share-global-variable-value-between-jobs-in-gitlab-ci-yaml-file
terraform-inframap-upload:
stage: .post
tags:
- docker
- linux
needs:
- job: terraform-inframap
artifacts: true
image: curlimages/curl
before_script:
- curl --version
- echo "ls:" $(ls -la)
- echo "Upload inframap std File Name:" ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_STD}
- echo "Upload inframap connections File Name:" ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_CONNECTIONS}
- echo "Upload inframap raw File Name:" ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_RAW}
script:
- cd ${REPORT_FOLDER} && ls -la
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" -H "Expect:" --upload-file ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_STD}.png "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/IaC-Report/${CI_COMMIT_REF_NAME}/${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_STD}.png" '
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" -H "Expect:" --upload-file ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_CONNECTIONS}.png "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/IaC-Report/${CI_COMMIT_REF_NAME}/${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_CONNECTIONS}.png" '
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" -H "Expect:" --upload-file ${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_RAW}.png "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/IaC-Report/${CI_COMMIT_REF_NAME}/${INFRAMAP_EXPORT_FILE_PREFIX}${INFRAMAP_EXPORT_FILENAME_RAW}.png" ' @xescugc It will generate the image and save to gitlab repo package |
Hi,
Terraform version : 13.5
Os : Alpine Linux
Provider : AWS
I'm executing this command on a tfstate containing a beanstalk env (just then env, not the app, it is already created on AWS) and an RDS database :
inframap generate --tfstate terraformtest.tfstate --clean=false
It's only showing in the graph the RDS, and nothing about the Beanstalk env.
I also have a problem with the graph created using this command :
inframap generate --tfstate terraform.tfstate --clean=false | dot -Tpng > inframap.png
Resulting in this :
EDIT : The squares were due to the use of the Alpine OS. Problem found for this one.
Any help would be greatly appreciated :) Thanks !
The text was updated successfully, but these errors were encountered: