Calamari
Calamari copied to clipboard
Allow all types of worker credentials for EKS discovery
Background
Originally worker credentials were discovery for EKS discovery by initially trying to retrieve EC2 credentials and then attempt to use Environment variable based account credentials. This means that other valid credentials that could be used (such as a k8s pod IAM role available to all containers in that pod).
Result
I've updated the code so that it now uses a "FallbackFactory" which will go through all the different ways AWS can authenticate and this should (pending tests) cover the case above.
Note: that AWS has a specific order in which it attempts to retrieve credentials with EC2 instance being the last one. This is an AWS factory so I think that order should be sufficient for most users and it should match other AWS SDKs (like the one used for step-package-ecs target discovery)
[sc-25801]
This pull request has been linked to Shortcut Story #25801: EKS Target Discovery does not support all possible types of worker credentials.