Currently, we build the aws clients per device based on the creds that are passed in. For this CLI, this is the credentials file that gets passed in as an env var while for the controller, it is the creds that are stored in the secret.
However, there is no need to build the client map based on the creds file if we can just pull the ones we need based on the devices that the user specified in the machine config. By only building this client map based on the devices specified, we can have a client map based on the machine config or cluster that we are dealing with, if the user has extra ips defined in the file.
Currently, we build the aws clients per device based on the creds that are passed in. For this CLI, this is the credentials file that gets passed in as an env var while for the controller, it is the creds that are stored in the secret.
These creds look like the following (example from https://github.com/aws/eks-anywhere/blob/main/pkg/aws/testdata/valid_credentials):
If the user specifies a machine config with these device ips, the validations for each device will happen for each of the machines here: https://github.com/aws/eks-anywhere/blob/main/pkg/providers/snow/validator.go.
However, there is no need to build the client map based on the creds file if we can just pull the ones we need based on the devices that the user specified in the machine config. By only building this client map based on the devices specified, we can have a client map based on the machine config or cluster that we are dealing with, if the user has extra ips defined in the file.