Getting Started

If you have not yet installed VS Code, navigate to the VS Code website and install the latest version (v1.57.1 or higher).

Installing the CloudZero CostFormation Toolkit Extension

After VS Code is installed, you can install the CloudZero CostFormation Toolkit extension. Select the Extensions icon in VS Code and search the extension marketplace for CloudZero. Then, select Install.

1258

Connecting to the CloudZero Platform

For many of the features to work, you must be authenticated with the CloudZero platform and have an Organizer role for your organization. To log in, enter the VS Code command palette (โ‡งโŒ˜P/Ctrl-Shift-P) and select the command CloudZero: Authenticate With the CloudZero Platform.

2044

Your default browser opens the CloudZero login page, where you can enter your credentials.

Log in to CloudZero in your browser

After your credentials have been authenticated, you are redirected to a page indicating you have successfully logged in:

"Success! You have successfully logged into CloudZero. You can close this browser tab and return to VS Code."

You can close the page and return to VS Code, where you will see a notification confirming that you are logged in to CloudZero:

"CloudZero: You are logged in as {username}!"

Creating a New Definitions File

If your organization does not already have any custom dimensions, you can begin to define new custom definitions by opening a new file and saving it. When prompted for the filename, you can name the file anything you like, but the extension of the file must be .cz.yaml.

For example: our-definitions.cz.yaml

Downloading the Latest Definitions

If your organization already has custom definitions defined, you can download them and save them locally. Enter the VS Code command palette (โ‡งโŒ˜P/Ctrl-Shift-P) and select the command CloudZero: Download Latest CostFormation.

2058

The VS Code Save dialog appears. Enter a name for your file and click Save.

๐Ÿ“˜

File Extension

The file extension must be .cz.yaml. If you do not specify an extension, .cz.yaml is automatically appended to the filename.

Creating your First Custom Dimensions

If you have not defined a CostFormation template before and want to see an example that can be modified to your needs, there are two built-in examples:

  • Static Grouping: This example shows how to create rules that use statically named elements.
  • Dynamic Grouping: This example shows how to create a rule that will generate dynamically named elements using the source data.

These examples are part of the autocomplete feature. To add one of the examples to your definitions file, start typing the word example and you will see the two examples.

2740

Select one of the examples to enter it into your file. Your cursor is placed in the first customizable area, which is the dimension Id. You can replace this with your own ID. Press the Tab key to advance to other fields that you can customize.

3462

Notes

  • Although the two methods of grouping elements are shown as separate examples, these types of rules can be combined to create a dimension with both statically and dynamically named elements.
  • These example templates are intended to be used in an empty file and as such they contain the root element - Dimensions: - of a definitions file. This means that if you add both examples, you will need to delete one of those lines.

Troubleshooting

Unable to Authenticate VS Code Extension After Seamless SSO Login is Enabled

If your organization has recently enabled seamless SSO login and you attempt to authenticate the CloudZero CostFormation Toolkit extension, your browser may display the following error message:

Oops, something went wrong

There could be a misconfiguration in the system or a service outage. We track these errors automatically, but if the problem persists feel free to contact us.

Please try again.

To re-authenticate with CloudZero after your organization has enabled seamless SSO login, complete the following steps:

  1. Update to the latest version of the extension (v1.0.9 or higher).

  2. Refresh VS Code by navigating to View > Command Palette... and selecting Developer: Reload Window.

  3. Navigate to Settings > Extensions > CloudZero CostFormation.

  4. In the General: Auth URL drop-down, select https://auth.cloudzero.com.

    Select `https://auth.cloudzero.com` from the CloudZero extension Auth URL settings

  5. Navigate to View > Command Palette... and select Authenticate With the CloudZero Platform.

  6. Follow the rest of the authentication steps in Connecting to the CloudZero Platform.