AWS has a default limit of 5 policy versions, it can perhaps be bumped but it's not listed in their support requests.
So this attempts to delete the oldest policy version when we hit the limit of 5, it doesn't try
and be clever and detect the error, it's just hard coded for now.
It does this by decorating the Policy struct with a couple of attributes and maintains them when iterating over the lists of policy versions.
When emitting the diff it add a policy-version-delete command if it's required.
AWS has a default limit of 5 policy versions, it can perhaps be bumped but it's not listed in their support requests.
So this attempts to delete the oldest policy version when we hit the limit of 5, it doesn't try and be clever and detect the error, it's just hard coded for now.
It does this by decorating the Policy struct with a couple of attributes and maintains them when iterating over the lists of policy versions.
When emitting the diff it add a policy-version-delete command if it's required.
Attempts to address: https://github.com/99designs/iamy/issues/21