Create a Recommendation From a Policy Template
The table in the following Policy Info Block subsection provides specific details to enable the policies to feed into the Total Potential Savings charts and data tables. There are two main changes:
• | The meta data to define the policy as a recommendation, and, |
• | The incident standard fields that are read to populate the recommendations table. |
Add the following fields to the info block as show in the example below.
Field |
Example |
Format |
Required |
Description |
recommendation_type |
Usage Reduction |
string |
yes |
This populates the type field on the recommendation. Must be one of the known values: Rate Reduction or Usage Reduction. |
provider |
AWS |
string |
yes |
This populates the vendor field on the recommendation. |
policy_set |
Unused Volumes |
string |
yes |
This populates the Set field on the recommendation. Used to category like recommendations across cloud vendors |
Example
name "AWS Unused Volumes"
rs_pt_ver 20180301
type "policy"
…
info(
version: "3.6",
service: "EBS",
recommendation_type: “Usage Reduction”,
policy_set: "Unused Volumes"
provider: "AWS",
)
…
Standard Incident Fields
The fields are defined in the Policy Template policy declaration.
Field |
Example |
Format |
Required |
Description |
savings |
23.456 |
number |
yes |
Estimated monthly savings. |
accountID (ID capitalized) |
"902149042019" |
string |
yes |
AWS Account Number, Azure Subscription ID, or Google Project ID. Use to assign the recommendation to the billing center. |
accountName |
"Team1 Staging" |
string |
no |
The user-friendly name for the above accountID. Used to assign the recommendation to the billing center. |
resourceGroup |
"My Resource Group" |
string |
no |
Azure Resource Group. Use to assign the recommendation to the billing enter. |
tags |
[ "env=dev", "tag2=value2" ]
|
array of strings
(each entry must use the "=" delimiter between tag key and value) |
yes |
The tags (labels from Google) on the resource. Use to assign the recommendation to the billing center. |
resourceID |
"db-3ZP2QSD2IL" |
string |
yes |
The unique ID of the cloud vendor resource. |
resourceType |
"gp2" |
string |
no |
May be a volume type, instance type, and so on. |
region |
"us-east-1" |
string |
no |
The cloud provider geo where the resource is provisioned. |
service |
"EC2" |
string |
no |
The actual field populated on the incident, independent of a info:service object on the policy template. |
term |
"1 year" |
string |
no |
Term of discount commitment. |
platform |
"Windows" "MySQL" |
string |
no |
Operating system, database engine. |
paymentOption |
"All Upfront" |
string |
no |
Purchasing option of a discount commitment. |
scope |
"Shared" |
string |
no |
Scope of a discount commitment. |
licenseModel |
"BYOL" "License Included" |
string |
no |
License model of a reservation or a resource. |
deploymentOption |
"Multi-AZ" |
string |
no |
Deployment option of an RDS instance or RI. |
averageUtilization |
86 |
number |
no |
Predicted utilization for a recommended reservation. |
lookbackPeriod |
"30 days" |
string |
no |
Time range analyzed the recommendation is based on. |
resourceName |
"testVM" |
string |
no |
Resource name. |
newResourceType |
"r6.xlarge" |
string |
no |
Recommended resource type if rightsizing is recommended. |
size |
4 |
number |
no |
Size of a resource. For example, volume size. |
state |
"unattached" |
string |
no |
Resource state. For example, in-use for volume. |
threshold |
70 |
number |
no |
Tested threshold to produce recommendation. |
thresholdType |
"avg" "p95" |
string |
no |
Utilization metric percentile tested against threshold. |
cpuAverage |
27 |
number |
no |
CPU utilization average value. |
cpuMaximum |
89 |
number |
no |
CPU utilization maximum value. |
cpuP95 |
56 |
number |
no |
CPU utilization 95th percentile value. |
memAverage |
25 |
number |
no |
Memory utilization average value. |
memMaximum |
80 |
number |
no |
Memory utilization maximum value. |
memP95 |
77 |
number |
no |
Memory utilization 95th percentile value. |
iopsAverage |
100000 |
number |
no |
Input/Output operations per second average value. |
recommendationDetails |
“Terminate EC2 instance <instance ID> in AWS account <account name> (<account number>)” |
string |
no |
The user-friendly description of the recommended action. |
Example
policy "policy_unattached_volumes_list" do
…
export "unused_volumes" do
resource_level true
field "accountID" do
label "Account ID"
end
field "accountName" do
label "Account Name"
end
field "region" do
label "Region"
end
field "resourceID" do
label "Resource ID"
path "volumeId"
end
field "resourceType" do
label "Resource Type"
end
field "size" do
label "Size"
end
field "tags" do
label "Tags"
end
field "savings" do
label "Estimated Monthly Savings"
end
field "savingsCurrency" do
label "Savings Currency"
end
field "id" do
label "Id"
path "volumeId"
end
field "service" do
label "Service"
end
field "newResourceType" do
label "Recommended Resource Type"
end
field "platform" do
label "Platform"
end
field "cpuP95" do
label "CPU Utilization (p95)"
path "cpu_p95"
end
end
end
See the full public version of AWS Unused Volumes in our GitHub repository.