🙌 Thank you for contributing and joining our mission to help engineers use cloud infrastructure economically and efficiently 🚀.
Join our community Slack channel if you have any questions or need help contributing.
Follow these steps to get the infracost-atlantis
Docker image working locally with GitHub.
- Clone the infracost repo
- Clone this repo and
cd
into it - Make sure the
atlantis.env
file is filled out with the correct values.ATLANTIS_GH_TOKEN
&GITHUB_TOKEN
needs to be set to a personal GitHub access token with repo accessATLANTIS_GH_WEBHOOK_SECRET
can be any long string - see step 8 for more intoATLANTIS_REPO_ALLOWLIST
needs to be the repo you wish to test PR commenting onINFRACOST_API_KEY
needs to be a valid Infracost api key
- Place a
repos.yaml
file in the root of the project that contains the workflows you wish to test - Run
./docker-compose-dev.sh
settingINFRACOST_REPO
variable to point to the relative path of theinfracost
repo - Create a test GitHub repository, populating it with a single
main.tf
file with this content. - Run
curl $(docker port infracost-atlantis_ngrok_1 4040)/api/tunnels | jq ."tunnels" | jq '.[0]' | jq ."public_url"
to get the public url of the ngrok tunnel to your local atlantis - Navigate to Settings > Webhooks > Add webhook
- Set the 'Payload URL' to the URL from the previous step +
/events
path - For 'Content type' select 'application/json'
- For 'Which events would you like to trigger this webhook?' select 'Let me select individual events' and tick 'Pull requests', 'Issue comments' and 'Pushes'.
- Set the 'Payload URL' to the URL from the previous step +
- Make a change to the
main.tf
file and open a PR with it - If everything has run successfully you should see an output on your PR with Infracost results