pipeline-aws-plugin
pipeline-aws-plugin copied to clipboard
withaws runs with PrincipalID as requester email or admin
Description
Can we change the withAWS assume role ID to the username of the person who ran the jenkins job. Is there is an option available already ?
Steps to Reproduce
- run pipeline job with :
withAWS(region: 'region', role:'role-name', roleAccount:"accountID")
- the log shows as follows:
[Pipeline] withAWS Setting AWS region <region> Requesting assume roleAssumed role arn:aws:sts::<AccountID>:assumed-role/role/Jenkins-job-name-6 with id ERFFXODUDDRRFKMTI52XQD:Jenkins-job-name-6 [Pipeline] { [Pipeline] sh
Expected behavior: [What you expected to happen] When we check the AWS cloudtrail (for eg: CFT deployment) the trail should show username of the user who ran the jenkins job using withAWS
Actual behavior: [What actually happened] the trail shows username as "Jenkins-job-name-6"
Environment
Jenkins-Version: 2.176.1
Plugin-Version: 1.38
Master/Slave Setup: The job is running on a custom docker image on a CoreOS slave (with EC2 builder plugin)