What is the right method to use Red Hat Software Collections on Amazon AWS EC2 instances?

I created a fresh Amazon EC2 instance for testing our software against the Apache 2.4 package from the Red Hat Software Collections. My main motivation was to test on a clean install without the cruft I expect on our local machines.

To install the httpd24 package one needs to add the RHSCL repository via subscription manager. This did no work on the EC2 instance:

# subscription-manager repos --enable rhel-server-rhscl-6-rpms
Error: [...] is not a valid repository ID. Use --list option to see valid repositories.
# subscription-manager repos --list
This system has no repositories available through subscriptions.

According to the Red Hat Enterprise Linux on Amazon EC2 FAQ I would have expected the system to be subscribed automatically. Quote (emphasis added):

Red Hat Enterprise Linux on Amazon EC2 is offered at either a flat, hourly rate with no commitment (On-Demand), or through a one-time, upfront payment (Reserved Instances). Both purchase options include Amazon EC2 compute charges and Red Hat Enterprise Linux subscription charges.

Searching the AWS developer forums I only found an answer saying that one needs an extra license from RedHat (and many other vague answers).

I finally found out that it's sufficient to modify the file /etc/yum.repos.d/redhat-rhui.repo like this:

[rhui-REGION-rhel-server-rhscl]
name=Red Hat Enterprise Linux Server 6 RHSCL (RPMs)
# ...
enabled=1

This seems to work but I wonder if this is really the "right way" to do it.


Solution 1:

Ensure the Red Hat Update Infrastructure (RHUI) configuration is up to date:

yum update rh-amazon-rhui-client

List the available repositories:

yum repolist all

Find the appropriate repository, and enable it. At the time of writing, the Red Hat Software Collections repository is called rhel-server-rhui-rhscl-7-rpms:

yum-config-manager --enable rhel-server-rhui-rhscl-7-rpms

Solution 2:

Not sure about RHEL6, but on RHEL7 you can use yum-config-manager

yum-config-manager --enable 'Red Hat Enterprise Linux Server 7 RHSCL (RPMs)'