├── .env.example
├── .eslintrc.js
├── .github
├── dependabot.yml
└── workflows
│ ├── bump_cli_version.yml
│ ├── checks.yml
│ ├── codeql-analysis.yml
│ ├── release.yml
│ ├── release_dev.yml
│ ├── release_prod.yml
│ └── upload_assets.yml
├── .gitignore
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── LICENSE
├── README.md
├── babel.config.js
├── docs
├── faq.md
├── features
│ ├── cli_commands.md
│ ├── config_file.mdx
│ ├── environment_variables.md
│ ├── json_output_format.md
│ ├── terraform_modules.md
│ ├── terragrunt.md
│ ├── usage_based_resources.md
│ └── vscode.md
├── getting_started.md
├── infracost_cloud
│ ├── api.md
│ ├── custom_price_books.md
│ ├── data_export.md
│ ├── engineer_guide.md
│ ├── finops_policies.md
│ ├── get_started.md
│ ├── guardrails.md
│ ├── jira_integration.md
│ ├── key_concepts.md
│ ├── readme_badge.md
│ ├── reports.md
│ ├── sso.md
│ └── tagging_policies.md
├── integrations
│ ├── azure_repos_app.md
│ ├── cicd.mdx
│ ├── cicd_integrations.md
│ ├── github_app.md
│ ├── gitlab_app.md
│ ├── infracost_api.md
│ ├── open_policy_agent.md
│ ├── slack.md
│ ├── spacelift.md
│ ├── terraform_cloud_enterprise.md
│ └── third_party_integrations.md
├── privacy_policy.md
├── support.md
├── supported_resources
│ ├── aws.md
│ ├── azure.md
│ ├── cloud_pricing_api.md
│ ├── google.md
│ └── overview.md
├── terms_of_service.md
└── troubleshooting.md
├── docusaurus.config.js
├── package-lock.json
├── package.json
├── sidebars.js
├── src
├── components
│ ├── CTA.js
│ ├── Footer.js
│ ├── GitHubStarCount.js
│ ├── Navbar.js
│ ├── PageLayout.js
│ ├── icons
│ │ ├── ArrowIcon.tsx
│ │ ├── BookIcon.tsx
│ │ ├── Check.js
│ │ ├── LinkedInIcon.js
│ │ ├── OpenBookIcon.tsx
│ │ ├── SearchIcon.tsx
│ │ └── TwitterIcon.js
│ └── utils
│ │ └── WebPPngFallback.tsx
├── css
│ ├── base.css
│ ├── components.css
│ ├── docs.css
│ ├── footer.css
│ ├── index.css
│ └── navbar.css
└── theme
│ ├── Footer
│ ├── index.js
│ └── styles.module.css
│ └── Navbar
│ ├── index.js
│ └── styles.module.css
├── static
├── .nojekyll
├── img
│ ├── azure
│ │ ├── azure-app-install-1.png
│ │ ├── azure-app-install-2.png
│ │ ├── dismiss.png
│ │ ├── failure.png
│ │ ├── help.png
│ │ └── snooze.png
│ ├── bg-top.svg
│ ├── bg.svg
│ ├── ci-cd
│ │ ├── github_actions_screenshot.png
│ │ └── github_actions_screenshot.webp
│ ├── docs
│ │ └── cloud_pricing_api
│ │ │ ├── deployment_overview.png
│ │ │ └── stats_page.png
│ ├── favicon.png
│ ├── github
│ │ ├── checks.png
│ │ ├── desc.png
│ │ ├── dismissed-table.png
│ │ ├── help.png
│ │ ├── passing.png
│ │ ├── reaction.png
│ │ ├── snooze-checks.png
│ │ ├── snooze.png
│ │ └── verify-email.png
│ ├── gitlab
│ │ ├── complete.png
│ │ ├── dismiss.png
│ │ ├── help.png
│ │ └── snooze.png
│ ├── icon-primary.svg
│ ├── icons
│ │ ├── approval-icon.svg
│ │ ├── check.svg
│ │ ├── choices-icon.svg
│ │ ├── close.svg
│ │ ├── github.svg
│ │ ├── hamburger.svg
│ │ ├── heart.svg
│ │ ├── open-source.svg
│ │ ├── problem-icon.svg
│ │ ├── product-walkthrough-icon.svg
│ │ ├── rocket-white.svg
│ │ ├── slack.svg
│ │ ├── slack.webp
│ │ ├── soc2.png
│ │ ├── social-icons.svg
│ │ ├── social
│ │ │ ├── linkedin.svg
│ │ │ └── twitter.svg
│ │ ├── star-white.svg
│ │ ├── star.svg
│ │ └── visibility-icon.svg
│ ├── infracost-cloud
│ │ ├── auth0-account-link.png
│ │ ├── baseline-vs-usage-costs.png
│ │ ├── cli-project-name.png
│ │ ├── cloudformation-stack-new.png
│ │ ├── cloudformation-stack.png
│ │ ├── create-orgs.png
│ │ ├── custom-price-books.png
│ │ ├── dashboard-chart.png
│ │ ├── dashboard.png
│ │ ├── dashboard.webp
│ │ ├── data-export.png
│ │ ├── default-repo-config-file.png
│ │ ├── engineer-guide
│ │ │ ├── help-command.png
│ │ │ ├── login.png
│ │ │ └── pr-comment.png
│ │ ├── finops-policies
│ │ │ ├── burndown-chart.png
│ │ │ ├── chart.png
│ │ │ ├── policies.png
│ │ │ ├── policy-settings.png
│ │ │ ├── pr-comment-expanded.png
│ │ │ ├── preferred.png
│ │ │ └── production-filters.png
│ │ ├── guardrails
│ │ │ ├── actions.png
│ │ │ ├── azure-repos-require-status-pass.png
│ │ │ ├── blocked-pull-request.png
│ │ │ ├── cost-savings.png
│ │ │ ├── custom-pull-request-message.png
│ │ │ ├── email.png
│ │ │ ├── github-require-status-pass.png
│ │ │ ├── guardrail-events.png
│ │ │ ├── guardrail-with-custom-message.png
│ │ │ ├── index.png
│ │ │ ├── name-and-scope.png
│ │ │ ├── notifications.png
│ │ │ ├── pull-request-filters.png
│ │ │ ├── slack-message.png
│ │ │ ├── thresholds.png
│ │ │ └── unblock-pr.png
│ │ ├── infracost-cloud-project-name.png
│ │ ├── org-api-key-tick.png
│ │ ├── org-api-key.png
│ │ ├── org-id.png
│ │ ├── pr-comment-project-name.png
│ │ ├── pull-request-comment.png
│ │ ├── pull-request-status-filter.png
│ │ ├── pull-request-with-usage-cost.png
│ │ ├── pull-requests-tab.png
│ │ ├── readme-badge-code.png
│ │ ├── readme-badge-settings.png
│ │ ├── readme-badge.png
│ │ ├── report-create.png
│ │ ├── report-email.png
│ │ ├── runs.png
│ │ ├── s3-bucket-policy-editor.png
│ │ ├── s3-bucket-policy.png
│ │ ├── s3-create-event-notification.png
│ │ ├── s3-notification-created.png
│ │ ├── s3-notification-event-types.png
│ │ ├── s3-notification-general-config.png
│ │ ├── s3-permissions.png
│ │ ├── s3-properties.png
│ │ ├── s3-topic-config.png
│ │ ├── spacelift
│ │ │ ├── config_file.png
│ │ │ ├── github_run_configurations.png
│ │ │ └── github_run_remote_module.png
│ │ ├── tagging-policies
│ │ │ ├── actions-to-take.png
│ │ │ ├── branch-policies.png
│ │ │ ├── coverage-chart.png
│ │ │ ├── customizations.png
│ │ │ ├── define-tags.png
│ │ │ ├── filters.png
│ │ │ ├── name-and-scope.png
│ │ │ └── pull-request-tags.png
│ │ ├── usage-defaults.png
│ │ └── usage-overrides.png
│ ├── jira
│ │ ├── 0-organization-settings.png
│ │ ├── 1-generate-token.png
│ │ ├── 10-success-status.png
│ │ ├── 11-pull-request.png
│ │ ├── 12-accept-permissions.png
│ │ ├── 13-successful-pr.png
│ │ ├── 2-copy-token.png
│ │ ├── 3-integration-status.png
│ │ ├── 4-install-app.png
│ │ ├── 5-select-server.png
│ │ ├── 6-success-install.png
│ │ ├── 7-manage-apps.png
│ │ ├── 8-select-infracost.png
│ │ ├── 9-add-token.png
│ │ ├── app-guardrails.png
│ │ ├── app-issue.png
│ │ ├── dashboard.png
│ │ ├── filter.png
│ │ └── issue.png
│ ├── logo-light.png
│ ├── logo-light.svg
│ ├── logo.png
│ ├── logo.svg
│ ├── screenshots
│ │ ├── 0.8_breakdown_no_usage.png
│ │ ├── 0.8_diff_screenshot.png
│ │ ├── actions-pull-request.png
│ │ ├── atlantis-comment.png
│ │ ├── azure-app-comment.png
│ │ ├── azure-app-install.png
│ │ ├── azure-pull-request.png
│ │ ├── cost-guardrails-and-policies.png
│ │ ├── cost-guardrails-and-policies.webp
│ │ ├── cost-policy-fail.png
│ │ ├── cost-visibility-for-product-changes.png
│ │ ├── cost-visibility-for-product-changes.webp
│ │ ├── cost-visibility.png
│ │ ├── cost-visibility.webp
│ │ ├── diff-screenshot.png
│ │ ├── enterprise-ready.png
│ │ ├── enterprise-ready.webp
│ │ ├── get-started-breakdown.png
│ │ ├── get-started-diff.png
│ │ ├── get-started-infracost-cloud.png
│ │ ├── get-started-vscode.gif
│ │ ├── github-app-comment.png
│ │ ├── github-app-install.png
│ │ ├── github-comment-format.png
│ │ ├── gitlab-app-comment.png
│ │ ├── gitlab-app-install.png
│ │ ├── gitlab-comment.png
│ │ ├── hashicorp-infracost-partner-badge.png
│ │ ├── html_report.png
│ │ ├── paste-output.png
│ │ ├── policy-failure-github.png
│ │ ├── policy-passing-github.png
│ │ ├── post_to_slack.png
│ │ ├── pr-step-1.png
│ │ ├── pr-step-1.webp
│ │ ├── pr-step-2.png
│ │ ├── pr-step-3.png
│ │ ├── pr-step-4.png
│ │ ├── share-link-mock.png
│ │ ├── slack-message-format.png
│ │ └── tfc_integration.png
│ ├── services
│ │ ├── atlantis.png
│ │ ├── aws-cloud-formation.svg
│ │ ├── aws.svg
│ │ ├── azure-pipelines.png
│ │ ├── azure-repos.svg
│ │ ├── azure.svg
│ │ ├── bitbucket-pipelines.png
│ │ ├── bitbucket.svg
│ │ ├── circleci.svg
│ │ ├── docker.png
│ │ ├── env0.svg
│ │ ├── github-actions-icon.svg
│ │ ├── github-actions.png
│ │ ├── github.svg
│ │ ├── gitlab-ci.png
│ │ ├── gitlab.svg
│ │ ├── google-cloud.svg
│ │ ├── hashicorp.svg
│ │ ├── jenkins.svg
│ │ ├── pulumi.svg
│ │ ├── scalr.png
│ │ ├── slack.svg
│ │ ├── spacelift.svg
│ │ ├── spotify-backstage.svg
│ │ ├── terraform-cloud.svg
│ │ └── terraform.svg
│ ├── shift-left.svg
│ ├── small-logo.png
│ ├── social-image.png
│ ├── social
│ │ ├── HinnerkHaardt.jpg
│ │ ├── KeithBaker.jpg
│ │ ├── MatthewTovbin.jpg
│ │ ├── ShabanovAlexey.jpg
│ │ ├── ayrtonfreeman.jpg
│ │ └── jderusse.jpg
│ ├── sso
│ │ ├── google-workspace-attributes.png
│ │ ├── google-workspace-service-provider.png
│ │ ├── okta-attribute-statements.png
│ │ └── okta-saml-settings.png
│ └── vscode-extension
│ │ ├── maintf.png
│ │ └── maintf.webp
├── releases.json
└── robots.txt
└── static_src
└── carbon-config-screenshot.json
/.env.example:
--------------------------------------------------------------------------------
1 | INFRACOST_DASHBOARD_API_ENDPOINT=https://dashboard.api.infracost.io
2 | INFRACOST_DASHBOARD_ENDPOINT=https://dashboard.infracost.io
3 | INFRACOST_DOCS_API_TOKEN=
4 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | env: {
4 | browser: true,
5 | },
6 | extends: [
7 | 'react-app',
8 | 'airbnb-base',
9 | 'plugin:@typescript-eslint/recommended',
10 | 'prettier',
11 | ],
12 | parser: '@typescript-eslint/parser',
13 | plugins: ['@typescript-eslint'],
14 | settings: {
15 | 'import/resolver': {
16 | node: {
17 | paths: ['src'],
18 | extensions: ['.ts', '.js', '.tsx', '.jsx'],
19 | },
20 | },
21 | },
22 | rules: {
23 | 'import/extensions': 'off',
24 | 'max-classes-per-file': 'off',
25 | 'max-len': 'off',
26 | 'no-await-in-loop': 'off',
27 | 'no-continue': 'off',
28 | 'no-plusplus': 'off',
29 | 'no-restricted-syntax': 'off',
30 | 'no-shadow': 'off',
31 | 'no-use-before-define': 'off',
32 | 'no-useless-constructor': 'off',
33 | '@typescript-eslint/no-unused-vars': [
34 | 'warn',
35 | {
36 | argsIgnorePattern: '^_',
37 | varsIgnorePattern: '^_',
38 | caughtErrorsIgnorePattern: '^_',
39 | },
40 | ],
41 | 'import/no-extraneous-dependencies': [
42 | 'error',
43 | {
44 | peerDependencies: true,
45 | },
46 | ],
47 | 'import/no-unresolved': [
48 | 'error',
49 | {
50 | ignore: ['^@theme', '^@docusaurus', '^@site'],
51 | },
52 | ],
53 | },
54 | ignorePatterns: [],
55 | };
56 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: monthly
7 | reviewers:
8 | - infracost/engineering
9 | labels:
10 | - dependencies
11 | - package-ecosystem: npm
12 | directory: "/"
13 | schedule:
14 | interval: monthly
15 | open-pull-requests-limit: 10
16 | reviewers:
17 | - infracost/engineering
18 | labels:
19 | - dependencies
20 |
--------------------------------------------------------------------------------
/.github/workflows/bump_cli_version.yml:
--------------------------------------------------------------------------------
1 | name: Bump CLI version info
2 |
3 | on:
4 | workflow_dispatch:
5 | repository_dispatch:
6 | types: [ bump_cli_version ]
7 |
8 | jobs:
9 | bump-cli:
10 | name: Bump CLI version info
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v3
14 | - name: Download latest releases.json
15 | run: |
16 | curl https://api.github.com/repos/infracost/infracost/releases -o ./static/releases.json
17 | git add ./static/releases.json
18 | echo "latest_version=$(jq .[0].name static/releases.json | sed s/v//)" >> $GITHUB_ENV
19 | - name: Find/replace lastest CLI version references
20 | run: |
21 | find docs -name '*.md' -print0 | xargs -0 \
22 | sed -r -i "s/infracost --version # Should show [[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+/infracost --version # Should show ${{ env.latest_version }}/g"
23 | git --no-pager diff -R
24 | - name: Create pull request
25 | env:
26 | GH_TOKEN: ${{ github.token }}
27 | run: |
28 | git config user.email "52185+tim775@users.noreply.github.com"
29 | git config user.name "tim775"
30 | git add .
31 | git checkout -b chore/bump_to_release_${{ env.latest_version }}
32 | git commit -m "chore: bump to latest CLI version"
33 | git push --set-upstream origin chore/bump_to_release_${{ env.latest_version }}
34 | gh pr create -r tim775 --title="chore: Bump to cli version ${{ env.latest_version }}" --body="Autogenerated by CLI release workflow."
35 |
--------------------------------------------------------------------------------
/.github/workflows/checks.yml:
--------------------------------------------------------------------------------
1 | name: Checks
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 |
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v3
13 |
14 | - name: use node 16.15.1
15 | uses: actions/setup-node@v3
16 | with:
17 | node-version: 16.15.1
18 |
19 | - name: cache npm
20 | id: cache-npm
21 | uses: actions/cache@v3
22 | with:
23 | path: |
24 | ./.npm
25 | ./node_modules
26 | key: ${{ runner.os }}-npm-web-${{ hashFiles('package-lock.json') }}
27 | restore-keys: |
28 | ${{ runner.os }}-npm-
29 |
30 | - if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
31 | name: install node modules
32 | run: npm ci --cache=.npm
33 |
34 | - name: check project formatting
35 | run: npm run format:check
36 |
37 | - name: lint project
38 | run: npm run lint
39 |
40 | - name: build project
41 | run: npm run build
42 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | name: Scan code for vulnerabilities
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: [ master ]
8 | schedule:
9 | # run 05:00 every Monday
10 | - cron: '00 05 * * 1'
11 |
12 | jobs:
13 | analyze:
14 | name: Analyze
15 | runs-on: ubuntu-latest
16 | permissions:
17 | actions: read
18 | contents: read
19 | security-events: write
20 |
21 | steps:
22 | - name: Checkout repository
23 | uses: actions/checkout@v3
24 |
25 | - name: Initialize CodeQL
26 | uses: github/codeql-action/init@v2
27 | with:
28 | languages: "javascript"
29 |
30 | - name: Perform CodeQL Analysis
31 | uses: github/codeql-action/analyze@v2
32 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | on:
2 | workflow_dispatch:
3 | workflow_run:
4 | workflows: [ Checks ]
5 | types: [ completed]
6 | branches: [ master ]
7 |
8 | name: "Release"
9 |
10 | jobs:
11 | release-dev:
12 | if: ${{ github.event.workflow_run.conclusion == 'success' }}
13 | uses: ./.github/workflows/release_dev.yml
14 | secrets: inherit
15 |
16 | release-prod:
17 | if: ${{ github.event.workflow_run.conclusion == 'success' }}
18 | needs: release-dev
19 | uses: ./.github/workflows/release_prod.yml
20 | secrets: inherit
21 |
--------------------------------------------------------------------------------
/.github/workflows/release_dev.yml:
--------------------------------------------------------------------------------
1 | on:
2 | workflow_dispatch:
3 | workflow_call:
4 |
5 | name: "Release dev"
6 |
7 | jobs:
8 | release-dev:
9 | uses: ./.github/workflows/upload_assets.yml
10 | with:
11 | aws-region: us-east-2
12 | domain: www.dev.infracost.io
13 | infracost-dashboard-api-endpoint: https://dashboard.api.infracost.io
14 | infracost-dashboard-endpoint: https://dashboard.infracost.io
15 | secrets:
16 | AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
17 | AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
18 | INFRACOST_DOCS_API_TOKEN: ${{ secrets.INFRACOST_DOCS_API_TOKEN }}
19 |
--------------------------------------------------------------------------------
/.github/workflows/release_prod.yml:
--------------------------------------------------------------------------------
1 | on:
2 | workflow_dispatch:
3 | workflow_call:
4 |
5 | name: "Release prod"
6 |
7 | jobs:
8 | release-prod:
9 | uses: ./.github/workflows/upload_assets.yml
10 | with:
11 | aws-region: us-east-2
12 | domain: www.infracost.io
13 | infracost-dashboard-api-endpoint: https://dashboard.api.infracost.io
14 | infracost-dashboard-endpoint: https://dashboard.infracost.io
15 | secrets:
16 | AWS_ACCESS_KEY_ID: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
17 | AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
18 | INFRACOST_DOCS_API_TOKEN: ${{ secrets.INFRACOST_DOCS_API_TOKEN }}
19 |
--------------------------------------------------------------------------------
/.github/workflows/upload_assets.yml:
--------------------------------------------------------------------------------
1 | on:
2 | workflow_call:
3 | inputs:
4 | aws-region:
5 | default: us-east-2
6 | type: string
7 | domain:
8 | type: string
9 | infracost-dashboard-api-endpoint:
10 | type: string
11 | infracost-dashboard-endpoint:
12 | type: string
13 | secrets:
14 | AWS_ACCESS_KEY_ID:
15 | required: true
16 | AWS_SECRET_ACCESS_KEY:
17 | required: true
18 | INFRACOST_DOCS_API_TOKEN:
19 | required: true
20 |
21 | name: Upload assets
22 |
23 | jobs:
24 | release:
25 | name: Upload assets
26 | runs-on: ubuntu-latest
27 |
28 | steps:
29 | - uses: actions/checkout@v3
30 | - name: use node 18.12.0
31 | uses: actions/setup-node@v3
32 | with:
33 | node-version: 18.12.0
34 | - name: install node modules
35 | run: npm ci
36 | - name: build project
37 | run: npm run build
38 | env:
39 | INFRACOST_DASHBOARD_API_ENDPOINT: ${{ inputs.infracost-dashboard-api-endpoint }}
40 | INFRACOST_DASHBOARD_ENDPOINT: ${{ inputs.infracost-dashboard-endpoint }}
41 | INFRACOST_DOCS_API_TOKEN: ${{ secrets.INFRACOST_DOCS_API_TOKEN }}
42 | - name: configure AWS credentials
43 | uses: aws-actions/configure-aws-credentials@v4
44 | with:
45 | aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
46 | aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
47 | aws-region: ${{ inputs.aws-region }}
48 | - name: sync S3 and cloudfront
49 | id: sync_s3_and_cloudfront
50 | run: |
51 | CLOUDFRONT_DISTRIBUTION=$(aws cloudfront list-distributions | jq -r '.DistributionList.Items[] | select(.Aliases.Items[0]=="'${{ inputs.domain }}'")')
52 | CLOUDFRONT_DISTRIBUTION_ID=$(echo $CLOUDFRONT_DISTRIBUTION | jq -r '.Id')
53 | S3_BUCKET=$(echo $CLOUDFRONT_DISTRIBUTION | jq -r '.Origins.Items[] | select (.Id=="docs") | .DomainName' | sed 's/\(.*\)\.s3-website\.[^.]*\.amazonaws.com/\1/')
54 | aws s3 sync build s3://${S3_BUCKET}/docs --delete
55 | aws cloudfront create-invalidation --distribution-id=${CLOUDFRONT_DISTRIBUTION_ID} --paths "/docs/*" --no-cli-pager
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Dependencies
2 | /node_modules
3 |
4 | # Production
5 | /build
6 |
7 | # Generated files
8 | .docusaurus
9 | .cache-loader
10 |
11 | # Misc
12 | .DS_Store
13 | .env.local
14 | .env.development.local
15 | .env.test.local
16 | .env.production.local
17 |
18 | npm-debug.log*
19 | yarn-debug.log*
20 | yarn-error.log*
21 |
22 | # IDE
23 | .idea/
24 | .vscode/
25 |
26 | .env
27 |
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | v16.15.1
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | /static
2 | /build
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 100,
3 | "singleQuote": true
4 | }
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | # Proprietary License
2 | This license is temporary while a more official one is drafted. However, this should make it clear:
3 |
4 | The text contents of this website are licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
5 |
6 | The design contents of this website are proprietary and may not be reproduced or reused in any way other than to run the website locally. The license for the design is owned solely by Infracost Inc.
7 |
8 | Copyright 2022 Infracost Inc.
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Infracost Docs
2 |
3 | This website is built using [Docusaurus 2](https://v2.docusaurus.io/).
4 |
5 | ### Installation
6 |
7 | ```
8 | nvm use
9 | npm install
10 | ```
11 |
12 | ### Local Development
13 |
14 | Create a file `.env` and set required environment variables. Use `.env.example`
15 | as an example.
16 |
17 | ```
18 | npm start
19 | ```
20 |
21 | This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
22 |
23 | ### Build
24 |
25 | ```
26 | npm run build
27 | ```
28 |
29 | This command generates static content into the `build` directory and can be served using any static contents hosting service.
30 |
31 | ### Deployment
32 |
33 | Update the version mentioned in docs/docs/getting_started.md as some users with old brew caches don't get the latest infracost.
34 |
35 | Merges to master automatically update www.infracost.io
36 |
37 | Check that the image loads on https://cards-dev.twitter.com/validator for new blog post URLs
38 |
39 |
--------------------------------------------------------------------------------
/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3 | };
4 |
--------------------------------------------------------------------------------
/docs/features/terragrunt.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: terragrunt
3 | title: Terragrunt
4 | ---
5 |
6 | The Infracost `breakdown` and `diff` commands automatically detect Terragrunt projects, though we generally recommend setting up a [config file](/docs/features/config_file/) for Terragrunt repos.
7 |
8 | ```shell
9 | infracost breakdown --path=path/to/terragrunt/repo
10 | ```
11 |
12 | The `--exclude-path` flag can be used to exclude any directories/modules that should not be run, for example:
13 | ```shell
14 | infracost breakdown --path=. --exclude-path=dev --exclude-path=test
15 | ```
16 |
17 | ## Usage file
18 |
19 | If your Terragrunt project has multiple modules and you want to specify different usage files for each module, you will need to add each Terragrunt subdirectory and [usage file](/docs/features/usage_based_resources/) to the Infracost config file, see an [example here](/docs/features/config_file#examples).
20 |
21 | If you have any feedback about how we should support multiple usage files with Terragrunt in the future, please [comment on or follow this issue](https://github.com/infracost/infracost/issues/934).
22 |
23 | ## Source map
24 |
25 | The `INFRACOST_TERRAFORM_SOURCE_MAP` environment variable is useful when you want to replace module URLs used by Infracost (e.g. replace private URLs with public ones). See [this docs section](/docs/features/terraform_modules/#source-map) for more details.
26 |
27 | ## How the Terragrunt integration works
28 |
29 | With v0.10, when the CLI's `--path` flag points to a Terragrunt directory:
30 | 1. Infracost detects a Terragrunt project by checking for a Terragrunt config file in the specified path, which will be `terragrunt.hcl`, `terragrunt.hcl.json` or the value of the `TERRAGRUNT_CONFIG` environment variable. If Infracost does not detect your project as a Terragrunt project, make sure this file exists in the specified path or in any of the subdirectories with a depth less than 5.
31 |
32 | 2. If Terragrunt is detected, Infracost downloads any required source files to an `.infracost` cache, detects Terragrunt defined inputs, then parses HCL directly.
33 |
34 | 3. Infracost outputs a diff or breakdown for each Terragrunt module.
35 |
--------------------------------------------------------------------------------
/docs/features/vscode.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: vscode
3 | title: VS Code Extension
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | Use the [Infracost VS Code Extension](https://marketplace.visualstudio.com/items?itemName=Infracost.infracost) to see cost estimates for Terraform right in your editor! Prevent costly infrastructure changes before they get into production.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/infracost_cloud/api.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: api
3 | title: API
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | The Infracost Cloud API enables you to programmatically manage [tagging policies](/docs/infracost_cloud/tagging_policies) and [guardrails](/docs/infracost_cloud/guardrails). Large enterprises often use ServiceNow as the source of truth for their application names or service IDs. FinOps teams need resources to be tagged with the correct application/service values so showback reports can be created. Enterprises usually have thousands of applications, so it's easy to have typos, incorrect capital letters, dashes and hyphens mixed up in these values when engineers are writing infra-as-code. That creates a mess that FinOps teams have to deal with, and fixing typos isn't fun for any engineer.
9 |
10 | The best way to fix this problem is to address the root cause: validate the **tag values** when the code is being written. That is why we built this API, so enterprises can regularly push thousands of tag values to Infracost and it will automatically validate them in pull requests.
11 |
12 | This has two key benefits:
13 | 1. Engineers get the fastest-possible feedback loop, at the right time in the right place (engineering workflow). You can customize the message engineers see, for example, "The application ID isn't valid, please ensure your application is registered at https://services.acme-inc.com/list".
14 | 2. FinOps teams to see the percentage of resources that are tagged with correct values, and guess what, it automatically improves over time! No more chasing engineers and creating Jira tasks for this mundane stuff.
15 |
16 | The API also allows you to manage guardrails, which enable you to define cost thresholds for your infrastructure. When costs exceed these thresholds, Infracost can notify stakeholders, add comments to pull requests, or even block PRs from being merged. This helps teams control cloud costs by making engineers aware of potential cost issues before changes are deployed.
17 |
18 | ## Usage
19 |
20 | 1. Log in to [Infracost Cloud](https://dashboard.infracost.io) and go to Org Settings > API tokens > Create service account. Creating a service account will generate an associated token, which can be used to authenticate API requests (note that the CLI token cannot be used with the API).
21 | 2. View the [API docs](https://api.infracost.io/v1/docs/) to see how you can create, read, update or delete tagging policies and guardrails. You will also need your Org slug to use the API, this is available from the Org Settings > General page.
22 | 3. For example, to update a tagging policy with a list of values:
23 | - Create a JSON file, tags.json, as follows:
24 | ```sh
25 | {
26 | "data": {
27 | "attributes": {
28 | "tags": [
29 | {
30 | "key": "app_id",
31 | "mandatory": true,
32 | "valueType": "LIST",
33 | "allowedValues": [
34 | "app1",
35 | "app2",
36 | "app3",
37 | "app4",
38 | "app5"
39 | ]
40 | }
41 | ]
42 | }
43 | }
44 | }
45 | ```
46 | - In Infracost Cloud, go to Governance > Tagging policies > my-policy, and note the ID at the end of the URL, for example, "e17b9d51-151d-4855-a17e-6349e485584c".
47 | - Use `curl` or any programming language to call the API:
48 | ```sh
49 | curl -X PATCH \
50 | -H "Authorization: Bearer $MY_TOKEN" \
51 | -H "Content-Type: application/json" \
52 | --data @tags.json \
53 | https://api.infracost.io/v1/orgs/MY_ORG/tagging-policies/e17b9d51-151d-4855-a17e-6349e485584c
54 | ```
55 |
56 | 4. Similarly, to create a cost guardrail:
57 | - Create a JSON file, guardrail.json, as follows:
58 | ```sh
59 | {
60 | "data": {
61 | "type": "guardrails",
62 | "attributes": {
63 | "name": "Production Cost Limit",
64 | "scope": "PULL_REQUEST",
65 | "increaseThreshold": 100,
66 | "message": "This PR would increase monthly costs by more than $100. Please review and get approval.",
67 | "webhookUrl": "https://example.com/webhook",
68 | "prComment": true,
69 | "blockPr": false,
70 | "filters": {
71 | "repos": {
72 | "include": ["production-infra"],
73 | "exclude": []
74 | }
75 | }
76 | }
77 | }
78 | }
79 | ```
80 | - Use `curl` or any programming language to call the API:
81 | ```sh
82 | curl -X POST \
83 | -H "Authorization: Bearer $MY_TOKEN" \
84 | -H "Content-Type: application/json" \
85 | --data @guardrail.json \
86 | https://api.infracost.io/v1/orgs/MY_ORG/guardrails
87 | ```
88 |
--------------------------------------------------------------------------------
/docs/infracost_cloud/custom_price_books.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: custom_price_books
3 | title: Custom price books
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | The Infracost CLI uses public prices by default. Infracost Cloud users can apply enterprise discounts and custom price books to customize their prices.
9 |
10 | ## Enterprise discounts
11 |
12 | Many organizations that have significant cloud spend get enterprise discounts from cloud vendors such as:
13 | - AWS Enterprise Discount Program (EDP)
14 | - Azure Prepayment, also known as Azure Monetary Commitment. These are part of Azure Enterprise Agreements
15 | - Google Commitment Agreement
16 |
17 | You can apply these discounts in Infracost Cloud:
18 | 1. Go to [Infracost Cloud](https://dashboard.infracost.io) to sign up or log in.
19 | 2. Switch to the desired organization and go to Org Settings > Custom price books page.
20 | 3. Define the percentage discounts that should be applied for AWS, Azure and Google and click Save:
21 |
22 |
23 | ### How it works
24 | - All **new** cost estimates (CLI outputs, pull requests and Infracost Cloud estimates) for your organization will apply the discount going forward.
25 | - Older cost estimates will not be changed. There is currently no way to distinguish between the older cost estimates and ones that have a discount.
26 | - The discount will also be applied to usage-based resources such as AWS Lambda or S3 **prices**, even if there is no [usage file](/docs/features/usage_based_resources/).
27 |
28 | ## Custom price books
29 |
30 | We can also apply SKU-level custom cloud pricing to your Infracost Cloud organization. Please [contact us](mailto:support@infracost.io) to set this up. We would need details of the services or SKUs that you'd like to customize. For example, AWS customers can get this information in the Cost & Usage Reports, and Azure customers can use the [Price Sheet CSV export](https://learn.microsoft.com/en-us/azure/cost-management-billing/manage/ea-pricing?wt.mc_id=searchAPI_azureportal_inproduct_rmskilling&sessionId=e5ed2c1e32b5482c8c7c9a1ecf3b13b2#download-pricing-for-an-enterprise-agreement).
31 |
32 | ## Reserved Instances and Savings Plans
33 |
34 | For cost estimation purposes, engineers often prefer a simple price point that they can use in their calculations and when making design decisions. Reserved Instances (RIs) and Savings Plans (SPs) complicate this due to the dynamic nature of their discounts, which is applied after resources are launched. Companies usually manage this by having:
35 | - Central FinOps teams often change RIs and SPs regularly to match instance usage.
36 | - Engineers compare like-for-like using on-demand prices; FinOps team ensures maximum savings of RIs/SPs; Engineers ship fast.
37 | - Engineers use consistent number & make upfront design decisions quickly.
38 | - Custom price books include main discounts already.
39 |
40 | Showing engineers on-demand prices means that only the FinOps team is changing things, vs engineers also trying to second-guess the RI/SP discount allocation.
41 |
42 | However, some companies prefer to use "blended rate" of resources, which combines on-demand and discounted prices into one price point. The blended rate is shown in cloud vendor Cost and Usage Reports (e.g. AWS CUR) and we can import them into your Infracost Cloud organization so they can be used instead of on-demand prices.
43 |
44 | Please [contact us](mailto:support@infracost.io) to discuss what works best for your organization.
45 |
--------------------------------------------------------------------------------
/docs/infracost_cloud/engineer_guide.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: engineer_guide
3 | title: Engineer guide
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | This page is for engineers seeing Infracost pull request comments for the first time. It provides an overview of Infracost and what to do next.
9 |
10 | ### 1. What is Infracost?
11 | Infracost ensures your Terraform code changes follow your organization's tagging and FinOps policies **before deployment** (shift left). This helps you adopt FinOps best practices from the start, avoiding the need for time-consuming corrections later. This also prevents money from being wasted in the cloud. Cost estimates shown by Infracost are based on your custom cloud pricing.
12 |
13 | ### 2. What should I do when I see Infracost comments in pull requests?
14 | You should review the Infracost pull request comment and push commits to fix issues before you merge the pull request. See an example below, notice how this pull request is not following two FinOps best practices, and is also missing the important "component" tag.
15 |
16 |
17 |
18 | ### 3. What if I can't fix it or don't have time just now?
19 | First fix any issues you can. Then you can add a pull request comment with `@infracost help` to get more information on how to dismiss or snooze remaining issues.
20 |
21 |
22 |
23 | ### 4. How can I see all issues for my repos?
24 | You can see all issues from Infracost Cloud dashboard:
25 | 1. Go to https://dashboard.infracost.io
26 | 2. Just enter using your company email address (leave the password empty) and click on Log In. You will be redirected to login with SSO. If you do not get redirected to SSO, that means your company has not enabled SSO and you need to be invited to the account so please reach out to your FinOps lead or engineering management.
27 |
28 |
29 | 3. From the organization selector in the top menu, select your organization.
30 | 4. In the top menu, click on Visibility > Repos, and search for your repo name. If you cannot see your repo, reach out to your FinOps lead or engineering management to add the repo as that requires Admin access to Infracost.
31 | 5. Click on the repo to see all FinOps and tagging issues.
32 | 6. You can also download a CSV of all current issues on the repo base branches (e.g. master or main) and filter or group things in Excel:
33 | - To download a CSV of all tagging issues, from the top menu, goto Governance > Tagging policies > Export CSV.
34 | - To download a CSV of all FinOps issues, from the top menu, goto Governance > FinOps policies > Export CSV.
35 |
--------------------------------------------------------------------------------
/docs/infracost_cloud/key_concepts.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: key_concepts
3 | title: Key concepts
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | ## Authentication
9 |
10 | Infracost Cloud supports logging in via [GitHub](/docs/faq/#can-i-log-in-with-github), Google, an email/password, or [enterprise SSO providers](/docs/infracost_cloud/sso/overview).
11 |
12 | 1. Go to [Infracost Cloud](https://dashboard.infracost.io) to sign up or log in.
13 | 2. Switch to the desired organization. Every Infracost user has a default organization for personal use. You should create a new organization for your company using the organization dropdown at the top of the page.
14 | 3. Follow the onboarding steps in the dashboard.
15 |
16 | If you signed up using an email/password, you can change your password by logging out and clicking on "Don't remember your password?".
17 |
18 | Email addresses are unique in Infracost Cloud. Thus when you log in with GitHub, Google or an email/password, if the email associated with the login is the same as a previous login, you will have to link the accounts together in Infracost, so you can log in using either method.
19 |
20 | ## Organizations
21 |
22 | In Infracost Cloud, organizations are used to group repos, policies and other associated settings.
23 |
24 | ## Team management
25 |
26 | From the Org Settings > Members page, you can invite your team members to join your organization. Currently these roles are supported:
27 | - **Org Owner**: they have complete control over the organization. We recommend giving the main billing contact the owner role. From the Members page, the owner can transfer this role to another member. Only the owner can delete the organization or change its name or slug.
28 | - **Org Admin**: they can do everything except deleting the organization, or changing its name or slug. We recommend giving FinOps/Platform team members the admin role so they can setup integrations for everyone, manage users, custom price books, and configure other Org Settings.
29 | - **Org Editor**: they can change everything except Org Settings and data exports. This means they cannot invite members to the organization either. They can view everything except the following Org Settings: API keys, Members, Plan and billing, Custom price books, Integrations. We recommend giving team leads/managers the editor role so they can also add guardrails, policies and reports for their teams if required.
30 | - **Org Viewer**: they can view everything except the following Org Settings: API keys, Members, Plan and billing, Custom price books, Integrations. They cannot make any changes apart from their personal user settings such as their password or multi-factor-authentication setup. We recommend giving engineers the viewer role so they can see preexisting issues and fix them.
31 |
32 | ## Repos
33 |
34 | Repos, short for code repositories, is where your code lives in GitHub, Azure Repos, GitLab or any other source control system. A repo contains one or more projects. Infracost Cloud lets you track how the costs and policy issues of repos and projects change over time.
35 |
36 | ## Projects
37 |
38 | Projects map to repo sub-groups. The majority of Infracost users will have repos that have many projects, these include:
39 | - code paths for mono repos, each path represents a deployment environment such as dev, stage, prod
40 | - workspaces, same idea as above but done using Terraform var files or workspaces
41 | - Terraform or Terragrunt modules, which are components of a repo, e.g. core-api or data-stack
42 |
43 | Infracost auto-generates project names based on code paths, workspaces or Terraform/Terragrunt modules. The name appears in the CLI output and pull request comments and Infracost Cloud as shown below. If Infracost cannot detect your projects, or if you would like to customize them, we recommend using a [**config file**](/docs/features/config_file/).
44 |
45 |
46 |
47 | ---
48 |
49 |
50 |
51 | ---
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/docs/infracost_cloud/readme_badge.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: readme_badge
3 | title: Readme badge
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | Add a cost badge in your repository `README.md` files to enable engineers to see the repo's latest cost estimate quickly. This is specially useful for Terraform module repos where a central platform team creates re-usable modules for development teams, who are often unaware of the costs of those modules.
9 |
10 |
11 |
12 | ## Usage
13 |
14 | Cost badges require the cost estimate to be stored in Infracost Cloud so your repository `README.md` file can fetch the badge from it.
15 |
16 | 1. Follow the [GitHub Apps](/docs/integrations/github_app) integrations page to setup your repo in Infracost Cloud.
17 |
18 | 2. In Infracost Cloud, go to Repos > Settings.
19 |
20 | 3. Select the branch and project that the badge should represent. The branch should normally be your main or master branch, and you can select "All projects" if the badge should show a sum of all projects in the repository. For Terraform module repos, where there are no projects, use the "All projects" option.
21 |
22 |
23 |
24 | The badge token is unique and associated with your Infracost Cloud organization. It only has access to the latest cost estimate for your repositories and nothing else, thus it is safe to be added to your `README.md` files.
25 |
26 | 4. Copy the Markdown or HTML code snippet and add it to the top of your `README.md` file, commit and push your change to your repository.
27 |
28 | The cost badge will automatically show the latest cost estimate from your desired branch and projects.
29 |
--------------------------------------------------------------------------------
/docs/infracost_cloud/reports.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: reports
3 | title: Reports
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | All Infracost Cloud users get a weekly email summarizing the main changes across all repos in their organization. This email shows the most impactful changes across repos, projects, pull requests and users.
9 |
10 | ### Usage
11 |
12 | Log in to [Infracost Cloud](https://dashboard.infracost.io) and go to Reports > Email reports to create reports. When creating a report, you can filter on specific repositories, and select the report frequency (daily, weekly, monthly). You can also select which users should get the reports as shown below. Only merged pull requests are included in reports.
13 |
14 |
15 |
16 | ### Example report email
17 |
18 | The following screenshot shows an example email report.
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/docs/integrations/cicd.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | slug: cicd
3 | title: Add to CI/CD
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 | import Tabs from '@theme/Tabs';
8 | import TabItem from '@theme/TabItem';
9 |
10 | export const Grid = ({logos}) => {
11 | const items = logos.map((e, i) => {
12 | return ()
13 | })
14 | return (
15 |
)}
37 |
38 | )
39 |
40 | Use one of our many integrations so your engineering team can see cost estimates and FinOps best practices in pull requests **before making changes**. This provides your team with a safety net as people can discuss FinOps as part of the workflow.
41 |
42 |
43 |
44 | If you run into any issues, please join our [community Slack channel](https://www.infracost.io/community-chat), we'll help you very quickly 😄
45 |
46 | ## Source control integrations (recommended)
47 |
48 | Infracost supports direct integration with GitHub and GitLab. We recommend these integrations as they are much simpler to setup and faster to run.
49 |
50 |
70 |
71 | ## CI/CD integrations
72 |
73 | The following integrations can also be used to post pull request comments.
74 |
75 |
107 |
108 |
109 |
110 | For other CI/CD systems, the GitLab CI integration above is a good example to follow. Please [email us](mailto:support@infracost.io) if you need help. We maintain the [`infracost/infracost:ci-0.10`](https://hub.docker.com/r/infracost/infracost/tags) Docker image that can be used in other CI/CD integrations. This uses the latest patch version of 0.10 to pick up bug fixes and new resources.
111 |
112 | To test the bleeding edge version (not recommended for production deployments), use the [`infracost/infracost:ci-edge`](https://hub.docker.com/r/infracost/infracost/tags) image or the [preview build](https://github.com/infracost/infracost/releases/tag/preview).
113 |
--------------------------------------------------------------------------------
/docs/integrations/cicd_integrations.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: cicd_integrations
3 | title: CI/CD integrations
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | Infracost can be integrated into any CI/CD system, see the [integrations page](/docs/integrations/cicd/#cicd-integrations) for details.
9 |
--------------------------------------------------------------------------------
/docs/integrations/slack.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: slack
3 | title: Slack
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | Infracost Cloud [Guardrails](/docs/infracost_cloud/guardrails/) have native support for Slack notifications that trigger when your defined thresholds are exceeded. If you are not using that feature, you can post cost estimates to Slack by following these steps in your CI/CD system:
9 |
10 | 1. Create a [Slack Webhook](https://api.slack.com/messaging/webhooks) in your workspace.
11 | 2. Use the `infracost output --format slack-message` [command](/docs/features/cli_commands/) to produce a Slack-flavored Markdown message. Slack message blocks have a 3000 char limit so the Infracost CLI automatically truncates the middle of the `slack-message` output format if required.
12 | 3. Post the message to Slack using `curl` from your CI/CD system. See [this example](https://gitlab.com/infracost/infracost-gitlab-ci/-/tree/master/examples/slack) for how to do this in GitLab, the same bash commands can be used in other systems.
13 |
14 | If you run into any issues, please join our [community Slack channel](https://www.infracost.io/community-chat), we'll help you very quickly 😄
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/integrations/third_party_integrations.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: third_party_integrations
3 | title: Third-party integrations
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | Infracost can be used in the following third-party systems. You should only consider using them if you cannot use our [CI/CD integrations](/docs/integrations/cicd/) as these integrations are very minimal, do not post pull request comments nor do they work with other Infracost Cloud features such as [FinOps policies](/docs/infracost_cloud/finops_policies/), [Tagging policies](/docs/infracost_cloud/tagging_policies/) or [Guardrails](/docs/infracost_cloud/guardrails/).
9 |
10 | - [Terraform Cloud/Enterprise Run Tasks](/docs/integrations/terraform_cloud_enterprise/)
11 | - [Scalr](https://docs.scalr.com/en/latest/cost_estimate.html)
12 | - [Spacelift](https://docs.spacelift.io/vendors/terraform/infracost)
13 | - [Env0](https://docs.env0.com/docs/cost-monitoring#cost-estimation)
14 | - [Harness Infrastructure as Code Management](https://www.harness.io/products/infrastructure-as-code-management)
15 | - [Terrateam](https://docs.terrateam.io/integrations/infracost)
16 | - [Terraspace](https://terraspace.cloud/docs/cloud/cost-estimation)
17 | - [Terranetes](https://terranetes.appvia.io/terranetes-controller/admin/costs)
18 | - [Terrakube](https://docs.terrakube.io/user-guide/cost-estimation)
19 | - [Keptn](https://artifacthub.io/packages/keptn/keptn-integrations/infracost)
20 | - [Brainboard](https://docs.brainboard.co/ci-cd-engine/supported-plugins#cost-estimation)
21 | - [Semaphore](https://docs.semaphoreci.com/examples/estimating-cloud-costs-with-infracost/)
22 | - [cloud-concierge](https://docs.cloudconcierge.io/how-it-works/pull-request-output#resource-cost-calculations)
23 |
24 | ## Creating an integration
25 |
26 | Please follow these steps when creating a third-party integration with Infracost:
27 | 1. **User-specific API keys**: ask your users to sign up for their own free Infracost API key and enter that into your product's settings page. This approach is used by our partners, including HashiCorp, as it enables users to use custom price books and other user-specific Infracost features. Your docs should mention something like:
28 | - [Sign up](https://dashboard.infracost.io) and go to the Org Settings page to get your free Infracost API key.
29 | - [Install Infracost](/docs/#2-get-api-key) to get your free API key.
30 | 2. **Use Terraform directory method**: we recommend you run Infracost against a [Terraform directory](/docs/features/cli_commands/#option-1-terraform-directory) (as opposed to a Terraform plan JSON file) as that is faster and does not require you to set cloud credentials or secrets.
31 | 3. **CLI JSON format**: Infracost's CLI has a [JSON format](/docs/features/cli_commands/#examples) that you should use, e.g. get total cost estimate. We do not have language-specific clients so your application needs to run the Infracost CLI. You can also use [this API](/docs/integrations/infracost_api/) if you have a Terraform plan JSON file already.
32 | 4. **Email us**: Our email is [support@infracost.io](mailto:support@infracost.io), contact us if you need help or advice on the best ways to integrate, or would like to be featured in this page!
33 |
--------------------------------------------------------------------------------
/docs/support.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: /support
3 | title: Support
4 | ---
5 |
6 | If you need help using Infracost, please email us at [support@infracost.io](mailto:support@infracost.io). Check [our status page](https://status.infracost.io) for updates on any service disruptions affecting our hosted services.
7 |
8 | If you're an engineer seeing Infracost pull request comments for the first time, visit [Engineer guide](/docs/infracost_cloud/engineer_guide/) for an overview of Infracost and what to do next.
9 |
10 | For community support, please join our [community Slack channel](https://www.infracost.io/community-chat). If you notice a CLI bug, please first [upgrade](/#installation) to the latest version of `infracost` to see if the bug has already been fixed. If not, [create an issue](https://github.com/infracost/infracost/issues/new/choose). Please use the `--debug-report` and include the `infracost-debug-report.json` file in your issue.
11 |
--------------------------------------------------------------------------------
/docs/supported_resources/overview.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: overview
3 | title: Overview
4 | ---
5 |
6 | Infracost supports over **1,100** Terraform resources across [AWS](/docs/supported_resources/aws), [Azure](/docs/supported_resources/azure) and [Google](/docs/supported_resources/google). That number is growing fast thanks to our [large open source community](https://github.com/infracost/infracost/#community-and-contributing) of contributors.
7 |
8 | The quickest way to find out if your Terraform resources are supported is to run [`infracost breakdown`](/#usage) with the `--show-skipped` flag. This shows the unsupported resources at the bottom of the output.
9 |
10 | You can also run the following command to see only the unsupported resources:
11 | `infracost breakdown --path . --format=json | jq ".summary.unsupportedResourceCounts"`
12 |
13 | ### The resource I want isn't supported
14 |
15 | We regularly add support for new resources so we recommend watching our repo for releases: Go to the [repo](https://github.com/infracost/infracost) page, click on the Watch button > select Custom > Releases and click on Apply.
16 |
17 | You can help by:
18 | 1. [Creating an issue](https://github.com/infracost/infracost/issues/new/choose) and mentioning the resource names you need; we'll try to prioritize it depending on community feedback.
19 | 2. [Contributing to Infracost](https://github.com/infracost/infracost#contributing). You can join our [community Slack channel](https://www.infracost.io/community-chat) if you need help contributing.
20 |
21 | We plan to add support for other IaC tools such as [Pulumi](https://github.com/infracost/infracost/issues/187), [AWS CloudFormation/CDK](https://github.com/infracost/infracost/issues/190), and [Azure ARM/Bicep](https://github.com/infracost/infracost/issues/812). Please 👍 them if you'd like us to work on them sooner.
22 |
23 | ### My cost estimate looks wrong
24 |
25 | Please [create an issue](https://github.com/infracost/infracost/issues/new/choose) and provide the Terraform resource code that can be used to reproduce the issue. If possible, please also include any relevant billing data from the cloud vendor that might help us troubleshoot.
26 |
--------------------------------------------------------------------------------
/docs/troubleshooting.md:
--------------------------------------------------------------------------------
1 | ---
2 | slug: troubleshooting
3 | title: CI/CD troubleshooting
4 | ---
5 |
6 | import useBaseUrl from '@docusaurus/useBaseUrl';
7 |
8 | This page describes steps you can follow to troubleshoot [CI/CD integrations](/docs/integrations/cicd/#cicd-integrations). [Contact us](/docs/support/) if you're having problems with [source control integrations](/docs/integrations/cicd/#source-control-integrations-recommended).
9 |
10 | ## 1. Enable additional logging
11 |
12 | If the Infracost CLI fails, re-run it with `--log-level=debug` or the `INFRACOST_LOG_LEVEL=debug` environment variable in case that provides helpful details.
13 |
14 | If the Terraform CLI fails, check their [debugging page](https://www.terraform.io/internals/debugging) for help. Likewise, if the Terragrunt CLI fails, check their [debugging page](https://terragrunt.gruntwork.io/docs/features/debugging/) for help.
15 |
16 | ## 2. Generating plan JSON files
17 |
18 | By default, the Infracost CLI parses Terraform HCL code to estimate costs. If that does not work for your use-case, Infracost can also parse the Terraform/Terragrunt [plan JSON file](/docs/features/cli_commands/#option-2-terraform-plan-json).
19 |
20 | If you have multiple Terraform plan JSON files, you can
21 | 1. run [`infracost breakdown`](/docs/features/cli_commands/#breakdown) with `--path plan-1.json --format json --out-file infracost-1.json` to generate an Infracost JSON file for each.
22 | 2. run [`infracost output`](/docs/features/cli_commands/#combined-output-formats) with `--path "infracost-*.json" --format diff` (glob patterns need quotes) to combine the Infracost JSON files into one output format then use that file with `infracost comment`. The `infracost output --help` command shows the other options.
23 |
24 | ## 3. Check supported versions
25 |
26 | Check the Terraform version matches what you expect. Infracost works with Terraform v0.12 and above.
27 | Use `ls -lah` in the CI build to check for any `.terraform*` files/folders that might be confusing Terraform running in CI vs previous runs that were used to create them. Removing those files might help.
28 |
29 | ## 4. Posting comments
30 |
31 | If you're having issues posting pull request comments, please review the troubleshooting section for your version control system:
32 |
33 | - [GitHub](https://github.com/infracost/actions/#permissions-issue)
34 | - [GitLab](https://gitlab.com/infracost/infracost-gitlab-ci#troubleshooting)
35 | - [Azure Repos](https://github.com/infracost/infracost-azure-devops#troubleshooting)
36 | - [Bitbucket](https://bitbucket.org/infracost/infracost-bitbucket-pipeline) > see the Troubleshooting section
37 |
38 | ## 5. Infracost Cloud dashboard
39 |
40 | If your pull request comments are being posted but they are **not showing in the dashboard**, ensure that the:
41 | 1. In Infracost Cloud's Org settings page, the cost estimate dashboard is enabled.
42 | 2. Infracost CLI version (`infracost --version`) being used is latest patch version of v0.10.
43 | 3. [Required environment variables](/docs/features/environment_variables/#environment-variables-to-set-metadata) are set before the `infracost breakdown` and `infracost diff` commands are run. You can verify this by running `cat infracost.json | jq .metadata` or `infracost breakdown --path /code --format json | jq .metadata` and checking the Infracost JSON block shows your pull request metadata.
44 | 4. Either [`infracost comment`](/docs/features/cli_commands/#comment-on-pull-requests) or [`infracost upload`](/docs/features/cli_commands/#upload-runs) is used in your CI/CD integration. If Infracost Cloud is enabled (step 1 above), these commands send the Infracost JSON data to your organization in Infracost Cloud.
45 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "infracost-docs",
3 | "version": "0.0.0",
4 | "private": true,
5 | "scripts": {
6 | "docusaurus": "docusaurus",
7 | "start": "docusaurus start",
8 | "build": "docusaurus build",
9 | "swizzle": "docusaurus swizzle",
10 | "deploy": "docusaurus deploy",
11 | "serve": "docusaurus serve",
12 | "svgo": "svgo ./static/**/*.svg",
13 | "lint": "eslint --ext .ts,.js,.tsx,.jsx --ignore-path .eslintignore --ignore-path .gitignore . --max-warnings=0",
14 | "lintfix": "eslint --fix --ext .ts,.js,.tsx,.jsx --ignore-path .eslintignore --ignore-path .gitignore .",
15 | "format": "prettier --write 'src/**/*.{js,ts,jsx,tsx}'",
16 | "format:check": "prettier --check 'src/**/*.{js,ts,jsx,tsx}'"
17 | },
18 | "dependencies": {
19 | "@docusaurus/core": "^2.4.1",
20 | "@docusaurus/mdx-loader": "^2.4.1",
21 | "@docusaurus/plugin-client-redirects": "^2.4.1",
22 | "@docusaurus/plugin-google-gtag": "^2.4.1",
23 | "@docusaurus/plugin-google-tag-manager": "^2.4.1",
24 | "@docusaurus/preset-classic": "^2.4.1",
25 | "@docusaurus/theme-classic": "^2.4.1",
26 | "@docusaurus/theme-common": "^2.4.1",
27 | "@headlessui/react": "^1.7.16",
28 | "@mdx-js/react": "^1.6.17",
29 | "@react-spring/parallax": "^9.7.3",
30 | "@react-spring/web": "^9.7.3",
31 | "clsx": "^1.1.1",
32 | "docusaurus-plugin-plausible": "0.0.5",
33 | "dotenv": "^16.3.1",
34 | "fuse.js": "^6.6.2",
35 | "prettier": "^2.2.1",
36 | "prism-react-renderer": "^1.3.5",
37 | "react": "^16.8.4",
38 | "react-dom": "^16.8.4",
39 | "react-helmet-async": "^1.3.0",
40 | "react-markdown": "^8.0.7"
41 | },
42 | "browserslist": {
43 | "production": [
44 | ">0.2%",
45 | "not dead",
46 | "not op_mini all"
47 | ],
48 | "development": [
49 | "last 1 chrome version",
50 | "last 1 firefox version",
51 | "last 1 safari version"
52 | ]
53 | },
54 | "devDependencies": {
55 | "@babel/eslint-parser": "^7.5.4",
56 | "eslint": "^8.46.0",
57 | "eslint-config-airbnb-base": "^15.0.0",
58 | "eslint-config-prettier": "^8.10.0",
59 | "eslint-config-react-app": "^7.0.1",
60 | "eslint-plugin-import": "^2.28.0",
61 | "eslint-plugin-prettier": "^4.2.1",
62 | "svgo": "^3.0.1"
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/sidebars.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | someSidebar: [
3 | {
4 | type: 'doc',
5 | id: 'getting_started',
6 | },
7 | {
8 | type: 'doc',
9 | id: 'integrations/cicd',
10 | },
11 | {
12 | type: 'category',
13 | label: 'Open source features',
14 | collapsed: false,
15 | items: [
16 | 'features/cli_commands',
17 | 'features/usage_based_resources',
18 | 'features/config_file',
19 | 'features/vscode',
20 | 'features/terraform_modules',
21 | 'features/terragrunt',
22 | 'features/environment_variables',
23 | ],
24 | },
25 | {
26 | type: 'category',
27 | label: 'Infracost Cloud features',
28 | collapsed: false,
29 | items: [
30 | 'infracost_cloud/get_started',
31 | 'infracost_cloud/finops_policies',
32 | 'infracost_cloud/tagging_policies',
33 | 'infracost_cloud/guardrails',
34 | 'infracost_cloud/jira_integration',
35 | 'infracost_cloud/reports',
36 | 'infracost_cloud/data_export',
37 | 'infracost_cloud/api',
38 | 'infracost_cloud/sso',
39 | 'infracost_cloud/custom_price_books',
40 | 'infracost_cloud/readme_badge',
41 | 'infracost_cloud/key_concepts',
42 | 'infracost_cloud/engineer_guide',
43 | ],
44 | },
45 | {
46 | type: 'category',
47 | label: 'Integrations',
48 | collapsed: true,
49 | items: [
50 | 'integrations/github_app',
51 | 'integrations/azure_repos_app',
52 | 'integrations/gitlab_app',
53 | 'integrations/cicd_integrations',
54 | 'integrations/slack',
55 | 'integrations/spacelift',
56 | 'integrations/terraform_cloud_enterprise',
57 | 'integrations/open_policy_agent',
58 | 'integrations/infracost_api',
59 | 'integrations/third_party_integrations',
60 | ],
61 | },
62 | {
63 | type: 'category',
64 | label: 'Supported clouds',
65 | collapsed: true,
66 | items: [
67 | `supported_resources/overview`,
68 | 'supported_resources/aws',
69 | 'supported_resources/azure',
70 | 'supported_resources/google',
71 | 'supported_resources/cloud_pricing_api',
72 | ],
73 | },
74 | {
75 | type: 'doc',
76 | id: 'faq',
77 | },
78 | {
79 | type: 'doc',
80 | id: 'troubleshooting',
81 | },
82 | {
83 | type: 'doc',
84 | id: 'support',
85 | },
86 | ]
87 | };
88 |
--------------------------------------------------------------------------------
/src/components/CTA.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | function CTA() {
4 | return (
5 |