Create an AWS Connector for AutoStopping Rules
Connectors allow Harness to connect to your deployment environments, such as Kubernetes Clusters, AWS, Google Cloud Platform, Azure, etc. To create an AutoStopping Rule for your AWS instances, you first need to connect Harness to your AWS account. This topic describes how to connect your AWS cloud account to Harness.
In this topic:
- Before You Begin
- Add an AWS Connector
- Next Steps
Before You Begin
Add an AWS Connector
Perform the following steps to add an AWS connector for AutoStopping Rules:
- In Cloud Costs, click New AutoStopping Rule.
- In AutoStopping Rules, select AWS. It is the cloud account in which your workloads are running that you want to manage using AutoStopping Rules.
- Click Connect to your AWS account drop-down list and then click New Connector.
Step 1: Overview
- In AWS Connector, in Overview, enter the Connector Name. The name will appear in CCM Perspectives to identify this cloud provider.
- In Specify the AWS account ID, enter your AWS account ID and click Continue. To find your AWS account ID, see Finding your AWS account ID.
Step 2: Cost and Usage Report
Cost and Usage Report (CUR) provides detailed billing data across AWS accounts to help you analyze your spending. You need to enter the cost and usage report name and cost and usage S3 bucket name in Harness. To get these details, do the following:
- In Cost and Usage Report, click Launch AWS console to log into your AWS account.
- In AWS Cost and Usage Reports, click Create Report.
- Enter the Report Name. This is the CUR name that you need to enter in Harness.
- In Additional report details, select the checkbox Include resource IDs to include the IDs of each individual resource in the report.
- In Data refresh settings, select the checkbox Automatically refresh your Cost & Usage Report when charges are detected for previous months with closed bills.
- Click Next.
When you are done with the Report content step, it will look something like this:
- In the S3 bucket, click Configure.
- In Configure S3 Bucket, in Create a bucket, enter the S3 bucket name. This is the cost and usage S3 bucket name that you need to enter in Harness. For more information on S3 bucket naming requirements, see Amazon S3 Bucket Naming Requirements.
- Select Region from the drop-down list and click Next. It is recommended to select US East (N. Virginia).
- In Verify policy, select the checkbox I have confirmed that this policy is correct and click Save.
- Enter the report path prefix that you want to be prepended to the name of your report.
- Select Hourly in Time granularity.
- Select Overwrite Existing Report in Report versioning.
- Do not select any value in Enable report data integration for.
- Select GZIP in the Compression type.
- Click Next.
When you are done with the Delivery options step, it will look something like this:
- Review your report details and click Review and Complete.Your report is listed in AWS Cost and Usage Reports.
- Enter the Cost and Usage Report Name (as entered in step 3) and Cost and Usage S3 Bucket Name (as entered in step 8) in Harness.
Step 3: Select Features
Select the Cloud Cost Management features that you would like to use on your AWS account. Based on your selection Harness requires specific permissions for the cross-account role. See Review: AWS Access Permissions.
CCM offers the following features:
Cost Visibility (Required)
This feature is available by default and requires access to the CUR report. Provides the following capabilities:
AWS ECS and Resource Inventory Management (Optional)
This feature provides visibility into your EC2, EBS volumes, and ECS costs. The insights provided by inventory management can be consumed by Finance teams to understand the resource utilization across the board.
AWS resource optimization using AutoStopping rules (Required for AutoStopping Rules)
This feature allows you to enable Intelligent Cloud AutoStopping for your AWS instances and auto-scaling groups. For more information, see Create AutoStopping Rules for AWS.
Make your selection and click Continue.
Step 4: Create Cross-Account Role
Harness uses the secure cross-account role to access your AWS account. The role includes a restricted policy to access the cost and usage reports and resources for the sole purpose of cost analysis and cost optimization.
- In Create Cross Account Role, click Launch Template in AWS console.
- In Quick create stack, in Capabilities, select the acknowledgment, and click Create stack.It is recommended that you do not modify any value in the Quick create stack page.
The value for
OptimizationEnabledvaries depending on the features that you have selected in the Select Features step.
- In the Stacks page, from the Outputs tab copy the Value of CrossAccountRoleArn Key.
- In Role ARN, enter the Cross-Account Role ARN that you copied from the Outputs tab (previous step) in Harness.
- The External ID is generated dynamically for your account. For example,
harness:111111111111:lnFZRF6jQO6tQnB9xxXXXx.Do not modify the value of External ID.
- Click Save and Continue.
Step 5: Test Connection
The validation and verification happen in this step. Once the validation and verification are completed, click Finish.
Your connector is now listed under Connect to your AWS account drop-down list.