Integrate Codecommit with Jenkins using roles rather than credentials

i was looking at this tutorial for integrating jenkins with codecommit here, however, I’m wondering if anybody has done it where instead of credentials it uses roles to access the repos and run the rest of the jenkinsfile to test ,build etc?