1. Adding an Amazon Web Services (AWS) source to cost management

To add an AWS account to cost management, you must configure your AWS account to provide metrics, then add your AWS account as a source from the cost management user interface.

Note

You must have a Red Hat account user with Sources Administrator entitlements before you can add sources to cost management.

When you add your AWS account as a source, this creates a read-only connection to AWS to collect cost information hourly in cost management, but does not make any changes to the AWS account.

Before you can add your AWS account to cost management as a data source, you must configure the following services on your AWS account to allow cost management access to metrics:

  1. An S3 bucket to store cost and usage data reporting for cost management

  2. An Identity Access Management (IAM) policy and role for cost management to process the cost and usage data

As you will complete some of the following steps in the AWS console, and some steps in the cost management user interface, keep both applications open in a web browser.

Add your AWS source to cost management from the settings area at https://console.redhat.com/settings/sources.

Note

As non-Red Hat products and documentation can change without notice, instructions for configuring the third-party sources provided in this guide are general and correct at the time of publishing. See the AWS documentation for the most up-to-date and accurate information.

1.1. Creating an S3 bucket for reporting

Cost management requires an Amazon S3 bucket with permissions configured to store billing reports.

Log into your AWS account to begin configuring cost and usage reporting:

  1. In the AWS S3 console, create a new S3 bucket or use an existing bucket. If you are configuring a new S3 bucket, accept the default settings.

  2. In the AWS Billing console, create a Cost and Usage Report that will be delivered to your S3 bucket. Specify the following values (and accept the defaults for any other values):

    • Report name: <any-name> (note this name as you will use it later)

    • Additional report details: Include resource IDs

    • S3 bucket: <the S3 bucket you configured previously>

    • Time granularity: Hourly

    • Enable report data integration for: Amazon Redshift, Amazon QuickSight (do not enable report data integration for Amazon Athena)

    • Compression type: GZIP

    • Report path prefix: cost

      Note

      See the AWS Billing and Cost Management documentation for more details on configuration.

  3. From Red Hat Hybrid Cloud Console, open the Sources menu (https://console.redhat.com/settings/sources) to begin adding an AWS source to cost management:

    1. Navigate to Sources and click Add a source to open the Sources wizard.

    2. Enter a name for your source and click Next.

    3. Select cost management as the application and Amazon Web Services (AWS) as the source type. Click Next.

    4. Paste the name of your S3 bucket and click Next.

1.2. Activating AWS tags for cost management

To use tags to organize your AWS resources in the cost management application, activate your tags in AWS to allow them to be imported automatically.

Procedure
  1. In the AWS Billing console:

    1. Open the Cost Allocation Tags section.

    2. Select the tags you want to use in the cost management application, and click Activate.

  2. In the Red Hat Hybrid Cloud Console Sources wizard, click Next to move to the next screen.

1.3. Enabling minimal account access for cost and usage consumption

To provide data within the web interface and API, cost management needs to consume the Cost and Usage Reports produced by AWS. For cost management to obtain this data with a minimal amount of access, create an IAM policy and role for cost management to use. This configuration provides access to the stored information and nothing else.

Procedure
  1. From the AWS Identity and Access Management (IAM) console, create a new IAM policy for the S3 bucket you configured previously.

    1. Select the JSON tab and paste the following content in the JSON policy text box:

      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
              "s3:Get*",
              "s3:List*"
            ],
              "Resource": [
              "arn:aws:s3:::<your_bucket_name>", (1)
              "arn:aws:s3:::<your_bucket_name>/*"
            ]
          },
      
          {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": [
              "s3:ListBucket",
              "cur:DescribeReportDefinitions"
            ],
            "Resource": "*"
          }
        ]
      }
      1. Replace <your_bucket_name> in both locations with the name of the Amazon s3 bucket you configured previously.

    2. Provide a name for the policy and complete the creation of the policy. Keep the AWS IAM console open as you will need it for the next step.

  2. In the Red Hat Hybrid Cloud Console Sources wizard, click Next to move to the next screen.

  3. In the AWS IAM console, create a new IAM role:

    1. For the type of trusted entity, select Another AWS account.

    2. Enter 589173575009 as the Account ID to provide the cost management application with read access to the AWS account cost data.

    3. Attach the IAM policy you just configured.

    4. Enter a role name (and description if desired) and finish creating the policy.

  4. In the Red Hat Hybrid Cloud Console Sources wizard, click Next to move to the next screen.

  5. In the AWS IAM console under Roles, open the summary screen for the role you just created and copy the Role ARN (a string beginning with arn:aws:).

  6. In the Red Hat Hybrid Cloud Console Sources wizard, paste your Role ARN and click Next.

  7. Review the details and click Finish to add the AWS account to cost management.

Cost management will begin collecting cost and usage data from your AWS account and any linked AWS accounts.

The data can take a few days to populate before it shows on the cost management dashboard (console.redhat.com/openshift/cost-management/).

1.3.1. Enabling additional account access for cost and usage consumption

Cost management can display additional data that might be useful. For example:

  • Include the Action iam:ListAccountAliases to display an AWS account alias rather than an account number in cost management.

  • Include the Actions organization:List* and organizations:Describe* to obtain the display names of AWS member accounts if you are using consolidated billing rather than the account ID.

