With assertions, you tell the framework to compare expected results to actual results. If they do not match then the framework sees this as a failure and anything depending on your assertion will not execute.
You can declare the expected results object in your manifest file where you can also tell the framework how to build up an actual results.
This tutorial will walk you through how to use the “Using assertions” feature.
We will assume you have:
We are going to perform the following steps to “Using assertions”:
Here are the steps you need to follow to “Using assertions”
Add the following snippet to your manifest file:
If you already had an assertions please append the assert-puppet-role-path declaration to the existing assertions section.
You will most likely need to update the tag from role:all to whatever you are using in your environment.
In each region of each account in your assert_for you asked service catalog puppet to do the following:
This example was wasteful as IAM resources are global to an account - running the assertion in each region was just to showcase how this works multi region. Also, the puppet role is needed to run the assertion so again this was just an example of what you can do with this feature.
You have now successfully executed an assertion!