Support for Amazon Linux 2 Yum repository

Hi Team,

We are using Amazon linux version 1 OS for our workloads and using nexus to configure yum proxy repository. This is working fine.
But the same setup for Amazon Linux 2 is not working as expected. because

With AL1, the structure of the repository is something like this -
$ sudo yumdownloader --urls ec2

Where all the packages reside under the same URL till the package name.

However, with AL2, the actual package is preceded by path similar to a UUID of sorts.
$ sudo yumdownloader --urls ec2
-* Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
[ ]

As we can see, although these package URLs have a format i.e. they include region name, package name and version, they also include a unique-id string by design which does not remain same throughout the life of a system. So when there is a new update for repository or package, the unique id string may be different. This make the URLs unpredictable to obtain package updates. Hence, the only reliable way to know the URL to download the package is to login an AL1/AL2 instance.

How to solve this issue ?

Thanks in advance.