Cloud CLIs
Functions of the tools module at v0.3.2. Each returns what a command runs in; import it with import * as tools from "tools".
aws
The AWS CLI v2, configured by its parameters.
aws(
--image: Environment = #amazon/aws-cli:2.36.41,
--profile: String | Null = null,
--region: String | Null = null,
--endpoint_url: String | Null = null,
--access_key_id: String | Null = null,
--secret_access_key: String | Null = <secret>,
--session_token: String | Null = <secret>,
--config_dir: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is #amazon/aws-cli:2.36.41 unless --image names another. lask sync pulls and pins whichever image is used (lask spec 10.3); a run never pulls.
Locally, log in on the host (aws sso login) and mount the result with config_dir = home(".aws"); the mount is read-only, so an expired token fails rather than being refreshed, and the fix is to log in again on the host. In CI, pass the three credentials instead. A container sees no variable of the host unless it is given here.
The pager is off by default (AWS_PAGER=""), so output is never held behind less; --extra_env can turn it back on.
Parameters
--imageThe image to run; another release is passed as image = #amazon/aws-cli:<tag>.--profileAWS_PROFILE: a profile from the config directory.--regionAWS_REGION and AWS_DEFAULT_REGION.--endpoint_urlAWS_ENDPOINT_URL, for LocalStack or another AWS-compatible endpoint.--access_key_idAWS_ACCESS_KEY_ID.--secret_access_key!!AWS_SECRET_ACCESS_KEY; masked in the command log.--session_token!!AWS_SESSION_TOKEN; masked in the command log.--config_dirHost directory mounted read-only as /root/.aws, usually home(".aws").--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "aws" } on ... or $[...].
Image amazon/aws-cli:2.36.41
lask eval aws --profile dev --region ap-northeast-1gcloud
The Google Cloud CLI (gcloud, gsutil, bq), configured by its parameters.
gcloud(
--image: Environment = #gcr.io/google.com/cloudsdktool/google-cloud-cli:586.0.0-slim,
--project: String | Null = null,
--region: String | Null = null,
--credentials_file: String | Null = null,
--access_token: String | Null = <secret>,
--config_dir: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is #gcr.io/google.com/cloudsdktool/google-cloud-cli:586.0.0-slim unless --image names another; the Docker Hub copy, google/cloud-sdk, is published for amd64 only. lask sync pulls and pins whichever image is used (lask spec 10.3); a run never pulls.
gcloud never prompts (CLOUDSDK_CORE_DISABLE_PROMPTS=1). Locally, log in on the host (gcloud auth login, gcloud auth application-default login) and pass config_dir = home(".config/gcloud"). In CI, pass a credentials file or an access token.
Parameters
--imageThe image to run; another release is passed as image = #gcr.io/google.com/cloudsdktool/google-cloud-cli:<tag>.--projectCLOUDSDK_CORE_PROJECT and GOOGLE_CLOUD_PROJECT.--regionCLOUDSDK_COMPUTE_REGION and GOOGLE_REGION.--credentials_fileHost path of a credentials file, mounted read-only.--access_token!!CLOUDSDK_AUTH_ACCESS_TOKEN and GOOGLE_OAUTH_ACCESS_TOKEN; masked in the command log.--config_dirHost directory mounted as /root/.config/gcloud.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "gcloud" } on ... or $[...].
Image gcr.io/google.com/cloudsdktool/google-cloud-cli:586.0.0-slim
lask eval gcloud --project my-project --region asia-northeast1az
The Azure CLI, configured by its parameters.
az(
--image: Environment = #mcr.microsoft.com/azure-cli:2.90.0,
--subscription_id: String | Null = null,
--tenant_id: String | Null = null,
--client_id: String | Null = null,
--client_secret: String | Null = <secret>,
--config_dir: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is #mcr.microsoft.com/azure-cli:2.90.0 unless --image names another. lask sync pulls and pins whichever image is used (lask spec 10.3); a run never pulls.
Telemetry is off (AZURE_CORE_COLLECT_TELEMETRY=false). Locally, log in on the host (az login) and pass config_dir = home(".azure"). az does not log in from variables by itself: in CI, pass the service principal and start the command with az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET" --tenant "$AZURE_TENANT_ID".
Parameters
--imageThe image to run; another release is passed as image = #mcr.microsoft.com/azure-cli:<tag>.--subscription_idARM_SUBSCRIPTION_ID and AZURE_SUBSCRIPTION_ID.--tenant_idARM_TENANT_ID and AZURE_TENANT_ID.--client_idARM_CLIENT_ID and AZURE_CLIENT_ID.--client_secret!!ARM_CLIENT_SECRET and AZURE_CLIENT_SECRET; masked in the command log.--config_dirHost directory mounted as /root/.azure.--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "az" } on ... or $[...].
Image mcr.microsoft.com/azure-cli:2.90.0
lask eval az --subscription_id 00000000-0000-0000-0000-000000000000