Expand description
The cloud accounts this computer’s cloud CLIs are signed in to, asked through those CLIs:
whether a sign-in still reaches its provider (Failure with Refusal::CredentialsExpired
when it ran out or is missing), who it is, and what the account offers: AWS’s profiles, its
spend this month and whether it may create instances (aws), Azure’s subscriptions, the VM
sizes a region offers a subscription and its core quotas (azure), Google Cloud’s billing
accounts and organizations (gcp), and Oracle Cloud’s compartments and config file
(oci).
Each CLI is one adapter here: its argument lists, its runs (through the context’s runner, each
within CLI_TIMEOUT) and the reading of its answers, a refusal read from its words (each
wording backed by a fixture of the CLI’s, under cloud/fixtures/<cli>/). What the answers mean
to a user, and how a refusal is put to them, is the caller’s.
Re-exports§
pub use token::TokenError;pub use token::digitalocean;pub use token::linode;
Modules§
- aws
- AWS, through the AWS CLI: who an account’s credentials are, the CLI’s profiles, this month’s spend (Cost Explorer), and whether the account may create EC2 instances (a dry run, which creates nothing). An account signs in with the CLI’s own credentials (its default chain, or a profile), or with an access key, given to the CLI’s official container (Docker is all that needs).
- azure
- Azure, through the Azure CLI (
az): whether its sign-in holds, the subscriptions it can see, and what a subscription may create in a region: the VM sizes Azure lists for it there (each with the reason Azure refuses it to that subscription, if it does) and its core quotas. - gcp
- Google Cloud, through the Google Cloud CLI (
gcloud): the account it is signed in as, whether its own sign-in and the application-default one (what Terraform’s Google provider reads) still hold, the billing accounts and organizations the account can see, and its projects: what state one is in, and making one ready for deployments (created, linked to a billing account, an API enabled) or deleting it. - oci
- Oracle Cloud, through the OCI CLI (
oci) and the config file it and Terraform’s provider sign in with (~/.oci/config, an API key): whether that sign-in holds, a compartment’s name, and the config file’s default profile. - token
- Clouds whose credential is an API token alone: whether a token still signs in, asked of the
provider’s own
accountendpoint over HTTPS (no CLI to ask). DigitalOcean’s (digitalocean) and Linode’s (linode). What a refusal means to a user is the caller’s.
Enums§
Constants§
- CLI_
TIMEOUT - How long a cloud CLI’s answer may take: a call over the network to the provider, slower than a local probe.
Functions§
- cli
- The CLI a cloud’s account is signed in with on this computer:
aws,az,gcloud,oci. None for a cloud whose credential is an API token alone (DigitalOcean, Linode). - sign_in
- Signs in to a cloud in the browser through its CLI (
SignIn):on_linegets the command ($ az login), then each line the CLI prints, until it ends. No time limit: the browser waits for its user; dropping the future ends the CLI (the runner’s), which is how a caller cancels it or gives it a limit.