The following configuration provides access to additional stored information and nothing else.

Procedure
  1. From the AWS Identity and Access Management (IAM) console, create a new IAM policy for the S3 bucket you configured previously.

  2. Select the JSON tab and paste the following content in the JSON policy text box:

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "VisualEditor0",
          "Effect": "Allow",
          "Action": [
            "s3:Get*",
            "s3:List*"
          ],
          "Resource": [
            "arn:aws:s3:::<your_bucket_name>", (1)
            "arn:aws:s3:::<your_bucket_name>/*"
          ]
        },
        {
          "Sid": "VisualEditor1",
          "Effect": "Allow",
          "Action": [
            "iam:ListAccountAliases",
            "s3:ListBucket",
            "cur:DescribeReportDefinitions",
            "organizations:List*",
            "organizations:Describe*"
          ],
          "Resource": "*"
        }
      ]
    }
    1. Replace <your_bucket_name> in both locations with the name of the Amazon s3 bucket you configured previously.

    The remainder of the configuration steps are the same as in Enabling minimal account access for cost and usage consumption

1.4. Configuring AWS billing plans

By default, cost management calculates AWS cost according to your usage cost for that date. If you have a special billing arrangement with AWS such as amortized billing or blended rates, you can configure these calculations from the cost management settings page. This allows your cost reports to more accurately reflect your AWS billing.

For more information about AWS billing, see Understanding Consolidated Bills in the AWS documentation.

Cost management supports three cost calculation options to accommodate AWS billing plans:

Unblended (Default)

Your costs are calculated according to your usage cost for that date.

Amortized

Your recurring and upfront costs will be distributed evenly throughout the billing period.

Blended

Your costs are calculated according to AWS blended rates.

This procedure describes how to set your cost calculation to Amortized or Blended from the default Unblended.

Prerequisites
Procedure
  1. From Red Hat Hybrid Cloud Console, navigate to the cost management settings page.

  2. Under Show cost as select Amortized or Blended.

  3. Click Save.

2. Next steps for managing your costs

After adding your OpenShift Container Platform and Amazon Web Services sources, in addition to showing cost data by source, cost management will automatically show AWS cost and usage related to running your OpenShift Container Platform clusters on their platform.

On the cost management Overview page (console.redhat.com/openshift/cost-management/), your cost data will be sorted into OpenShift and Infrastructure tabs. From here, you can use Perspective to select different views of your cost data.

You can also use the left navigation menu to view the additional details of your costs by service.

2.1. Limit access to cost management resources

After adding and configuring sources in cost management, it is a good idea to limit access to cost data and resources. For example, you may not want users to have access to all cost data, but instead only data specific to their projects or organization. Using role-based access control, you can limit the visibility of resources involved in cost management reports. For example, you may want to restrict a user’s view to only AWS sources, rather than the entire environment.

For more information about limiting access see, Limiting access to cost management resources.

2.2. Configure tagging for your sources

The cost management application tracks cloud and infrastructure costs using tags (called labels in OpenShift), which you can refine to filter and attribute to resources. Tags in cost management allow you to organize your resources by cost and to allocate the costs to different parts of your cloud infrastructure.

Important

Tags and labels can only be configured directly on a source. While you can choose what tags are activated in cost management, you cannot edit tags and labels in the cost management application.

See Managing cost data using tagging to learn more about:

  • Planning your tagging strategy to organize your view of cost data.

  • Understanding how cost management associates tags.

  • Configuring tags and labels on your sources.

2.3. Configure cost models to accurately report costs

Now that you have configured your sources to collect cost and usage data into cost management, you can configure cost models to associate prices to metrics and usage, and fine-tune the costs of running your cloud.

A cost model is a framework used to define the calculations for the costs stored in cost management, using raw costs and metrics. Costs generated by a cost model can be recorded, categorized and distributed to specific customers, business units or projects.

From the Cost Models area of cost management, you can:

  • Classify your costs as infrastructure or supplementary costs.

  • Capture monthly costs for OpenShift nodes and clusters.

  • Apply a markup to account for additional support costs.

  • Learn how to configure a cost model in Using cost models.

2.4. Use the Cost Explorer to visualize your costs

The cost management Cost Explorer allows you to create custom graphs of time-scaled cost and usage information to better visualize and interpret your costs.

  • Using Cost Explorer to identify abnormal events.

  • Understanding how your cost data changes over time.

  • Creating custom bar charts of your cost and usage data.

  • Exporting custom cost data tables.

Providing feedback on Red Hat documentation

We appreciate your feedback on our documentation. To provide feedback, highlight text in a document and add comments.

Prerequisites
  • You are logged in to the Red Hat Customer Portal.

  • In the Red Hat Customer Portal, the document is in the Multi-page HTML viewing format.

Procedure

To provide your feedback, perform the following steps:

  1. Click the Feedback button in the upper-right corner of the document to see existing feedback.

    Note
    The feedback feature is enabled only in the Multi-page HTML format.
  2. Highlight the section of the document where you want to provide feedback.

  3. Click the Add Feedback pop-up that appears near the highlighted text.

    A text box appears in the feedback section on the right side of the page.

  4. Enter your feedback in the text box and click Submit.

    A documentation issue is created.

  5. To view the issue, click the issue link in the feedback view.