Install .NET Core in Amazon Linux 2 using yum
Have you tried the following:
sudo yum update
sudo yum install dotnet-sdk-2.2
Also this link might help: https://dotnet.microsoft.com/download/linux-package-manager/centos/sdk-current
The following works for .NET Core 3.1 on Amazon Linux 2:
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install dotnet-sdk-3.1
(or dotnet-sdk-5.0
for .NET 5)
More detail here: https://docs.microsoft.com/en-us/dotnet/core/install/linux-centos#centos-7-
If you're using AWS Elastic Beanstalk, and you only need the runtime (not the SDK) then you can just use the .NET Core / Linux platform.