When the AWS Account ID is provided, we must check that it is a valid
one.
AWS Account ID is a well documented field: 12-digit string
This check is meant to prevent typos when creating Databases mainly from
the Web UI in the context of Teleport Discover.
When testing the "not available" case, this test closed the server
and waited for the AWS SDK to make several attempts before finally
giving up.
Instead of shutting down the server, return an error. This triggers
the same error handling branches, but doesn't require multiple
attempts by the SDK.
Before:
$ go test -run TestEC2IsInstanceMetadataAvailable ./lib/cloud/aws -count=1
ok github.com/gravitational/teleport/lib/cloud/aws 4.272s
After:
$ go test -run TestEC2IsInstanceMetadataAvailable ./lib/cloud/aws -count=1
ok github.com/gravitational/teleport/lib/cloud/aws 0.262s