This eliminates all remaining references to AWS SDK v1 in the
lib/srv/db/... and lib/srv/discovery/... packages.
Most of the changes are simply to remove dead code.
Calling the AWS API `ecs:ListServices` with a non-existent ECS Cluster
name will return a 400 w/ ClusterNotFoundException.
The existing code was not handling that error and a raw error was
returned.
This PR changes the logic to ensure that case is handled and that the
ListDeployedDatabaseServices returns an empty list.
An alternative would be to call the ListClusters beforehand, but that
would increase the number of API calls we do to external services.
* migrate aws configurator to sdk v2
* rename package imports with lowercase
* export iam client interface
* mock loading aws config
* remove underscore from test name
* remove loop var reassignment
* Move imds related code into their own packages
Separating imds from cloud vm, kubernetes, etc. prevents the
dependency tree expanding to include extra cloud related things
for callers that only require an imds client.
* Move cloud constructors for types.KubeCluster out of lib/services
lib/services is meant to be a relatively dependency free package
that provides basic interfaces and functions for dealing with
types. NewKubeClusterFromGCPGKE, NewKubeClusterFromAWSEKS, NewKubeClusterFromAzureAKS
caused a slew of cloud related dependencies to be imported in
lib/services which increases binary sizes of client tools.
They have all been moved into lib/srv/discovery/common since
they were only consumed by other code in lib/srv/discovery.
* Decouple servicecfg and lib/auth/keystore
This was the last remaining way for lib/cloud/gcp to slip
into client tools that aren't importing lib/auth directly.
```
goda tree "reach(github.com/gravitational/teleport/tool/tctl...:all, cloud.google.com/go/compute/apiv1)"
├ github.com/gravitational/teleport/tool/tctl
└ github.com/gravitational/teleport/tool/tctl/common
├ github.com/gravitational/teleport/lib/config
├ github.com/gravitational/teleport/lib/pam
└ github.com/gravitational/teleport/lib/service/servicecfg
└ github.com/gravitational/teleport/lib/auth/keystore
└ github.com/gravitational/teleport/lib/cloud
└ github.com/gravitational/teleport/lib/cloud/gcp
└ cloud.google.com/go/compute/apiv1
└ github.com/gravitational/teleport/lib/service/servicecfg ~
├ github.com/gravitational/teleport/lib/service/servicecfg ~
├ github.com/gravitational/teleport/tool/tctl/common/accessmonitoring
└ github.com/gravitational/teleport/lib/service/servicecfg ~
├ github.com/gravitational/teleport/tool/tctl/common/loginrule
└ github.com/gravitational/teleport/lib/service/servicecfg ~
├ github.com/gravitational/teleport/tool/tctl/sso/configure
├ github.com/gravitational/teleport/lib/service/servicecfg ~
└ github.com/gravitational/teleport/tool/tctl/sso/tester
└ github.com/gravitational/teleport/lib/service/servicecfg ~
└ github.com/gravitational/teleport/tool/tctl/sso/tester ~
```
* fix lints
* tidy integrations/event-handler
* fix license
* fix: only populate cloud clients if aws kms configured
Adds the new linter and configures it to prevent direct error
comparisions and type assertions in favor of errors.Is and errors.As.
All current violations caught by the linter have been updated
accordingly.