Skip to main content

Optimize cloud costs using Harness AI

Last updated on

This topic describes how you can use Harness AI to optimize cloud costs through asset governance rules. Harness AI assists with creating and understanding governance policies, making it easier to enforce cost optimization and compliance requirements across your cloud infrastructure.


What will you learn in this topic?

By the end of this topic, you will be able to:


Before you begin

Before you use Harness AI to optimize cloud costs, ensure you have the following:

  • Harness account access: Access to your Harness account with permissions to create and manage asset governance policies.
  • Cloud Cost Management module access: Access to the Cloud Cost Management (CCM) module with Asset Governance enabled.
  • Cloud provider connector: At least one cloud provider connector configured (AWS, Azure, or GCP) to govern cloud assets.

Harness AI for asset governance

Asset governance policies play a crucial role in governing cloud assets and optimizing costs by enforcing governance rules. Authoring these policies can be challenging and confusing. Harness AI assists with creating policies through a user-friendly interface and serves as an excellent starting point for establishing the necessary policies. This tool streamlines the process of policy development and ensures that the required policies are effectively implemented.

Harness AI offers comprehensive support with the following functionalities:

  • Assist with writing rules: Harness AI helps you formulate rules tailored to your specific requirements. It understands your requirements and generates customized rules to align with your governance objectives.

  • Describe existing rules: Harness AI offers detailed descriptions of built-in rules. This feature enables you to understand the purpose, scope, and implications of each rule, thereby facilitating informed decision-making during the policy creation process.

Recommendation

Harness recommends using the rules generated with AI as references to build your policies.

Go to Create rules with Harness AI for more information on using AI to create rules and view comprehensive information about out-of-the-box and custom rules.

For more information about AI data privacy, review the following Harness legal pages:

Use Harness AI to create a rule

To create a rule using Harness AI, perform the following steps:

  1. In the Harness application, navigate to Cloud Costs.
  2. Select Asset Governance. You can create a new rule from either of the following pages:
  1. Select Create a new rule with AI.

A new rule editor is presented with an AI-generated name for the rule. To customize the rule name, select the edit icon, and then modify the generated name according to your preference.

  1. Select the cloud service provider. For example: AWS, Azure.

  2. Select a resource type displayed based on the cloud provider selected. For example: azure.vm, ec2.

  3. Use one of the following options:

    • Select a rule from examples: Harness AI presents a curated list of rule examples from which you can choose one that is relevant to your requirement. The list covers a wide range of common governance scenarios. Adapt your selection to suit your specific requirements.
    • Type your requirement: Directly enter your governance requirement into the UI. Type your desired rule in a clear and concise manner and select the Return key. For example, you could specify a rule such as "Delete EC2 instances older than 90 days." Harness AI processes your input and generates a corresponding rule.
  4. Select Apply script on Rule Editor.

  5. Select Validate Rule.

  6. The system performs a validation process to ensure rule accuracy. If errors are detected within the rule, a notification banner is displayed. To access more information regarding these errors, select the More Details option. You can view a comprehensive breakdown of the specific error details to identify and address any issues effectively.

  7. If you are satisfied with the rule, select Save.


Use Harness AI to view rule descriptions

Harness AI offers valuable insights by providing a description of the rule along with a clear and concise description of its purpose, functionality, and potential impact. This information helps you understand the rationale behind the rule and how it aligns with your governance objectives.

  1. In the Harness application, navigate to the Asset Governance page.
  2. Select Rules.
  3. Select the more options icon for a rule, and then select Learn more about rule. Or, select the rule, and then select Learn more about rule.

Harness AI displays the description of the rule and its implications.

From the current page, you have the option to create a new rule. Select Create another rule to initiate the process. Upon selecting this option, a new rule editor is presented, and it displays an AI-generated name for the rule. To customize the rule name, select the edit icon, and then modify the generated name according to your preference.


Next steps