Reviewing and Publishing Definitions

When you have completed you dimension definitions, you can publish them to CloudZero to make them available for everyone in your organization. When you publish your definitions they will be fully validated, and any validation failures will prevent the new definitions from being published.

Reviewing Your Changes

Once you have modified your existing definitions, you may want to review the changes before publishing them. The CloudZero CostFormation Toolkit extension allows you to perform a line-by-line diff of your current definitions with the latest version in the cloud.

To view the line-by-line diff, make sure you are in the file containing your latest edits and open the VSCode command palette (⇧⌘P/Ctrl-Shift-P) and select the command CloudZero: Review CostFormation Changes

2046

After you hit enter, a new tab will open with a side-by-side diff. This view is read-only and is only for reviewing changes. It does not currently provide any functionality to resolve or undo differences.

4704

Publishing Your Definitions

When you are ready to publish your new definitions, go back to the tab containing your definitions and open the VSCode command palette (⇧⌘P/Ctrl-Shift-P) and select the CloudZero: Publish CostFormation

2072

Once you select the command, the definitions will be uploaded, validated, and then published.

📘

Viewing Your Changes on the CloudZero Platform

When definitions are published, there may be a delay before the changes are visible the CloudZero Cost Explorer. This delay may be around 15 to 30 minutes.

Conflicts When Publishing

After downloading the latest CostFormation definitions and making edits in VSCode, it is possible that a newer version of the CostFormation was uploaded to the CloudZero platform by someone else. The CostFormation Toolkit will detect this situation and warn you that you may potentially overwrite changes that were uploaded since you downloaded the version you started your edits with.

534

Click Resolve Conflicts to open a merge conflict editor, which merges changes you have made with changes uploaded after you downloaded.

🚧

Overwriting the Latest Changes

You can choose to click on Overwrite Latest to publish without merging with the other changes. However, you risk losing important changes.

If there are any conflicting changes, those conflicts will be highlighted using a conflict markers (<<<<<<<, =======, >>>>>>>).

1256

You can use the editor to resolve the conflicts. For any conflict highlighted in the editor, choose to accept the current changes (which you made) or incoming changes that were uploaded after your last download. Or you can delete both sets of changes and put in new ones. All conflicts must be resolved before you can attempt to publish the merged changes.

📘

Clean Merge

It is very possible that your changes and the newly downloaded changes do not conflict in any way. In that case, the editor will contain the latest downloaded changes merged in with your changes and you will not find any occurrences of the conflict markers.

After you have resolved all conflicts and there are no more conflict markers, you can choose to publish your definitions again. The toolkit will ask you if you have resolved all conflicts.

526

Click Conflicts are Resolved and your definitions will be published.

Recommended Workflow

The recommended workflow when using the CloudZero CostFormation Toolkit is for you to download the latest CostFormation definitions for your organization, make edits, and then publish the changes. This enables the extension to track important information, including the version downloaded, about your CostFormation definition file. Working outside of this workflow may cause the extension to be unable to track this information.

The following actions can cause this:

  • Moving or renaming files outside of VSCode, such as using terminal commands or other text editors.
  • Downloading definitions files from other sources, like GitHub or other source control systems.
  • Creating a new definition file using ‘Save As’ command.

If the CostFormation Toolkit is unable to track this information or is otherwise unable to determine what version of the definitions your edits are based on, then, any time you publish, a warning will be shown recommending that you review your changes to ensure you are not undoing changes that may have been uploaded after the version you began editing.

556

You can select Overwrite Latest to publish your changes, or select Review Changes to bring up a line-by-line comparison of your definitions vs. the last published definitions.