Environments are an effective way of grouping your resources and optimising their utilisation.
An Environment is essentially a Query. It is not the actual list of resources. Which means the resources that fit in a given Environment can change in the future.
To define a query, click on the “Environments” item in the main menu (right side of the screen).
This will take you to the Environment’s listing page. To create a new Environment, click on “+ Create New” button.
Clicking on the Create New button will open the Edit Environment screen.
In this screen:
- Provide a name for the Environment. For example: Staging
- Choose the Owner. This is useful when you have been invited to manage the environments of some other accounts too.
- Schedule: Choose the Schedule that you want to associate with this Environment.
Defining the Environment’s query
As said before, each Environment is a “Definition” or a “Query” by which the Cloud Resources are discovered. This means that you do not actually include the resources in Environments, but rather you tell the Environment that how the resources must be discovered.
Please bear in mind that if in the future you add new Cloud Resources e.g. Virtual Machines that match an Environment’s query, they will be picked up and processed.
To add a new rule, simple click on the green “Add Rule” button. Each rule can have a key, a criteria and a value.
A key can be one of the below:
- Resource Name: The unique identifier of the resource. For example i-xxxx is the format of the resource name of AWS EC2 instances.
- Cloud Type: The provider type which can be AWS, Azure or GCP.
- At Least One Tag Key: If your resources have Tags or Labels, at least of of those tags/labels.
- At Least One Tag Value: If your resources have Tags or Labels, at least the value of one of those tags/labels
- At Least One Tag Key/Value: If your resources have Tags or Labels, at least of tag and value must match.
- Cloud Account: One of the accounts that you have registered in Cloud Accounts page.
- State: The state of the resource. Can be Stop or Running.
- Location: The region or zone of the resource depending on the cloud provider. The Location value can be seen in the Cloud Resources page.
The middle drop-down list includes the Cirteria. Criteria may change based on the Key. For example if the value of a Key is a text, e.g. the value of a Location, then you will have the below options:
- not equal
- begins with
- doesn’t begin with
- doesn’t contain
Whilst if the value is a list of options the criteria can be:
- doesn’t equal
To add a new Rule, again click on the Add Rule button. By default when you add a new Rule, the condition is AND. If you want to put OR between two conditions, click on the “OR” button.
Not only you can combine individual rules but also can you create groups of rules and combine them together!
To add a Group, simply click on the “Add group” button (which is next to “Add rule” button).
The “AND” and “OR” options apply on the Groups too so that you can combine groups as well.
At the end, click on Test to see a preview of the resources that may get included in the Environment. If everything looks good, click on the Save button to save the Environment.
Please be advised that when you associate a Schedule with an Environment, the Schedule will not affect the Cloud Resources that:
1- Are included in the Environment
2- They have a Schedule directly associated to them
The Schedules that are directly attached to a Cloud Resource always take priority over the Schedule that is attached to an Environment. Also, if you attach the system Schedule of “Do Not Disturb” to a cloud resources, they will not be affected by the Schedule that is associated with the Environment.
STOP and START environments
If you do not associate a Schedule to an Environment, then a STOP and a START button will appear next to the Environment in the listing page.
If you click on the Start button, all the Stopped resources in that Environment will be Started (they will receive a Start command).
If you click on the Stop button, all the Running resources in that Environment will be Stopped (they will receive a Stop command).
To know when an Environment is stopped or started, create a Notification Channel (via Notifications) menu and subscribe to the Environment’s events.