I’m trying to configure a Jenkins pipeline to use an IAM role to pull from an AWS CodeCommit repo to fetch its Jenkinsfile. In order to do this, I’m using the Cloudbees AWS Credentials plugin and the AWS CodeCommit URL helper.
These work fine with a freestyle project because, after specifying Git as the Source Code Management, at the bottom of the configuration for the repository, there exists an “Additional Behaviours” section where I can add the AWS CodeCommit URL helper and select the IAM role to use. This also works for a (non-multi-branch) pipeline, where I can specify “Pipeline script from SCM”, specify Git, and I see the “Additional Behaviours” at the bottom of the section.
However, for a multi-branch pipeline project where I set Git in “Branch Sources”, the “Additional Behaviours” section seems to be missing, and I can’t find any other place where I can configure the AWS CodeCommit URL helper. I have seen some Stackoverflow questions where the advice was to use the Snippet Generator to generate a piece of the pipeline script, but this won’t work for me because my Jenkinsfile is in the repo I’m trying to pull from, so I need a way of specifying the IAM role before Jenkins sees the main pipeline script.
Is there a way to enable “Additional Behaviours” for multi-branch pipelines, or is there a better way to use IAM roles to pull from CodeCommit, these days?