This repository contains fictional demo data, and demo policy templates, to use in the Flexera One platform. The purpose is to enable the demonstration of the platform's functionality without the need to unnecessarily pay for a large number of cloud assets to produce real optimization recommendations.
The following steps should be followed to deploy the demo policy templates in a Flexera One demo organization:
-
Switch to the
mainbranch and navigate to the "templates" directory (or click this link as a shortcut). The demo templates will be sorted by cloud provider; download all of the templates you wish to use in the demo environment along with the Update Demo Environment policy template. -
In Flexera One, switch to the organization that you will be using these in, and navigate to Automation -> Templates. Once there, upload the templates you downloaded.
-
Apply the "Update Demo Environment" policy template. This template will automatically apply all of the demo policy templates and will, on a weekly basis, terminate and reapply them so that they produce fresh recommendations/incidents. It is recommended that you apply this policy template on a weekly schedule on a Saturday.
Generation of demo policy templates is partially automated via scripts. Branch the repository, follow the below flow to make any updates, and then make a pull request back to the main branch in order to update assets.
The following flow should be followed to create/update demo policy templates and data:
- Create and switch to a development branch.
- Modify "lists/template_list.json" as needed to add any policy templates from the catalog that we want to demo (if needed).
- Run the "scripts/generate_template_schema.py" script from the root directory of the repository. This will scrape the policy templates listed in "lists/template_list.json" to create schema that we can generate demo policy templates from.
- Run the "scripts/generate_fake_templates.py" script from the root directory of the repository. This will use the schema created above to create and store updated demo policy templates in the "templates" directory.
- Create/update demo data in the "generated_data/fake_incident_tables" directory. More details on how to do this are below.
- Make a pull request to the
mainbranch with your updates and merge it after review.
Note: If you only need to make tweaks or updates to the demo data, you can skip steps 2-4.
Demo data for the demo policy templates is stored in the "generated_data/fake_incident_tables" directory. The data should be a flat list, in JSON format, containing all of the incident fields expected by the relevant demo policy template. Each file should be named after the policy template and the incident number it applies to.
Example:
- There is a demo policy template named "aws_rightsize_ec2_instances.pt" that raises 2 incidents.
- There should be two files in "generated_data/fake_incident_tables" for this demo policy template:
- aws_rightsize_ec2_instances_1.json for the first incident.
- aws_rightsize_ec2_instances_2.json for the second incident.
- There should be two files in "generated_data/fake_incident_tables" for this demo policy template:
- There is a demo policy template named "aws_delete_old_snapshots.pt" that raises 1 incident.
- There should be one file in "generated_data/fake_incident_tables" for this demo policy template:
- aws_delete_old_snapshots_1.json for the first and only incident.
- There should be one file in "generated_data/fake_incident_tables" for this demo policy template:
Generating the demo data itself is up to you. The goal should be to make the demo data fake (it should not reference real infrastructure) but believable, and to have enough entries to look like a plausible result when using the real policy template.
Tools such as LLMs may be useful in generating realistic enough data, provided they are prompted well and given good starting data to build from. Example prompts you might use with such tools are available in the "prompts" directory. Demo data does not require a particularly high-powered LLM; a locally run tool like ollama may be sufficient.
Using ollama, you could generate fresh demo data for the AWS Old Snapshots policy template with the following command:
cat prompts/aws_delete_old_snapshots_1.txt | ollama run llama3 > generated_data/fake_incident_tables/aws_delete_old_snapshots_1.jsonNote: LLMs are finicky and often inconsistent. Please verify the validity of their output. You may need to experiment with LLM models and prompts, and adjust some results by hand.
- generated_data - Contains data generated by scripts, LLMs, etc.
- generated_data/fake_incident_tables - JSON files containing fictional incident data for the demo policy templates to use.
- generated_data/template_schema - Metadata about various policy templates. Generated from "lists/template_list.json" via the "scripts/generate_template_schema.py" script.
- lists - Manually modified lists of data.
- lists/template_list.json - URLs of the various policy templates to generate demo policy templates from. Used by the "scripts/generate_template_schema.py" script.
- prompts - LLM prompts that can be used for generating demo data if desired.
- scripts - Scripts for generating demo policy assets.
- scripts/generate_template_schema - Generates metadata about policy templates and stores it in the "generated_data/template_schema" directory.
- scripts/generate_fake_templates.py - Generates demo policy templates from the metadata in "generated_data/template_schema" and stores them in the "templates" directory.
- templates - Demo policy templates and related templates
- templates/{cloud} - Demo policy templates for a specific cloud provider.
- templates/update_demo_environment.pt - Policy template for applying and managing demo policy templates in a Flexera One demo organization.