We got into this issue when we tried to run sudo apt-get update on ubuntu machine. There could be multiple reasons for this issue. In our case, we had DNS resolving issues. The DNS was not properly resolved when we run the command sudo apt-get update. We got this issue:
Err:1 http://eu-west-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease Temporary failure resolving 'eu-west-1.ec2.archive.ubuntu.com' aws
Solution of the issue
We had to open the resolv.conf file and we had to add nameserver 126.96.36.199 in it.
$ sudo vi /etc/resolv.conf
Add this line end of the file. The save & close.
Now when we run sudo apt-get update the error was gone.
If the above is not your case please look into this StackOverflow article.