I pulled this together because I couldn't get Yarn 2 working with the standard Amplify Console image.
Based on https://github.com/butaca/amplify-hugo
From your App details page, navigate to App settings -> Build settings. Specify the custom image as davad/amplify-yarn-latest