Update the pipeline

Open s3 console

Navigate to the s3 console and create a new bucket in same region. Create bucket Because, s3 is specific region, so please use non-existing name for new bucket

Keep the default settings, and create. Bucket

Bucket name as a environment variable

Back to Amplify console, add your bucket name as new environment variable. The new environment variable has the key BUCKET_NAME and value <replace_with_your_bucket_name> pipeline

Access key

Besides, we must have the access key & secret access key to allow Amplify build our app.
Go to AWS IAM - Security credentials , using your current key. If you did not backup or forget the current key, select Create access key to create new.
If you already have 2 access keys, please delete one before create new. Access key

As you can see, we have new access key and secret key, remember to backup your key to reuse in other cases.

Add access key and secret key as variables

We need to store acces key & secret key in Amplify. Add 2 environment variables for access key and secret key. These are ACCESS_KEY and SECRET_KEY as key name for variable. Key environment variables

Update the pipeline

Finally, edit amplify.yml to update our pipeline in Build settings page.

version: 1
    # IMPORTANT - Please verify your build commands
        - rm -f ~/.aws/credentials
        - aws configure set aws_access_key_id $ACCESS_KEY
        - aws configure set aws_secret_access_key $SECRET_KEY
        - aws s3 rm s3://$BUCKET_NAME --recursive
        - aws s3 sync ./ s3://$BUCKET_NAME
    # IMPORTANT - Please verify your build output directory
    baseDirectory: /
      - '**/*'
    paths: []

Then next to one more page to view some interest things.