Skip to content

Commit 11495d5

Browse files
committed
fix: links and syntax highlighting
1 parent d16c682 commit 11495d5

12 files changed

+394
-389
lines changed

docs/features/cli_commands.mdx

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Infracost has multiple commands, all of which support `--help`:
1313

1414
- [`infracost breakdown`](#breakdown): Show breakdown of costs, can also be used to generate a baseline
1515
- [`infracost diff`](#diff): Show diff of monthly costs between current branch and baseline
16-
- [`infracost generate config`](#generate-config): Generate Infracost config file from a template file
16+
- [`infracost generate config`](/docs/features/config_file): Generate Infracost config file from a template file
1717

1818
- The following commands work with the Infracost JSON output, which is generated via `infracost diff --format json`:
1919

@@ -101,13 +101,15 @@ infracost breakdown --path . --format json --out-file infracost-base.json
101101
```
102102

103103
{' '}
104+
104105
<li>Edit your Terraform project:</li>
105106

106107
```shell
107108
vim main.tf
108109
```
109110

110111
{' '}
112+
111113
<li>Generate a diff by comparing the latest code change with the baseline:</li>
112114

113115
```shell

docs/features/config_file.mdx

+148-145
Original file line numberDiff line numberDiff line change
@@ -246,162 +246,165 @@ Example folder structure:
246246
The following table shows the parameters each `project` can have in the config file:
247247

248248
<table>
249-
<tr>
250-
<th>Parameter</th>
251-
<th>Description</th>
252-
</tr>
253-
<tr>
254-
<td>
255-
<code>path</code>
256-
</td>
257-
<td>
258-
Required. String. Path to the Terraform directory. The path is relative to the working
259-
directory you run <code>infracost</code> from. A path can be repeated with different
260-
parameters, e.g. for multiple Terraform var files.
261-
</td>
262-
</tr>
263-
<tr>
264-
<td>
265-
<code>name</code>
266-
</td>
267-
<td>
268-
Optional. String. Defaults to code path, workspace or Terraform/Terragrunt module within a
269-
repo. Name of project to use in all outputs (pull request comment, Infracost Cloud and CLI).
270-
</td>
271-
</tr>
272-
<tr>
273-
<td>
274-
<code>terraform_var_files</code>
275-
</td>
276-
<td>
277-
Optional. Array of string. Variable files to use when parsing Terraform HCL code, similar to
278-
Terraform's <code>-var-file</code> flag. Files with the <code>.auto.tfvars</code> extension do
279-
not need to be added to the list as they are processed automatically by Infracost. The file
280-
paths are relative to the <code>path</code> of the project. For example:
281-
<pre>
282-
{`terraform_var_files:
249+
<tbody>
250+
<tr>
251+
<th>Parameter</th>
252+
<th>Description</th>
253+
</tr>
254+
<tr>
255+
<td>
256+
<code>path</code>
257+
</td>
258+
<td>
259+
Required. String. Path to the Terraform directory. The path is relative to the working
260+
directory you run <code>infracost</code> from. A path can be repeated with different
261+
parameters, e.g. for multiple Terraform var files.
262+
</td>
263+
</tr>
264+
<tr>
265+
<td>
266+
<code>name</code>
267+
</td>
268+
<td>
269+
Optional. String. Defaults to code path, workspace or Terraform/Terragrunt module within a
270+
repo. Name of project to use in all outputs (pull request comment, Infracost Cloud and CLI).
271+
</td>
272+
</tr>
273+
<tr>
274+
<td>
275+
<code>terraform_var_files</code>
276+
</td>
277+
<td>
278+
Optional. Array of string. Variable files to use when parsing Terraform HCL code, similar to
279+
Terraform's <code>-var-file</code> flag. Files with the <code>.auto.tfvars</code> extension
280+
do not need to be added to the list as they are processed automatically by Infracost. The
281+
file paths are relative to the <code>path</code> of the project. For example:
282+
<pre>
283+
{`terraform_var_files:
283284
- global.tfvars
284285
- dev.tfvars`}
285-
</pre>
286-
</td>
287-
</tr>
288-
<tr>
289-
<td>
290-
<code>terraform_vars</code>
291-
</td>
292-
<td>
293-
Optional. Map of strings. Input variables to use when parsing the Terraform HCL code, similar
294-
to Terraform's <code>-var</code> flag. For example:
295-
<pre>
296-
{`terraform_vars:
286+
</pre>
287+
</td>
288+
</tr>
289+
<tr>
290+
<td>
291+
<code>terraform_vars</code>
292+
</td>
293+
<td>
294+
Optional. Map of strings. Input variables to use when parsing the Terraform HCL code,
295+
similar to Terraform's <code>-var</code> flag. For example:
296+
<pre>
297+
{`terraform_vars:
297298
instance_count: 5
298299
artifact_version: foobar`}
299-
</pre>
300-
</td>
301-
</tr>
302-
<tr>
303-
<td>
304-
<code>dependency_paths</code>
305-
</td>
306-
<td>
307-
Optional.{' '}
308-
<span style={{ textDecoration: 'underline' }}>
309-
Only applicable for GitHub App and GitLab App users
310-
</span>
311-
. Array of strings. Array of file or directory paths that should trigger project estimates. If
312-
this is specified, code changes to the <code>path</code> target will <b>NOT</b> trigger cost estimates
313-
unless the <code>path</code> is included in <code>dependency_paths</code>. All paths are relative
314-
to the working directory of your <code>infracost.yml</code> file. Supports glob patterns, for example:
315-
<pre>
316-
{`dependency_paths:
300+
</pre>
301+
</td>
302+
</tr>
303+
<tr>
304+
<td>
305+
<code>dependency_paths</code>
306+
</td>
307+
<td>
308+
Optional.{' '}
309+
<span style={{ textDecoration: 'underline' }}>
310+
Only applicable for GitHub App and GitLab App users
311+
</span>
312+
. Array of strings. Array of file or directory paths that should trigger project estimates.
313+
If this is specified, code changes to the <code>path</code> target will <b>NOT</b> trigger
314+
cost estimates unless the <code>path</code> is included in <code>dependency_paths</code>.
315+
All paths are relative to the working directory of your <code>infracost.yml</code> file.
316+
Supports glob patterns, for example:
317+
<pre>
318+
{`dependency_paths:
317319
- "config/**.json"
318320
- default.yml
319321
- "modules/**"`}
320-
</pre>
321-
</td>
322-
</tr>
323-
<tr>
324-
<td>
325-
<code>usage_file</code>
326-
</td>
327-
<td>
328-
Optional. String. Path to Infracost usage file that specifies values for{' '}
329-
<a href="/docs/features/usage_based_resources">usage based resources</a>. The path is relative
330-
to the working directory you run <code>infracost</code> from.
331-
</td>
332-
</tr>
333-
<tr>
334-
<td>
335-
<code>exclude_paths</code>
336-
</td>
337-
<td>
338-
Optional. Array of strings. Array of directory paths to exclude from evaluation, relative to{' '}
339-
<code>path</code> of project. Supports glob patterns too, for example:
340-
<pre>
341-
{`exclude_paths:
322+
</pre>
323+
</td>
324+
</tr>
325+
<tr>
326+
<td>
327+
<code>usage_file</code>
328+
</td>
329+
<td>
330+
Optional. String. Path to Infracost usage file that specifies values for{' '}
331+
<a href="/docs/features/usage_based_resources">usage based resources</a>. The path is
332+
relative to the working directory you run <code>infracost</code> from.
333+
</td>
334+
</tr>
335+
<tr>
336+
<td>
337+
<code>exclude_paths</code>
338+
</td>
339+
<td>
340+
Optional. Array of strings. Array of directory paths to exclude from evaluation, relative to{' '}
341+
<code>path</code> of project. Supports glob patterns too, for example:
342+
<pre>
343+
{`exclude_paths:
342344
- projects/myproject
343345
- "app/*/ignore_dir"`}
344-
</pre>
345-
</td>
346-
</tr>
347-
<tr>
348-
<td>
349-
<code>include_all_paths</code>
350-
</td>
351-
<td>
352-
Optional. Boolean. Defaults to false meaning that Infracost will autodetect only <b>root</b>{' '}
353-
Terraform modules. Setting this to true forces the autodetect function to estimate all
354-
directories (i.e. root and non-root modules) with valid project files, down to a max depth of
355-
10 directories.
356-
</td>
357-
</tr>
358-
<tr>
359-
<td>
360-
<code>env</code>
361-
</td>
362-
<td>
363-
Optional. Map of strings. Environment variables that are passed to the project during
364-
processing. Also supports referencing existing environment variables using the syntax{' '}
365-
<code>$&#123;MY_ENV_VAR&#125;</code>. Environment variables that start with{' '}
366-
<code>INFRACOST_</code> are global in scope (not per-project) and cannot be used inside this
367-
parameter. For example:
368-
<pre>
369-
{`env:
346+
</pre>
347+
</td>
348+
</tr>
349+
<tr>
350+
<td>
351+
<code>include_all_paths</code>
352+
</td>
353+
<td>
354+
Optional. Boolean. Defaults to false meaning that Infracost will autodetect only <b>root</b>{' '}
355+
Terraform modules. Setting this to true forces the autodetect function to estimate all
356+
directories (i.e. root and non-root modules) with valid project files, down to a max depth
357+
of 10 directories.
358+
</td>
359+
</tr>
360+
<tr>
361+
<td>
362+
<code>env</code>
363+
</td>
364+
<td>
365+
Optional. Map of strings. Environment variables that are passed to the project during
366+
processing. Also supports referencing existing environment variables using the syntax{' '}
367+
<code>$&#123;MY_ENV_VAR&#125;</code>. Environment variables that start with{' '}
368+
<code>INFRACOST_</code> are global in scope (not per-project) and cannot be used inside this
369+
parameter. For example:
370+
<pre>
371+
{`env:
370372
INSTANCE_TYPE: t3.large
371373
MY_ENV_KEY: $\{MY_SECRET_ENV_VAR\}`}
372-
</pre>
373-
</td>
374-
</tr>
375-
<tr>
376-
<td>
377-
<code>terraform_workspace</code>
378-
</td>
379-
<td>
380-
Optional. String. Used to set the Terraform workspace. Only set this for multi-workspace
381-
repos, otherwise it might result in the Terraform error "workspaces not supported".
382-
</td>
383-
</tr>
384-
<tr>
385-
<td>
386-
<code>terraform_cloud_workspace</code>
387-
</td>
388-
<td>
389-
Optional. String. For Terraform Cloud/Enterprise users. Used to set the Terraform Cloud
390-
workspace. Only set this if your local workspace name differs from your cloud workspace, and
391-
you do not already have a Terraform Cloud block defining the remote workspace name (e.g. using
392-
`prefix`).
393-
</td>
394-
</tr>
395-
<tr>
396-
<td>
397-
<code>terraform_cloud_org</code>
398-
</td>
399-
<td>
400-
Optional. String. For Terraform Cloud/Enterprise users. Used to set the Terraform Cloud
401-
organization. Only set this if you do not already have a Terraform Cloud block that defines
402-
your Terraform cloud organization name.
403-
</td>
404-
</tr>
374+
</pre>
375+
</td>
376+
</tr>
377+
<tr>
378+
<td>
379+
<code>terraform_workspace</code>
380+
</td>
381+
<td>
382+
Optional. String. Used to set the Terraform workspace. Only set this for multi-workspace
383+
repos, otherwise it might result in the Terraform error "workspaces not supported".
384+
</td>
385+
</tr>
386+
<tr>
387+
<td>
388+
<code>terraform_cloud_workspace</code>
389+
</td>
390+
<td>
391+
Optional. String. For Terraform Cloud/Enterprise users. Used to set the Terraform Cloud
392+
workspace. Only set this if your local workspace name differs from your cloud workspace, and
393+
you do not already have a Terraform Cloud block defining the remote workspace name (e.g.
394+
using `prefix`).
395+
</td>
396+
</tr>
397+
<tr>
398+
<td>
399+
<code>terraform_cloud_org</code>
400+
</td>
401+
<td>
402+
Optional. String. For Terraform Cloud/Enterprise users. Used to set the Terraform Cloud
403+
organization. Only set this if you do not already have a Terraform Cloud block that defines
404+
your Terraform cloud organization name.
405+
</td>
406+
</tr>
407+
</tbody>
405408
</table>
406409

407410
## Template syntax

0 commit comments

Comments
 (0)