Chapter 1. Integrating Amazon Web Services data into cost management

To add an Amazon Web Services (AWS) account to cost management, you must configure your AWS account to provide metrics, then add your AWS account as a cloud integration from the cost management user interface.

Note

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

When you add an AWS integration, you create a read-only connection to AWS so that cost management can collect your data hourly. This process does not make any changes to the AWS account.

To add your AWS account to cost management as an integration, you must configure the following services on your AWS account to allow cost management to have access to your 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

Since 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.

Note

To ensure you have the most up to date information about AWS, refer to the AWS documentation.

1.1. Adding an AWS account as an integration

Add an AWS integration so the cost management application can processes the Cost and Usage Reports from your AWS account. You can add an AWS integration automatically by providing your AWS account credentials, or you can configure cost management to filter the data that you send to Red Hat. Add an AWS integration so the hybrid committed spend application can processes the Cost and Usage Reports from your AWS account. You can add an AWS integration automatically by providing your AWS account credentials, or you can configure cost management to filter the data that you send to Red Hat.

Prerequisites

  • You must have a Red Hat account with Sources Administrator permissions before you can add data integrations to cost management.

Procedure

  1. From Red Hat Hybrid Cloud Console, click Settings Menu > (Settings).
  2. Click Integrations.
  3. From the Cloud tab, click Add Integration.
  4. On the Select integration type step, in the Add a cloud integration wizard, select Amazon Web Services. Click Next.
  5. Enter a name for the integration and click Next.
  6. On the Select configuration step, select how you want to connect to your AWS integration.

    1. Select Account authorization to provide your AWS account credentials and let Red Hat configure and manage your integration for you.
    2. Select Manual configuration to customize your integration. You can filter your information before it is sent to cost management. For instructions on how to filter your data, see Chapter 2, Filtering your Amazon Web Services data before sending it to cost management. Click Next.
  7. In the Select application step, select Cost management. Click Next.
  8. If you selected the account authorization method, on the Review details step, review the details and click Add. If you selected the manual configuration method, continue to the next step in the wizard and configure your S3 bucket.

1.2. Creating an S3 bucket and a Cost and Usage Report

Create an Amazon S3 bucket with permissions configured to store a Cost and Usage Report.

Procedure

To create a Cost and Usage Report, log in to your AWS account and complete the following steps:

  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. On the Create storage step, in the Add a cloud source wizard, paste the name of your S3 bucket and select the region that it was created in. Click Next.
  3. In the AWS Billing console, create a Cost and Usage Report that will be delivered to your S3 bucket.
  4. Enter the following values and accept the defaults for any other values:

    • Report name: koku
    • Time unit: Hourly
    • Include: resource IDs
    • S3 bucket: <the S3 bucket that you configured before>
    • Enable report data integration for: Amazon Redshift, Amazon QuickSight, and disable report data integration for Amazon Athena
    • Report path prefix: cost
    • Compression type: GZIP

      Note

      For more details on configuration, see the AWS Billing and Cost Management documentation.

  5. In the Add a cloud integration wizard, on the Create cost and usage report step, click Next.

1.3. Activating AWS tags

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. If your organization is converting systems from CentOS 7 to RHEL and using hourly billing, activate the com_redhat_rhel tag for your systems in the Cost Allocation Tags section of the AWS console.

    1. After tagging the instances of RHEL you want to meter in AWS, select Include RHEL usage.
  3. In the Red Hat Hybrid Cloud Console Integrations wizard, click Next.

Additional resources

For more information about tagging, see Adding tags to an AWS resource.

1.4. Configure an IAM policy to enable minimal account access for Cost and Usage Reports

To provide data in the web interface and API, cost management must consume the Cost and Usage Reports produced by AWS. To only provide access to the stored information and nothing else, create an IAM policy and role for cost management to use.

Procedure

  1. From the AWS Identity and Access Management (IAM) console, create a new IAM policy for the S3 bucket that 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. Enter a name for the policy and create the policy. Do not close the AWS IAM console. You will use it in the following steps.
  2. In the Red Hat Hybrid Cloud Console Add a cloud integration wizard, click Next.
  3. In the AWS IAM console, create a new IAM role:

    1. Select Another AWS account as the type of trusted entity.
    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.
  4. In the Red Hat Hybrid Cloud Console Add a cloud integration wizard, click Next.
  5. In the AWS IAM console, in the Roles section, open the summary screen for the role you just created.

    1. Copy the Role ARN, which is a string beginning with arn:aws:.
  6. In the Red Hat Hybrid Cloud Console Add a cloud integration 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.

1.4.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 before.
  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 before.

    The remainder of the configuration steps are the same as in Section 1.4, “Configure an IAM policy to enable minimal account access for Cost and Usage Reports”

1.5. 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
Your costs are calculated according to your usage cost for that date.
Amortized (Default)
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.