Can't install amazon-linux-extras pm AWS EC2 Amazon Linux AMI instance
Solution 1:
It looks like this issue is potentially being caused by YUM priorities. You could try disabling priorities to see if that is the issue. The config file used to disable yum priorities can be found here.
/etc/yum/pluginconf.d/priorities.conf
Change the config to be "enabled = 0" and try again.
Solution 2:
I ran into the same error message when attempting to create an Amazon Linux 2 instance using the AWS CDK. The CDK currently defaults to Amazon Linux instead of Amazon Linux 2. When you accidentally use an Amazon Linux AMI from 2018, surprise surprise, all sorts of facilities are not available. I posted an easy way to check your version in another answer.
In CDK (and Cloud Formation) make sure to declare your intended generation in your AmazonLinuxImage properties
generation: AmazonLinuxGeneration.AMAZON_LINUX_2