cluster-api-provider-aws
cluster-api-provider-aws copied to clipboard
:bug: Remove GetPolicy IAM call when attaching to role
trafficstars
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Alternative solution to #5265 that uses principle of least privilege by removing the need for iam:GetPolicy entirely. If the policy doesn't exist, assume that the AttachPolicy call will fail rather than attempting to fetch it before attachment.
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #5254
Special notes for your reviewer:
Checklist:
- [ ] squashed commits
- [ ] includes documentation
- [x] includes emojis
- [x] adds unit tests
- [ ] adds or updates e2e tests
Release note:
Remove GetPolicy IAM call when attaching to role