updated assumeRoleProvider --> in buildStsClient now iamRoleRegion attribute is passed as argument
AWSCredentialsImpl.java
updated constructor and overloaded for compatibility
updated buildStsClient to include iamRoleRegion as parameter --> clientRegion now dynamically switches to determineClientRegion() if iamRoleRegion is null/empty
updated getCredentials() --> updated buildStsClient in order to match the updated method
credentials.jelly
added entry under iamRoleArn for iamRoleRegion as textbox
Problem found before iamRoleRegion
Using the provided test over a credential:role we encountered this error "The security token included in the request is invalid" caused by the role being assumed in a different region then the target region for the aws cli operations.
Thus to solve this problem iamRoleRegion has been added to the plugin Credential.
### Submitter checklist
- [x] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [x] Ensure that the pull request title represents the desired changelog entry
- [x] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue
Added iamRoleRegion as attribute in:
GUI Changes
Before![image](https://github.com/jenkinsci/aws-credentials-plugin/assets/97523729/2caa84f9-dc29-497f-b893-0680432e3863)
After![image](https://github.com/jenkinsci/aws-credentials-plugin/assets/97523729/8a494f8a-b3c0-48a6-9450-a4bdb400f211)
Testing done
We created this simple use case:
Problem found before iamRoleRegion Using the provided test over a credential:role we encountered this error "The security token included in the request is invalid" caused by the role being assumed in a different region then the target region for the aws cli operations. Thus to solve this problem iamRoleRegion has been added to the plugin Credential.