zuke.tools.aws
@zuke/aws 1.2.1: @zuke/aws — typed AWS CLI tasks, readers, and a canary platform and analysis.
zuke on PyPI ↗ 50 symbols
Symbols
class AwsCloudformationDeleteStackSettings(AwsSettings) Settings for aws cloudformation delete-stack.
-
stack_name(name: str) -> SelfThe stack to delete (
--stack-name). -
role_arn(arn: str) -> SelfThe role CloudFormation assumes to delete (
--role-arn). -
retain_resources(*ids: str) -> SelfLogical ids to keep when a delete is retried (
--retain-resources).
class AwsCloudformationDeploySettings(AwsSettings) Settings for aws cloudformation deploy.
-
template_file(path: str) -> SelfThe template to deploy (
--template-file). -
stack_name(name: str) -> SelfThe stack to create or update (
--stack-name). -
parameter_override(key: str, value: str) -> SelfSet a template parameter (
--parameter-overrides Key=Value); repeatable. -
capabilities(*values: str) -> SelfAcknowledge what the template creates (
--capabilities), e.g."CAPABILITY_IAM". -
tag(key: str, value: str) -> SelfTag the stack and its resources (
--tags Key=Value); repeatable. -
no_execute_changeset() -> SelfCreate the change set without executing it (
--no-execute-changeset). -
no_fail_on_empty_changeset() -> SelfExit 0 when there is nothing to change (
--no-fail-on-empty-changeset). -
role_arn(arn: str) -> SelfThe role CloudFormation assumes to deploy (
--role-arn). -
s3_bucket(name: str) -> SelfThe bucket a large template is uploaded to (
--s3-bucket). -
s3_prefix(prefix: str) -> SelfThe key prefix for that upload (
--s3-prefix). -
kms_key_id(id: str) -> SelfThe KMS key that encrypts that upload (
--kms-key-id).
class AwsCloudformationDescribeStacksSettings(AwsSettings) Settings for aws cloudformation describe-stacks.
-
stack_name(name: str) -> SelfThe stack to describe (
--stack-name); every stack when omitted.
class AwsCloudformationWaitSettings(AwsSettings) Settings for aws cloudformation wait <waiter>: block until the stack reaches the waiter's state. The CLI polls every 30 seconds and exits non-zero after 120 attempts, or as soon as the stack lands in a failed state — which surfaces as a CommandError.
-
waiter(name: Literal['stack-create-complete', 'stack-update-complete', 'stack-delete-complete', 'stack-import-complete', 'stack-rollback-complete', 'stack-exists']) -> SelfThe state to wait for, e.g.
"stack-update-complete". -
stack_name(name: str) -> SelfThe stack to wait on (
--stack-name).
class AwsCloudwatchDescribeAlarmsSettings(AwsSettings) Settings for aws cloudwatch describe-alarms.
-
alarm_names(*names: str) -> SelfOnly these alarms (
--alarm-names); repeatable. -
alarm_name_prefix(prefix: str) -> SelfOnly alarms whose name starts with this (
--alarm-name-prefix). -
state_value(state: Literal['OK', 'ALARM', 'INSUFFICIENT_DATA']) -> SelfOnly alarms in this state (
--state-value). -
alarm_types(*types: Literal['MetricAlarm', 'CompositeAlarm', 'LogAlarm']) -> SelfThe kinds of alarm to return (
--alarm-types): metric, composite or log alarms; replaces any set before. Without it the CLI returns metric alarms only.
class AwsCloudwatchExpressionSettings(Settings) Settings for one metric-math expression in a get-metric-data request.
-
label(text: str) -> SelfA label for the series in the response.
-
period(seconds: float) -> SelfThe period in seconds, for an expression that has no metric to take it from.
-
return_data(value: bool) -> SelfWhether the response carries this series (default
true).
class AwsCloudwatchGetMetricDataSettings(AwsSettings) Settings for aws cloudwatch get-metric-data.
-
metric_stat(id: str, configure: Callable[[AwsCloudwatchMetricStatSettings], AwsCloudwatchMetricStatSettings]) -> SelfAdd a metric to the request, under
id, configured byconfigure. -
expression(id: str, expression: str, configure: Callable[[AwsCloudwatchExpressionSettings], AwsCloudwatchExpressionSettings] | None=None) -> SelfAdd a metric-math expression over the request's other ids, e.g.
("ratio", "100 * errors / requests"). -
start_time(time: str) -> SelfThe start of the range (
--start-time). -
end_time(time: str) -> SelfThe end of the range (
--end-time). -
window(duration: str | float, end: str | None=None) -> SelfThe
duration("15m", or milliseconds) up toend— now, unless given — as--start-timeand--end-time. -
scan_by(order: Literal['TimestampDescending', 'TimestampAscending']) -> SelfThe order of the datapoints (
--scan-by); newest first by default. -
max_datapoints(count: float) -> SelfThe most datapoints to return (
--max-datapoints). Setting it turns off the CLI's automatic pagination — the CLI treats it as a page size and returns one page with aNextToken— so the answer may hold only part of the window.AwsTasks.metricValuerefuses it for that reason.
class AwsCloudwatchGetMetricStatisticsSettings(AwsSettings) Settings for aws cloudwatch get-metric-statistics.
-
namespace(value: str) -> SelfThe metric's namespace (
--namespace). -
metric_name(value: str) -> SelfThe metric's name (
--metric-name). -
dimension(name: str, value: str) -> SelfA dimension that picks the series (
--dimensions); repeatable. -
start_time(time: str) -> SelfThe start of the range (
--start-time). -
end_time(time: str) -> SelfThe end of the range (
--end-time). -
window(duration: str | float, end: str | None=None) -> SelfThe
durationup toend— now, unless given — as the time range. -
period(seconds: float) -> SelfThe aggregation period in seconds (
--period). -
statistics(*values: Literal['SampleCount', 'Average', 'Sum', 'Minimum', 'Maximum']) -> SelfThe basic statistics to return (
--statistics), e.g."Sum". -
extended_statistics(*values: str) -> SelfPercentiles and other extended statistics (
--extended-statistics), e.g."p99". -
unit(value: str) -> SelfOnly datapoints published in this unit (
--unit).
class AwsCloudwatchMetricStatSettings(Settings) Settings for one metric in a get-metric-data request (a MetricStat query).
-
namespace(value: str) -> SelfThe metric's namespace, e.g.
"AWS/ApplicationELB". -
metric_name(value: str) -> SelfThe metric's name, e.g.
"HTTPCode_Target_5XX_Count". -
dimension(name: str, value: str) -> SelfA dimension that picks the series, e.g.
("LoadBalancer", "app/web/1f2e"); repeatable. -
period(seconds: float) -> SelfThe aggregation period in seconds (default 60). CloudWatch accepts 1, 5, 10, 20, 30, or a multiple of 60.
-
stat(value: Literal['SampleCount', 'Average', 'Sum', 'Minimum', 'Maximum', 'IQM']) -> SelfThe statistic:
"Sum","Average","Maximum","p99", … -
unit(value: str) -> SelfOnly datapoints published in this unit, e.g.
"Count". -
label(text: str) -> SelfA label for the series in the response.
-
return_data(value: bool) -> SelfWhether the response carries this series (default
true). Passfalsefor a metric that only feeds an expression.
class AwsCloudwatchMetricValueSettings(AwsCloudwatchGetMetricDataSettings) Settings for AwsTasks.metricValue: a get-metric-data request, and how to read it.
-
id(query_id: str) -> SelfThe series to read, by query id. Needed only when the request returns more than one — hide the inputs of an expression with
.returnData(false)and it is not. -
aggregate(how: Literal['latest', 'sum', 'average', 'maximum', 'minimum']) -> SelfHow to turn the series into one number (default
"latest", the newest datapoint). An aggregate combines the datapoints the window holds: a"sum"of per-minuteSums is the window's total. -
missing_data_as(value: float) -> SelfReturn
valuewhen the series has no datapoints, instead of failing. CloudWatch publishes nothing for a period with no events, so for a count of errors, no data does mean0; for a latency or a CPU reading it usually means the query is looking in the wrong place.
class AwsConfigureGetSettings(AwsSettings) Settings for aws configure get.
Reading a credential — aws_secret_access_key, aws_session_token, in any profile — runs quietly and registers what it printed with the run's redactor.
-
varname(name: str) -> SelfThe setting to read (positional), e.g.
"region".
class AwsConfigureSetSettings(AwsSettings) Settings for aws configure set.
aws configure set takes the value on its command line, where every user on the host can read it from the process table. Setting aws_secret_access_key or aws_session_token this way registers the value with the run's redactor so Zuke's own output masks it, but that does not hide it from the process table — prefer the AWS_* environment variables or a role for credentials.
-
varname(name: str) -> SelfThe setting to write (positional), e.g.
"region". -
value(text: str) -> SelfThe value to write (positional).
class AwsEcrBatchDeleteImageSettings(AwsSettings) Settings for aws ecr batch-delete-image.
-
repository_name(name: str) -> SelfThe repository to delete from (
--repository-name). -
registry_id(id: str) -> SelfThe registry's account id, when not the caller's (
--registry-id). -
image_tag(tag: str) -> SelfDelete the image with this tag (
--image-ids); repeatable. -
image_digest(digest: str) -> SelfDelete the image with this digest (
--image-ids); repeatable.
class AwsEcrDescribeImagesSettings(AwsSettings) Settings for aws ecr describe-images.
-
repository_name(name: str) -> SelfThe repository to describe (
--repository-name). -
registry_id(id: str) -> SelfThe registry's account id, when not the caller's (
--registry-id). -
image_tag(tag: str) -> SelfDescribe the image with this tag (
--image-ids); repeatable. -
image_digest(digest: str) -> SelfDescribe the image with this digest (
--image-ids); repeatable. -
tag_status(status: Literal['TAGGED', 'UNTAGGED', 'ANY']) -> SelfOnly images with this tag status (
--filter tagStatus=…).
class AwsEcrDescribeRepositoriesSettings(AwsSettings) Settings for aws ecr describe-repositories.
-
repository_names(*names: str) -> SelfOnly these repositories (
--repository-names); all when omitted. -
registry_id(id: str) -> SelfThe registry's account id, when not the caller's (
--registry-id).
class AwsEcrGetLoginPasswordSettings(AwsSettings) Settings for aws ecr get-login-password.
The password is a registry credential, so the command always runs quietly and the password is registered with the run's redactor once it returns. Hand it to docker login --password-stdin (DockerTasks.login with .passwordStdin(...)), never to -p.
class AwsEcsDescribeServicesSettings(AwsSettings) Settings for aws ecs describe-services.
-
cluster(name: str) -> SelfThe cluster the services run in (
--cluster). -
services(*names: str) -> SelfThe services to describe (
--services); repeatable.
class AwsEcsRegisterTaskDefinitionSettings(AwsSettings) Settings for aws ecs register-task-definition.
Either hand the whole definition over with cliInputJson — the usual form, a file:// path to a JSON document — or set the family and its container definitions. Environment values in a container definition land on the command line; keep secrets in the definition's secrets (Secrets Manager or SSM references) rather than its environment.
-
cli_input_json(value: str) -> SelfThe whole request as JSON (
--cli-input-json): afile://path to the document, or the document itself. -
family(name: str) -> SelfThe task definition family (
--family). -
container_definitions(json: str) -> SelfThe container definitions, as a JSON array or a
file://path (--container-definitions). -
task_role_arn(arn: str) -> SelfThe role the task's containers assume (
--task-role-arn). -
execution_role_arn(arn: str) -> SelfThe role ECS uses to pull images and read secrets (
--execution-role-arn). -
network_mode(mode: str) -> SelfThe Docker networking mode (
--network-mode), e.g."awsvpc". -
requires_compatibilities(*types: str) -> SelfThe launch types the definition must suit (
--requires-compatibilities). -
cpu(value: str) -> SelfCPU units for the task (
--cpu), e.g."256". -
memory(value: str) -> SelfMemory for the task in MiB (
--memory), e.g."512".
class AwsEcsRunTaskSettings(AwsSettings) Settings for aws ecs run-task.
-
cluster(name: str) -> SelfThe cluster to run the task in (
--cluster). -
task_definition(value: str) -> SelfThe task definition to run (
--task-definition). -
count(value: float) -> SelfHow many copies to start (
--count). -
launch_type(value: str) -> SelfThe launch type (
--launch-type):"FARGATE","EC2"or"EXTERNAL". -
network_configuration(json: str) -> SelfThe
awsvpcnetwork configuration, as JSON (--network-configuration). -
overrides(json: str) -> SelfContainer overrides, as JSON (
--overrides). -
started_by(value: str) -> SelfA label for who started the task (
--started-by). -
group(name: str) -> SelfThe task group name (
--group).
class AwsEcsUpdateServiceSettings(AwsSettings) Settings for aws ecs update-service.
-
cluster(name: str) -> SelfThe cluster the service runs in (
--cluster); the default cluster when omitted. -
service(name: str) -> SelfThe service to update (
--service). -
task_definition(value: str) -> SelfThe task definition to run, as
family:revisionor an ARN (--task-definition). -
desired_count(count: float) -> SelfHow many tasks to keep running (
--desired-count). -
force_new_deployment() -> SelfStart a new deployment even when nothing changed (
--force-new-deployment). -
health_check_grace_period_seconds(seconds: float) -> SelfSeconds to ignore failing health checks after a task starts (
--health-check-grace-period-seconds).
class AwsEcsWaitServicesStableSettings(AwsSettings) Settings for aws ecs wait services-stable: block until every named service has its desired count running on one deployment. The CLI polls every 15 seconds and gives up after 40 attempts with a non-zero exit, which surfaces as a CommandError.
-
cluster(name: str) -> SelfThe cluster the services run in (
--cluster). -
services(*names: str) -> SelfThe services to wait for (
--services); repeatable.
class AwsEksDescribeClusterSettings(AwsSettings) Settings for aws eks describe-cluster.
-
name(cluster: str) -> SelfThe cluster (
--name).
class AwsEksUpdateKubeconfigSettings(AwsSettings) Settings for aws eks update-kubeconfig.
-
name(cluster: str) -> SelfThe cluster (
--name). -
kubeconfig(path: str) -> SelfThe kubeconfig file to write (
--kubeconfig);~/.kube/configby default. -
alias(name: str) -> SelfThe context's name (
--alias); the cluster ARN by default. -
user_alias(name: str) -> SelfThe user entry's name (
--user-alias). -
role_arn(arn: str) -> SelfA role to assume when authenticating to the cluster (
--role-arn). -
dry_run() -> SelfPrint the configuration instead of writing it (
--dry-run).
class AwsLambdaGetAliasSettings(AwsSettings) Settings for aws lambda get-alias.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
name(alias: str) -> SelfThe alias to describe (
--name), e.g."live".
class AwsLambdaGetFunctionSettings(AwsSettings) Settings for aws lambda get-function.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
qualifier(value: str) -> SelfA version or alias to describe instead of
$LATEST(--qualifier).
class AwsLambdaInvokeSettings(AwsSettings) Settings for aws lambda invoke.
The function's response is written to the outfile; what the CLI prints is the invocation's status. A function that throws still exits 0: the CLI reports it in the printed FunctionError field, so read that (or the outfile) before treating an invocation as a success.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
payload(json: str) -> SelfThe event to send, as JSON text (
--payload). AWS CLI v2 reads a payload as base64 unless told otherwise, so this also passes--cli-binary-format raw-in-base64-outto send the text as it is. -
invocation_type(value: Literal['RequestResponse', 'Event', 'DryRun']) -> SelfWait for the response, queue the event, or only check access (
--invocation-type). -
log_type(value: Literal['None', 'Tail']) -> Self"Tail"returns the last 4 KB of the execution log, base64-encoded (--log-type). -
qualifier(value: str) -> SelfA version or alias to invoke (
--qualifier). -
outfile(path: str) -> SelfThe file the function's response is written to (positional).
class AwsLambdaPublishVersionSettings(AwsSettings) Settings for aws lambda publish-version.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
description(text: str) -> SelfA description of the version (
--description). -
code_sha256(hash: str) -> SelfPublish only if the code still has this SHA-256 (
--code-sha256). -
revision_id(id: str) -> SelfPublish only if the function is still at this revision (
--revision-id).
class AwsLambdaUpdateAliasSettings(AwsSettings) Settings for aws lambda update-alias.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
name(alias: str) -> SelfThe alias to move (
--name), e.g."live". -
function_version(version: str) -> SelfThe version the alias points at (
--function-version). -
description(text: str) -> SelfA description of the alias (
--description). -
additional_version_weight(version: str, weight: float) -> SelfSend a share of the alias's traffic to another version (
--routing-config AdditionalVersionWeights), as a fraction from 0 to 1; repeatable. The rest goes to functionVersion. -
revision_id(id: str) -> SelfUpdate only if the alias is still at this revision (
--revision-id) — theRevisionIdaget-aliasread, so a change made in between fails the update instead of being overwritten. -
clear_routing() -> SelfClear the alias's weighted routing, sending all traffic to its version (
--routing-configwith no additional weights).
class AwsLambdaUpdateFunctionCodeSettings(AwsSettings) Settings for aws lambda update-function-code.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
zip_file(path: str) -> SelfThe deployment package on disk (
--zip-file). The CLI reads the file when the path carries itsfileb://prefix, which this adds unless the path already has it. -
s3_bucket(name: str) -> SelfThe bucket holding the deployment package (
--s3-bucket). -
s3_key(key: str) -> SelfThe package's key in that bucket (
--s3-key). -
s3_object_version(version: str) -> SelfThe package object's version (
--s3-object-version). -
image_uri(uri: str) -> SelfThe container image, for an image-packaged function (
--image-uri). -
publish() -> SelfPublish a new version once the code is updated (
--publish). -
dry_run() -> SelfValidate the request without updating the function (
--dry-run). -
revision_id(id: str) -> SelfUpdate only if the function is still at this revision (
--revision-id). -
architectures(*values: str) -> SelfThe instruction set architectures (
--architectures), e.g."arm64".
class AwsLambdaUpdateFunctionConfigurationSettings(AwsSettings) Settings for aws lambda update-function-configuration.
-
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
environment(variables: Mapping[str, str]) -> SelfThe function's environment variables (
--environment). This replaces the whole set — a variable left out is removed — and the values travel on the command line, so keep secrets in Secrets Manager or SSM and pass their names instead. -
timeout(seconds: float) -> SelfThe longest an invocation may run, in seconds (
--timeout). -
memory_size(mib: float) -> SelfMemory for the function in MiB (
--memory-size). -
handler(name: str) -> SelfThe handler entry point (
--handler), e.g."index.handler". -
runtime(name: str) -> SelfThe runtime (
--runtime), e.g."nodejs22.x". -
role(arn: str) -> SelfThe execution role's ARN (
--role). -
description(text: str) -> SelfA description of the function (
--description). -
layers(*arns: str) -> SelfThe layers to attach, by version ARN (
--layers); replaces the set.
class AwsLambdaWaitSettings(AwsSettings) Settings for aws lambda wait: poll the function until it reaches the state named, exiting non-zero — a CommandError — when it fails or the waiter gives up.
-
waiter(name: Literal['function-active', 'function-active-v2', 'function-exists', 'function-updated', 'function-updated-v2', 'published-version-active']) -> SelfThe state to wait for, e.g.
"published-version-active". -
function_name(name: str) -> SelfThe function's name or ARN (
--function-name). -
qualifier(value: str) -> SelfThe version or alias to wait on (
--qualifier).
class AwsLogsFilterLogEventsSettings(AwsSettings) Settings for aws logs filter-log-events.
-
log_group_name(name: str) -> SelfThe log group to search (
--log-group-name). -
log_stream_names(*names: str) -> SelfOnly these streams (
--log-stream-names); repeatable. -
log_stream_name_prefix(prefix: str) -> SelfOnly streams whose name starts with this (
--log-stream-name-prefix). -
filter_pattern(pattern: str) -> SelfA CloudWatch Logs filter pattern (
--filter-pattern), e.g."ERROR". -
start_time(time: str) -> SelfThe start of the range (
--start-time, sent as epoch milliseconds). -
end_time(time: str) -> SelfThe end of the range (
--end-time, sent as epoch milliseconds). -
window(duration: str | float, end: str | None=None) -> SelfThe
durationup toend— now, unless given — as the time range.
class AwsLogsGetQueryResultsSettings(AwsSettings) Settings for aws logs get-query-results.
-
query_id(id: str) -> SelfThe id
start-queryreturned (--query-id). -
next_token(token: str) -> SelfThe page after the one that returned this token (
--next-token).
class AwsLogsInsightsQuerySettings(Settings) Settings for AwsTasks.logsInsightsQuery: the query, and how long to wait for it.
-
log_group_names(*names: str) -> SelfThe log groups to query (
--log-group-names); repeatable. -
query_string(query: str) -> SelfThe Logs Insights query (
--query-string). -
start_time(time: str) -> SelfThe start of the range.
-
end_time(time: str) -> SelfThe end of the range.
-
window(duration: str | float, end: str | None=None) -> SelfThe
durationup toend— now, unless given — as the time range. -
limit(rows: float) -> SelfThe most rows to return (
--limit). -
timeout(duration: str | float) -> SelfHow long to wait for the query to finish (
"2m", or ms; default 5 minutes). A query still running then is stopped, and the reader fails. -
poll_interval(duration: str | float) -> SelfThe pause between polls for the results (
"2s", or ms; default 1 second). -
aws(configure: Callable[[AwsSettings], AwsSettings]) -> SelfGlobal options for every command the query runs —
(a) => a.profile("prod").region("eu-west-1"), a.toolPath(...), or a.runner(...).
class AwsLogsStartQuerySettings(AwsSettings) Settings for aws logs start-query.
-
log_group_names(*names: str) -> SelfThe log groups to query (
--log-group-names); repeatable. -
query_string(query: str) -> SelfThe Logs Insights query (
--query-string). -
start_time(time: str) -> SelfThe start of the range (
--start-time, sent as epoch seconds). -
end_time(time: str) -> SelfThe end of the range (
--end-time, sent as epoch seconds). -
window(duration: str | float, end: str | None=None) -> SelfThe
durationup toend— now, unless given — as the time range. -
limit(rows: float) -> SelfThe most rows to return (
--limit).
class AwsLogsStopQuerySettings(AwsSettings) Settings for aws logs stop-query.
-
query_id(id: str) -> SelfThe id
start-queryreturned (--query-id).
class AwsLogsTailSettings(AwsSettings) Settings for aws logs tail. With follow the command never ends on its own — bound it with .killAfter(ms).
-
group_name(name: str) -> SelfThe log group to tail (positional).
-
since(value: str) -> SelfHow far back to start (
--since), e.g."10m"or an ISO timestamp. -
follow() -> SelfKeep printing new events as they arrive (
--follow). -
filter_pattern(pattern: str) -> SelfA CloudWatch Logs filter pattern (
--filter-pattern). -
format(value: Literal['detailed', 'short', 'json']) -> SelfHow each event is printed (
--format). -
log_stream_names(*names: str) -> SelfOnly these streams (
--log-stream-names); repeatable. -
log_stream_name_prefix(prefix: str) -> SelfOnly streams whose name starts with this (
--log-stream-name-prefix).
class AwsS3CpSettings(AwsSettings) Settings for aws s3 cp.
-
source(path: str) -> SelfThe local path or
s3://URI to copy from (positional). -
destination(path: str) -> SelfThe local path or
s3://URI to copy to (positional). -
recursive() -> SelfCopy every file under a directory or prefix (
--recursive). -
exclude(pattern: str) -> SelfSkip files matching the pattern (
--exclude); repeatable, order kept. -
include(pattern: str) -> SelfCopy files matching the pattern despite an earlier exclude (
--include). -
dryrun() -> SelfPrint what would be copied without copying it (
--dryrun). -
acl(value: str) -> SelfA canned ACL for the uploaded objects (
--acl), e.g."private". -
content_type(value: str) -> SelfThe uploaded objects' content type (
--content-type). -
cache_control(value: str) -> SelfThe uploaded objects'
Cache-Control(--cache-control). -
storage_class(value: str) -> SelfThe storage class for the uploaded objects (
--storage-class). -
sse(value: str) -> SelfServer-side encryption (
--sse):"AES256"or"aws:kms". -
sse_kms_key_id(id: str) -> SelfThe KMS key for
aws:kmsserver-side encryption (--sse-kms-key-id). -
only_show_errors() -> SelfPrint only errors and warnings (
--only-show-errors). -
no_progress() -> SelfLeave out the file-transfer progress lines (
--no-progress).
class AwsS3LsSettings(AwsSettings) Settings for aws s3 ls.
-
path(uri: str) -> SelfThe
s3://URI to list (positional); the buckets when omitted. -
recursive() -> SelfList every object under the prefix (
--recursive). -
human_readable() -> SelfPrint sizes as KiB, MiB, … (
--human-readable). -
summarize() -> SelfPrint the object count and total size (
--summarize).
class AwsS3MbSettings(AwsSettings) Settings for aws s3 mb.
-
bucket(uri: str) -> SelfThe bucket to make, as an
s3://URI (positional).
class AwsS3PresignSettings(AwsSettings) Settings for aws s3 presign.
A presigned URL is a bearer credential for the object until it expires: anyone holding it can read the object, and when the build runs on temporary credentials it also carries the session token itself (X-Amz-Security-Token), which is good for far more than one object. So the command always runs quietly — the URL is captured, never streamed — and the URL and that token are registered with the run's redactor.
-
path(uri: str) -> SelfThe
s3://object to presign (positional). -
expires_in(seconds: float) -> SelfHow long the URL stays valid, in seconds (
--expires-in; default 3600).
class AwsS3RmSettings(AwsSettings) Settings for aws s3 rm.
-
path(uri: str) -> SelfThe
s3://object or prefix to remove (positional). -
recursive() -> SelfRemove every object under the prefix (
--recursive). -
exclude(pattern: str) -> SelfKeep objects matching the pattern (
--exclude); repeatable, order kept. -
include(pattern: str) -> SelfRemove objects matching the pattern despite an earlier exclude (
--include). -
dryrun() -> SelfPrint what would be removed without removing it (
--dryrun).
class AwsS3SyncSettings(AwsSettings) Settings for aws s3 sync.
-
source(path: str) -> SelfThe local directory or
s3://prefix to sync from (positional). -
destination(path: str) -> SelfThe local directory or
s3://prefix to sync to (positional). -
delete() -> SelfDelete files at the destination that the source does not have (
--delete), which makes the destination a mirror rather than a superset. -
exclude(pattern: str) -> SelfSkip files matching the pattern (
--exclude); repeatable, order kept. -
include(pattern: str) -> SelfSync files matching the pattern despite an earlier exclude (
--include). -
dryrun() -> SelfPrint what would change without changing it (
--dryrun). -
exact_timestamps() -> SelfTreat same-size files with different timestamps as changed (
--exact-timestamps). -
size_only() -> SelfCompare by size alone, ignoring timestamps (
--size-only). -
acl(value: str) -> SelfA canned ACL for the uploaded objects (
--acl). -
content_type(value: str) -> SelfThe uploaded objects' content type (
--content-type). -
cache_control(value: str) -> SelfThe uploaded objects'
Cache-Control(--cache-control). -
storage_class(value: str) -> SelfThe storage class for the uploaded objects (
--storage-class). -
only_show_errors() -> SelfPrint only errors and warnings (
--only-show-errors). -
no_progress() -> SelfLeave out the file-transfer progress lines (
--no-progress).
class AwsSecretsmanagerGetSecretValueSettings(AwsSettings) Settings for aws secretsmanager get-secret-value.
The response is the secret, so the command always runs quietly — captured, never streamed — with --output json pinned, and the SecretString or SecretBinary it returns is registered with the run's redactor.
-
secret_id(id: str) -> SelfThe secret's name or ARN (
--secret-id). -
version_id(id: str) -> SelfA specific version, by id (
--version-id). -
version_stage(label: str) -> SelfA specific version, by staging label (
--version-stage);AWSCURRENTby default.
class AwsSettings(SubcommandSettings) Settings for an aws invocation.
Every instance sets two variables in the child's environment so the CLI can never sit waiting for a keypress in a build: AWS_PAGER to the empty string (CLI v2 pipes output through less by default) and AWS_CLI_AUTO_PROMPT to off (a profile's cli_auto_prompt would otherwise open the interactive prompt). Setting them there keeps the argv exactly what the settings say; override either with .env({...}), or add the explicit flag with noCliPager.
-
profile(name: str) -> SelfThe named profile from the shared config and credentials files (
--profile). -
region(name: str) -> SelfThe AWS Region to send the request to (
--region), e.g."eu-west-1". -
output(format: Literal['json', 'text', 'table', 'yaml', 'yaml-stream', 'off']) -> SelfThe output format (
--output):json,text,table,yamloryaml-stream. -
query(expression: str) -> SelfA JMESPath expression that filters the response (
--query). -
endpoint_url(url: str) -> SelfSend the request to this URL instead of the service's default endpoint (
--endpoint-url). -
no_cli_pager() -> SelfPass
--no-cli-pagerexplicitly. The pager is already off throughAWS_PAGER(see AwsSettings); the flag is for a build that wants it on the command line as well. AWS CLI v2 only. -
no_verify_ssl() -> SelfSkip TLS certificate verification (
--no-verify-ssl). This disables the check that the endpoint is who it claims to be — meant for a local emulator, never for a real account; prefer caBundle. -
no_sign_request() -> SelfSend the request unsigned, without loading credentials (
--no-sign-request). -
ca_bundle(path: str) -> SelfThe CA certificate bundle to verify TLS against (
--ca-bundle). -
cli_read_timeout(seconds: float) -> SelfThe socket read timeout in seconds;
0blocks forever (--cli-read-timeout). -
cli_connect_timeout(seconds: float) -> SelfThe socket connect timeout in seconds;
0blocks forever (--cli-connect-timeout). -
debug() -> SelfTurn on the CLI's debug logging (
--debug), written to stderr. The debug log carries credentials: request headers with the session token, and response bodies — a secret's value among them. The access key, secret key and session token in the environment are registered with the run's redactor when this is called, but a credential the CLI loads from a profile, an SSO cache or a role is not known here and is not masked. Keep it for a local investigation, never a shared CI log. -
flag(name: str, value: str | float | None=None) -> SelfAdd an arbitrary option:
--name value, or the bare--name. Two hazards come with the escape hatch, which the typed setters guard and this does not: a value that starts with-is read by the CLI as the next option, and a value that starts withfile://orfileb://is replaced by that file's contents — which then leave the machine in the request. Never pass an untrusted value here.
class AwsSsmGetParameterSettings(AwsSettings) Settings for aws ssm get-parameter.
A parameter may be a SecureString, so the command always runs quietly — captured, never streamed — with --output json pinned, and the value it returns is registered with the run's redactor.
-
name(value: str) -> SelfThe parameter's name or ARN (
--name). -
with_decryption() -> SelfReturn a
SecureStringdecrypted (--with-decryption). Without it, aSecureStringcomes back as ciphertext.
class AwsSsmPutParameterSettings(AwsSettings) Settings for aws ssm put-parameter.
--value is a command-line argument, which every user on the host can read from the process table. For a SecureString, write the value to a file with owner-only permissions and use valueFile: the CLI reads it, so it never appears in the argv. A literal value given to a SecureString is registered with the run's redactor, which masks Zuke's own output but not the process table.
-
name(value: str) -> SelfThe parameter's name (
--name). -
value(text: str) -> SelfThe value, given literally (
--value). Refuses a value starting withfile://orfileb://: the CLI would read the named file rather than store the text — use valueFile when that is the intent. -
value_file(path: str) -> SelfRead the value from a file (
--value=file://<path>), which keeps it off the command line. The CLI stores the file's contents exactly, trailing newline included. -
type_(value: Literal['String', 'StringList', 'SecureString']) -> SelfThe parameter's type (
--type). -
overwrite() -> SelfReplace an existing parameter (
--overwrite). -
key_id(id: str) -> SelfThe KMS key that encrypts a
SecureString(--key-id). -
description(text: str) -> SelfA description of the parameter (
--description). -
tier(value: Literal['Standard', 'Advanced', 'Intelligent-Tiering']) -> SelfThe storage tier (
--tier). -
data_type(value: str) -> SelfThe data type (
--data-type), e.g."aws:ec2:image".
class AwsStsAssumeRoleSettings(AwsSettings) Settings for aws sts assume-role.
The response carries a secret access key and a session token, so the command always runs quietly — its output is captured, never streamed — with --output json pinned whatever the settings or the user's config say, and both values are registered with the run's redactor once it returns.
-
role_arn(arn: str) -> SelfThe role to assume (
--role-arn). -
role_session_name(name: str) -> SelfAn identifier for the session, shown in CloudTrail (
--role-session-name). -
duration_seconds(seconds: float) -> SelfHow long the credentials last, in seconds (
--duration-seconds). -
external_id(id: str) -> SelfThe external id the role's trust policy requires (
--external-id). -
policy(json: str) -> SelfAn inline session policy, as a JSON document (
--policy). -
serial_number(serial: str) -> SelfThe MFA device's serial number or ARN (
--serial-number). -
token_code(code: str) -> SelfThe code the MFA device shows (
--token-code).
class AwsStsGetCallerIdentitySettings(AwsSettings) Settings for aws sts get-caller-identity.
class AwsTasks Typed task functions for the aws CLI.
-
static async run(ctx: ServiceContext, configure: Callable[[AwsSettings], AwsSettings] | None=None) -> ExecResultRun any
awscommand, built with.command(service, operation, …). -
static async sts_get_caller_identity(ctx: ServiceContext, configure: Callable[[AwsStsGetCallerIdentitySettings], AwsStsGetCallerIdentitySettings] | None=None) -> ExecResultWho the build runs as:
aws sts get-caller-identity. -
static async account_id(ctx: ServiceContext, configure: Callable[[AwsStsGetCallerIdentitySettings], AwsStsGetCallerIdentitySettings] | None=None) -> objectThe AWS account id the build runs as, read back as a string. Pins
--query Account --output text. -
static async sts_assume_role(ctx: ServiceContext, configure: Callable[[AwsStsAssumeRoleSettings], AwsStsAssumeRoleSettings] | None=None) -> ExecResultTake on a role's temporary credentials:
aws sts assume-role(captured, never streamed). -
static async configure_get(ctx: ServiceContext, configure: Callable[[AwsConfigureGetSettings], AwsConfigureGetSettings] | None=None) -> ExecResultRead a CLI setting:
aws configure get. -
static async configure_set(ctx: ServiceContext, configure: Callable[[AwsConfigureSetSettings], AwsConfigureSetSettings] | None=None) -> ExecResultWrite a CLI setting:
aws configure set. -
static async s3_cp(ctx: ServiceContext, configure: Callable[[AwsS3CpSettings], AwsS3CpSettings] | None=None) -> ExecResultCopy a file or tree to, from or within S3:
aws s3 cp. -
static async s3_sync(ctx: ServiceContext, configure: Callable[[AwsS3SyncSettings], AwsS3SyncSettings] | None=None) -> ExecResultSync a tree to, from or within S3:
aws s3 sync. -
static async s3_ls(ctx: ServiceContext, configure: Callable[[AwsS3LsSettings], AwsS3LsSettings] | None=None) -> ExecResultList buckets or objects:
aws s3 ls. -
static async s3_rm(ctx: ServiceContext, configure: Callable[[AwsS3RmSettings], AwsS3RmSettings] | None=None) -> ExecResultRemove objects:
aws s3 rm. -
static async s3_mb(ctx: ServiceContext, configure: Callable[[AwsS3MbSettings], AwsS3MbSettings] | None=None) -> ExecResultMake a bucket:
aws s3 mb. -
static async s3_presign(ctx: ServiceContext, configure: Callable[[AwsS3PresignSettings], AwsS3PresignSettings] | None=None) -> ExecResultPrint a presigned URL for an object:
aws s3 presign. -
static async ecr_get_login_password(ctx: ServiceContext, configure: Callable[[AwsEcrGetLoginPasswordSettings], AwsEcrGetLoginPasswordSettings] | None=None) -> ExecResultPrint a registry password:
aws ecr get-login-password(captured, never streamed). -
static async ecr_login_password(ctx: ServiceContext, configure: Callable[[AwsEcrGetLoginPasswordSettings], AwsEcrGetLoginPasswordSettings] | None=None) -> objectThe ECR registry password, read back as a string, for
docker login --password-stdin. -
static async ecr_describe_images(ctx: ServiceContext, configure: Callable[[AwsEcrDescribeImagesSettings], AwsEcrDescribeImagesSettings] | None=None) -> ExecResultDescribe a repository's images:
aws ecr describe-images. -
static async ecr_describe_repositories(ctx: ServiceContext, configure: Callable[[AwsEcrDescribeRepositoriesSettings], AwsEcrDescribeRepositoriesSettings] | None=None) -> ExecResultDescribe repositories:
aws ecr describe-repositories. -
static async ecr_batch_delete_image(ctx: ServiceContext, configure: Callable[[AwsEcrBatchDeleteImageSettings], AwsEcrBatchDeleteImageSettings] | None=None) -> ExecResultDelete images:
aws ecr batch-delete-image. -
static async ecs_update_service(ctx: ServiceContext, configure: Callable[[AwsEcsUpdateServiceSettings], AwsEcsUpdateServiceSettings] | None=None) -> ExecResultRoll a service onto a task definition:
aws ecs update-service. -
static async ecs_describe_services(ctx: ServiceContext, configure: Callable[[AwsEcsDescribeServicesSettings], AwsEcsDescribeServicesSettings] | None=None) -> ExecResultDescribe services:
aws ecs describe-services. -
static async ecs_wait_services_stable(ctx: ServiceContext, configure: Callable[[AwsEcsWaitServicesStableSettings], AwsEcsWaitServicesStableSettings] | None=None) -> ExecResultBlock until services are stable:
aws ecs wait services-stable. -
static async ecs_register_task_definition(ctx: ServiceContext, configure: Callable[[AwsEcsRegisterTaskDefinitionSettings], AwsEcsRegisterTaskDefinitionSettings] | None=None) -> ExecResultRegister a task definition:
aws ecs register-task-definition. -
static async ecs_run_task(ctx: ServiceContext, configure: Callable[[AwsEcsRunTaskSettings], AwsEcsRunTaskSettings] | None=None) -> ExecResultStart a one-off task:
aws ecs run-task. -
static async lambda_update_function_code(ctx: ServiceContext, configure: Callable[[AwsLambdaUpdateFunctionCodeSettings], AwsLambdaUpdateFunctionCodeSettings] | None=None) -> ExecResultShip new code:
aws lambda update-function-code. -
static async lambda_update_function_configuration(ctx: ServiceContext, configure: Callable[[AwsLambdaUpdateFunctionConfigurationSettings], AwsLambdaUpdateFunctionConfigurationSettings] | None=None) -> ExecResultChange a function's settings:
aws lambda update-function-configuration. -
static async lambda_publish_version(ctx: ServiceContext, configure: Callable[[AwsLambdaPublishVersionSettings], AwsLambdaPublishVersionSettings] | None=None) -> ExecResultPublish a version:
aws lambda publish-version. -
static async lambda_published_version(ctx: ServiceContext, configure: Callable[[AwsLambdaPublishVersionSettings], AwsLambdaPublishVersionSettings] | None=None) -> objectPublish a new version of the function —
aws lambda publish-version, which changes the account — and return the number it was given. Pins--query Version --output text. Not a lookup: every call publishes. -
static async lambda_update_alias(ctx: ServiceContext, configure: Callable[[AwsLambdaUpdateAliasSettings], AwsLambdaUpdateAliasSettings] | None=None) -> ExecResultMove an alias:
aws lambda update-alias. -
static async lambda_get_alias(ctx: ServiceContext, configure: Callable[[AwsLambdaGetAliasSettings], AwsLambdaGetAliasSettings] | None=None) -> ExecResultDescribe an alias:
aws lambda get-alias. -
static async lambda_get_function(ctx: ServiceContext, configure: Callable[[AwsLambdaGetFunctionSettings], AwsLambdaGetFunctionSettings] | None=None) -> ExecResultDescribe a function:
aws lambda get-function. -
static async lambda_wait(ctx: ServiceContext, configure: Callable[[AwsLambdaWaitSettings], AwsLambdaWaitSettings] | None=None) -> ExecResultWait for a function or version to reach a state:
aws lambda wait. -
static async lambda_invoke(ctx: ServiceContext, configure: Callable[[AwsLambdaInvokeSettings], AwsLambdaInvokeSettings] | None=None) -> ExecResultInvoke a function:
aws lambda invoke. -
static async cloudformation_deploy(ctx: ServiceContext, configure: Callable[[AwsCloudformationDeploySettings], AwsCloudformationDeploySettings] | None=None) -> ExecResultCreate or update a stack:
aws cloudformation deploy. -
static async cloudformation_describe_stacks(ctx: ServiceContext, configure: Callable[[AwsCloudformationDescribeStacksSettings], AwsCloudformationDescribeStacksSettings] | None=None) -> ExecResultDescribe stacks:
aws cloudformation describe-stacks. -
static async stack_output(ctx: ServiceContext, stack: str, key: str, configure: Callable[[AwsCloudformationDescribeStacksSettings], AwsCloudformationDescribeStacksSettings] | None=None) -> objectOne output of a stack, read back as a string. Pins a
--queryprojecting that output and--output json; fails when the stack has no such output. -
static async cloudformation_delete_stack(ctx: ServiceContext, configure: Callable[[AwsCloudformationDeleteStackSettings], AwsCloudformationDeleteStackSettings] | None=None) -> ExecResultDelete a stack:
aws cloudformation delete-stack. -
static async cloudformation_wait(ctx: ServiceContext, configure: Callable[[AwsCloudformationWaitSettings], AwsCloudformationWaitSettings] | None=None) -> ExecResultBlock until a stack reaches a state:
aws cloudformation wait <waiter>. -
static async secretsmanager_get_secret_value(ctx: ServiceContext, configure: Callable[[AwsSecretsmanagerGetSecretValueSettings], AwsSecretsmanagerGetSecretValueSettings] | None=None) -> ExecResultRead a secret:
aws secretsmanager get-secret-value(captured, never streamed). -
static async secret_string(ctx: ServiceContext, configure: Callable[[AwsSecretsmanagerGetSecretValueSettings], AwsSecretsmanagerGetSecretValueSettings] | None=None) -> objectA secret's
SecretString, read back exactly — multi-line values and surrounding whitespace included. Pins--query SecretString --output json; fails for a binary secret. -
static async ssm_get_parameter(ctx: ServiceContext, configure: Callable[[AwsSsmGetParameterSettings], AwsSsmGetParameterSettings] | None=None) -> ExecResultRead a parameter:
aws ssm get-parameter(captured, never streamed). -
static async parameter_value(ctx: ServiceContext, configure: Callable[[AwsSsmGetParameterSettings], AwsSsmGetParameterSettings] | None=None) -> objectA parameter's value, read back exactly. Pins
--query Parameter.Value --output json; add.withDecryption()for aSecureString. -
static async ssm_put_parameter(ctx: ServiceContext, configure: Callable[[AwsSsmPutParameterSettings], AwsSsmPutParameterSettings] | None=None) -> ExecResultWrite a parameter:
aws ssm put-parameter. -
static async eks_update_kubeconfig(ctx: ServiceContext, configure: Callable[[AwsEksUpdateKubeconfigSettings], AwsEksUpdateKubeconfigSettings] | None=None) -> ExecResultWrite a kubeconfig entry for a cluster:
aws eks update-kubeconfig. -
static async eks_describe_cluster(ctx: ServiceContext, configure: Callable[[AwsEksDescribeClusterSettings], AwsEksDescribeClusterSettings] | None=None) -> ExecResultDescribe a cluster:
aws eks describe-cluster. -
static async cloudwatch_get_metric_data(ctx: ServiceContext, configure: Callable[[AwsCloudwatchGetMetricDataSettings], AwsCloudwatchGetMetricDataSettings] | None=None) -> ExecResultRead metric datapoints:
aws cloudwatch get-metric-data. -
static async metric_value(ctx: ServiceContext, configure: Callable[[AwsCloudwatchMetricValueSettings], AwsCloudwatchMetricValueSettings]) -> objectOne number from CloudWatch: the latest datapoint of a series, or an aggregate over the window. Pins
--query MetricDataResults --output json; fails on no data unless.missingDataAs(value)says what it means. -
static async cloudwatch_get_metric_statistics(ctx: ServiceContext, configure: Callable[[AwsCloudwatchGetMetricStatisticsSettings], AwsCloudwatchGetMetricStatisticsSettings] | None=None) -> ExecResultRead metric statistics:
aws cloudwatch get-metric-statistics. -
static async cloudwatch_describe_alarms(ctx: ServiceContext, configure: Callable[[AwsCloudwatchDescribeAlarmsSettings], AwsCloudwatchDescribeAlarmsSettings] | None=None) -> ExecResultDescribe alarms:
aws cloudwatch describe-alarms. -
static async alarm_state(ctx: ServiceContext, name: str, configure: Callable[[AwsCloudwatchDescribeAlarmsSettings], AwsCloudwatchDescribeAlarmsSettings] | None=None) -> objectThe state of one metric, composite or log alarm:
OK,ALARMorINSUFFICIENT_DATA. -
static async logs_start_query(ctx: ServiceContext, configure: Callable[[AwsLogsStartQuerySettings], AwsLogsStartQuerySettings] | None=None) -> ExecResultStart a Logs Insights query:
aws logs start-query. -
static async logs_get_query_results(ctx: ServiceContext, configure: Callable[[AwsLogsGetQueryResultsSettings], AwsLogsGetQueryResultsSettings] | None=None) -> ExecResultRead a Logs Insights query's results:
aws logs get-query-results. -
static async logs_stop_query(ctx: ServiceContext, configure: Callable[[AwsLogsStopQuerySettings], AwsLogsStopQuerySettings] | None=None) -> ExecResultStop a running Logs Insights query:
aws logs stop-query. -
static async logs_insights_query(ctx: ServiceContext, configure: Callable[[AwsLogsInsightsQuerySettings], AwsLogsInsightsQuerySettings]) -> objectRun a Logs Insights query to the end and return its rows: start it, poll
get-query-resultsuntil it isComplete, and fail with anAwsLogsQueryErrorwhen it ends otherwise or outlasts the timeout. -
static async logs_filter_log_events(ctx: ServiceContext, configure: Callable[[AwsLogsFilterLogEventsSettings], AwsLogsFilterLogEventsSettings] | None=None) -> ExecResultSearch a log group's events:
aws logs filter-log-events. -
static async logs_tail(ctx: ServiceContext, configure: Callable[[AwsLogsTailSettings], AwsLogsTailSettings] | None=None) -> ExecResultPrint a log group's recent events:
aws logs tail.