Skip to main content

Create a Recommendation From a Policy Template

Flexera uses policies and their incident data to create recommendations which populate Cloud Cost Optimization’s Total Potential Savings chart to provide the Cloud Cost Optimization users insights on potential savings across their cloud estate and link them to Billing Centers for those owners to act.

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 metadata to define the policy as a recommendation, and,

  • The incident standard fields that are read to populate the recommendations table.

Policy Info Block

Add the following fields to the info block as show in the example below.

FieldExampleFormatRequiredDescription
recommendation_typeUsage ReductionstringyesThis populates the type field on the recommendation. Must be one of the known values: Rate Reduction or Usage Reduction .
providerAWSstringyesThis populates the vendor field on the recommendation.
policy_setUnused VolumesstringyesThis 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.

FieldExampleFormatRequiredDescription
savings23.456numberyesEstimated monthly savings.
accountID (ID capitalized)"902149042019"stringyesAWS Account Number, Azure Subscription ID, or Google Project ID. Use to assign the recommendation to the billing center.
accountName"Team1 Staging"stringnoThe user-friendly name for the above accountID. Used to assign the recommendation to the billing center.
resourceGroup"My Resource Group"stringnoAzure 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)yesThe tags (labels from Google) on the resource. Use to assign the recommendation to the billing center.
resourceID"db-3ZP2QSD2IL"stringyesThe unique ID of the cloud vendor resource.
resourceType"gp2"stringnoMay be a volume type, instance type, and so on.
region"us-east-1"stringnoThe cloud provider geo where the resource is provisioned.
service"EC2"stringnoThe actual field populated on the incident, independent of a info:service object on the policy template.
term"1 year"stringnoTerm of discount commitment.
platform"Windows"
"MySQL"
stringnoOperating system, database engine.
paymentOption"All Upfront"stringnoPurchasing option of a discount commitment.
scope"Shared"stringnoScope of a discount commitment.
licenseModel"BYOL"
"License Included"
stringnoLicense model of a reservation or a resource.
deploymentOption"Multi-AZ"stringnoDeployment option of an RDS instance or RI.
averageUtilization86numbernoPredicted utilization for a recommended reservation.
lookbackPeriod"30 days"stringnoTime range analyzed the recommendation is based on.
resourceName"testVM"stringnoResource name.
newResourceType"r6.xlarge"stringnoRecommended resource type if rightsizing is recommended.
size4numbernoSize of a resource. For example, volume size.
state"unattached"stringnoResource state. For example, in-use for volume.
threshold70numbernoTested threshold to produce recommendation.
thresholdType"avg"
"p95"
stringnoUtilization metric percentile tested against threshold.
cpuAverage27numbernoCPU utilization average value.
cpuMaximum89numbernoCPU utilization maximum value.
cpuP9556numbernoCPU utilization 95th percentile value.
memAverage25numbernoMemory utilization average value.
memMaximum80numbernoMemory utilization maximum value.
memP9577numbernoMemory utilization 95th percentile value.
iopsAverage100000numbernoInput/Output operations per second average value.
recommendationDetails“Terminate EC2 instance <instance ID> in AWS account <account name> (<account number>)”stringnoThe 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.