One step I'd tighten is the role's trust policy. The tutorial fills in only the group in the role wizard and leaves the other fields optional, so it's worth opening the trust policy AWS generated and checking what it matches. If it only checks the group, any project in that namespace, on any branch, can assume the role. The rules: if: '$CI_COMMIT_BRANCH == "main"' line doesn't prevent that, because anyone who can push a branch can also edit .gitlab-ci.yml on that branch.
GitLab's AWS docs show the tighter version: pin gitlab.com:sub to the exact project and branch, for example project_path:yourname/your-site:ref_type:branch:ref:main. On GitLab.com you can also add gitlab.com:project_id, which survives a rename, and gitlab.com:ref_protected. It matters more than usual here because the job runs aws s3 sync with --delete, so a stray branch could empty the site rather than just add files.