How to create an Alloy definition
Before creating an Alloy definition, the Player exercise, Caster directory, and Steamfitter scenario should be created. All of these components are actually optional for a definition, so a definition can have any combination of the three components.
- Add a new Definition.
- Complete the Name, Description, and Duration fields.
- Copy and paste the ID's of the Player exercise, Caster directory, and Steamfitter scenario.
- Save the Definition.
To give the user the ability to end the implementation or lab from inside Player, add a link to the definition as a Player application in the associated Player exercise.
Understanding the launch process
When launching an implementation from a definition, the Alloy API goes through the following process:
- Clones the definition Player exercise into a new Player exercise and adds the Player exercise ID to the Alloy implementation.
- Creates a Steamfitter session from the definition Steamfitter scenario and adds the Steamfitter scenario ID to the Alloy implementation.
- Creates a Caster workspace in the definition Caster directory and adds the Caster Workspace ID to the Alloy implementation.
- Creates a Terraform
auto.tfvars
file in the Caster workspace that contains the following:- Exercise ID
- Team Name and ID of every team in the exercise
- User Name and ID
- Plans and applies the Caster workspace to deploy the infrastructure.
- Starts the Steamfitter scenario.
Understanding the end process
There are two ways the end process can be triggered:
- user initiated, and
- AlloyQueryService
of the Alloy API initiated because expiration time has been reached.
When the end process is initiated, the Alloy API goes through the following process:
- Deletes the Player exercise.
- Deletes the Steamfitter session.
- Plans and applies the destroy of the Caster workspace.
- Deletes the Caster workspace.