@zuke/aws
`@zuke/aws` — typed AWS CLI tasks, readers, and a canary platform and analysis.
@zuke/aws on JSR ↗ 72 symbols
Symbols
class AwsCloudformationDeleteStackSettings extends AwsSettings Settings for aws cloudformation delete-stack.
| Member | Signature | Doc |
|---|---|---|
stackName | stackName(name: string): this | The stack to delete (--stack-name). |
roleArn | roleArn(arn: string): this | The role CloudFormation assumes to delete (--role-arn). |
retainResources | retainResources(...ids: string[]): this | Logical ids to keep when a delete is retried (--retain-resources). |
class AwsCloudformationDeploySettings extends AwsSettings Settings for aws cloudformation deploy.
| Member | Signature | Doc |
|---|---|---|
templateFile | templateFile(path: string): this | The template to deploy (--template-file). |
stackName | stackName(name: string): this | The stack to create or update (--stack-name). |
parameterOverride | parameterOverride(key: string, value: string): this | Set a template parameter (--parameter-overrides Key=Value); repeatable. |
capabilities | capabilities(...values: string[]): this | Acknowledge what the template creates (--capabilities), e.g. "CAPABILITY_IAM". |
tag | tag(key: string, value: string): this | Tag the stack and its resources (--tags Key=Value); repeatable. |
noExecuteChangeset | noExecuteChangeset(): this | Create the change set without executing it (--no-execute-changeset). |
noFailOnEmptyChangeset | noFailOnEmptyChangeset(): this | Exit 0 when there is nothing to change (--no-fail-on-empty-changeset). |
roleArn | roleArn(arn: string): this | The role CloudFormation assumes to deploy (--role-arn). |
s3Bucket | s3Bucket(name: string): this | The bucket a large template is uploaded to (--s3-bucket). |
s3Prefix | s3Prefix(prefix: string): this | The key prefix for that upload (--s3-prefix). |
kmsKeyId | kmsKeyId(id: string): this | The KMS key that encrypts that upload (--kms-key-id). |
class AwsCloudformationDescribeStacksSettings extends AwsSettings Settings for aws cloudformation describe-stacks.
| Member | Signature | Doc |
|---|---|---|
stackName | stackName(name: string): this | The stack to describe (--stack-name); every stack when omitted. |
type AwsCloudformationStackWaiter = stack-create-complete | stack-update-complete | stack-delete-complete | stack-import-complete | stack-rollback-complete | stack-exists The waiters aws cloudformation wait offers for a stack.
class AwsCloudformationWaitSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
waiter | waiter(name: AwsCloudformationStackWaiter): this | The state to wait for, e.g. "stack-update-complete". |
stackName | stackName(name: string): this | The stack to wait on (--stack-name). |
type AwsCloudwatchAggregate = latest | sum | average | maximum | minimum How AwsCloudwatchMetricValueSettings turns a series into one number: its newest datapoint, or the sum, average, maximum or minimum of all of them.
type AwsCloudwatchAlarmState = OK | ALARM | INSUFFICIENT_DATA The states a CloudWatch alarm can be in.
type AwsCloudwatchAlarmType = MetricAlarm | CompositeAlarm | LogAlarm The kinds of alarm describe-alarms can return.
interface AwsCloudwatchAnalysis A health check run against a canary, in the shape @zuke/canary's c.analysis(...) accepts: throw to fail it, which rolls the rollout back.
| Member | Signature | Doc |
|---|---|---|
validate | validate(context: AwsCloudwatchAnalysisContext): Promise<void> | Read the metric and throw when a datapoint is out of bounds. |
name | name: string | "cloudwatch", for diagnostics. |
interface AwsCloudwatchAnalysisContext The part of the canary engine's context the analysis uses: the run's redactor, applied to every failure message. The engine hands a richer context; this is the narrow view.
| Member | Signature | Doc |
|---|---|---|
redact | redact(text: string): string | Mask every resolved secret parameter in text. |
class AwsCloudwatchAnalysisSettings extends AwsCloudwatchMetricStatSettings Settings for cloudwatch: the metric, the window and the bounds.
The metric itself — namespace, metricName, dimension, stat, period, unit — is set with the same setters as a get-metric-data query, which these settings extend; it is queried as m1.
| Member | Signature | Doc |
|---|---|---|
name | name(name: string): this | What to call the metric when it is out of bounds. |
metricStat | metricStat(id: string, configure: Configure<AwsCloudwatchMetricStatSettings>): this | Add a metric for expression to read, under id. The metric set with namespace and metricName is m1. |
expression | expression(expression: string): this | Judge a metric-math expression over the metrics instead of a metric — "100 * errors / requests", with errors and requests added by metricStat. |
window | window(duration: string | number): this | How far back to read ("10m", or ms; default 5 minutes). The window ends at the last period boundary, so the period still being written is not judged. CloudWatch publishes a datapoint a little after its period ends, so the newest period in the window may still be short of some data. That only lowers a Sum or a SampleCount: harmless for a max, but a min on such a statistic can fail on a lag rather than on the candidate. |
min | min(value: number): this | Fail when any datapoint is below value. |
max | max(value: number): this | Fail when any datapoint is above value. |
missingDataAs | missingDataAs(value: number): this | Judge value when the window has no datapoints, instead of failing. CloudWatch publishes nothing for a period with no events, so for a count of errors no data means 0; for a latency it usually means the metric or its dimensions are wrong, which is why that is a failure by default. |
aws | aws(configure: Configure<AwsSettings>): this | Global options for the get-metric-data command — (a) => a.profile("prod").region("eu-west-1"), a .toolPath(...), or a .runner(...), the seam a test answers through. --output and --query are the analysis's own and are set after it. |
now | now(clock: unknown): this | The clock the window is read against — the seam a test pins it with. |
name_? | name_?: string | What the metric is called in a failure (set by name). |
metricStats_ | metricStats_: Array<unknown> | Further metrics an expression reads, by id (set by metricStat). |
expression_? | expression_?: string | The metric-math expression judged instead of the metric (set by expression). |
window_ | window_: number | How far back to read, in ms (set by window). |
min_? | min_?: number | The lowest acceptable value (set by min). |
max_? | max_?: number | The highest acceptable value (set by max). |
missingData_? | missingData_?: number | The value to judge when there are no datapoints (set by missingDataAs). |
aws_ | aws_: Configure<AwsSettings> | Global options for the command (set by aws). |
now_ | now_: unknown | The clock the window is read against (set by now). |
class AwsCloudwatchDescribeAlarmsSettings extends AwsSettings Settings for aws cloudwatch describe-alarms.
| Member | Signature | Doc |
|---|---|---|
alarmNames | alarmNames(...names: string[]): this | Only these alarms (--alarm-names); repeatable. |
alarmNamePrefix | alarmNamePrefix(prefix: string): this | Only alarms whose name starts with this (--alarm-name-prefix). |
stateValue | stateValue(state: AwsCloudwatchAlarmState): this | Only alarms in this state (--state-value). |
alarmTypes | alarmTypes(...types: AwsCloudwatchAlarmType[]): this | The 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 for one metric-math expression in a get-metric-data request.
| Member | Signature | Doc |
|---|---|---|
label | label(text: string): this | A label for the series in the response. |
period | period(seconds: number): this | The period in seconds, for an expression that has no metric to take it from. |
returnData | returnData(value: boolean): this | Whether the response carries this series (default true). |
label_? | label_?: string | A label for the series (set by label). |
period_? | period_?: number | The period in seconds, for an expression that needs one (set by period). |
returnData_ | returnData_: boolean | Whether the response carries this series (set by returnData). |
class AwsCloudwatchGetMetricDataSettings extends AwsSettings Settings for aws cloudwatch get-metric-data.
| Member | Signature | Doc |
|---|---|---|
metricStat | metricStat(id: string, configure: Configure<AwsCloudwatchMetricStatSettings>): this | Add a metric to the request, under id, configured by configure. |
expression | expression(id: string, expression: string, configure?: Configure<AwsCloudwatchExpressionSettings>): this | Add a metric-math expression over the request's other ids, e.g. ("ratio", "100 * errors / requests"). |
startTime | startTime(time: AwsTime): this | The start of the range (--start-time). |
endTime | endTime(time: AwsTime): this | The end of the range (--end-time). |
window | window(duration: string | number, end?: Date): this | The duration ("15m", or milliseconds) up to end — now, unless given — as --start-time and --end-time. |
scanBy | scanBy(order: TimestampDescending | TimestampAscending): this | The order of the datapoints (--scan-by); newest first by default. |
maxDatapoints | maxDatapoints(count: number): this | The 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 a NextToken — so the answer may hold only part of the window. AwsTasks.metricValue refuses it for that reason. |
class AwsCloudwatchGetMetricStatisticsSettings extends AwsSettings Settings for aws cloudwatch get-metric-statistics.
| Member | Signature | Doc |
|---|---|---|
namespace | namespace(value: string): this | The metric's namespace (--namespace). |
metricName | metricName(value: string): this | The metric's name (--metric-name). |
dimension | dimension(name: string, value: string): this | A dimension that picks the series (--dimensions); repeatable. |
startTime | startTime(time: AwsTime): this | The start of the range (--start-time). |
endTime | endTime(time: AwsTime): this | The end of the range (--end-time). |
window | window(duration: string | number, end?: Date): this | The duration up to end — now, unless given — as the time range. |
period | period(seconds: number): this | The aggregation period in seconds (--period). |
statistics | statistics(...values: Array<SampleCount | Average | Sum | Minimum | Maximum>): this | The basic statistics to return (--statistics), e.g. "Sum". |
extendedStatistics | extendedStatistics(...values: string[]): this | Percentiles and other extended statistics (--extended-statistics), e.g. "p99". |
unit | unit(value: string): this | Only datapoints published in this unit (--unit). |
class AwsCloudwatchMetricStatSettings Settings for one metric in a get-metric-data request (a MetricStat query).
| Member | Signature | Doc |
|---|---|---|
namespace | namespace(value: string): this | The metric's namespace, e.g. "AWS/ApplicationELB". |
metricName | metricName(value: string): this | The metric's name, e.g. "HTTPCode_Target_5XX_Count". |
dimension | dimension(name: string, value: string): this | A dimension that picks the series, e.g. ("LoadBalancer", "app/web/1f2e"); repeatable. |
period | period(seconds: number): this | The aggregation period in seconds (default 60). CloudWatch accepts 1, 5, 10, 20, 30, or a multiple of 60. |
stat | stat(value: AwsCloudwatchStatistic): this | The statistic: "Sum", "Average", "Maximum", "p99", … |
unit | unit(value: string): this | Only datapoints published in this unit, e.g. "Count". |
label | label(text: string): this | A label for the series in the response. |
returnData | returnData(value: boolean): this | Whether the response carries this series (default true). Pass false for a metric that only feeds an expression. |
namespace_? | namespace_?: string | The metric's namespace, e.g. AWS/ApplicationELB (set by namespace). |
metricName_? | metricName_?: string | The metric's name (set by metricName). |
dimensions_ | dimensions_: Array<unknown> | The dimensions that pick the series, in order (set by dimension). |
period_ | period_: number | The aggregation period in seconds (set by period). |
stat_? | stat_?: AwsCloudwatchStatistic | The statistic (set by stat). |
unit_? | unit_?: string | The unit to filter on (set by unit). |
label_? | label_?: string | A label for the series (set by label). |
returnData_ | returnData_: boolean | Whether the response carries this series (set by returnData). |
class AwsCloudwatchMetricValueSettings extends AwsCloudwatchGetMetricDataSettings Settings for AwsTasks.metricValue: a get-metric-data request, and how to read it.
| Member | Signature | Doc |
|---|---|---|
id | id(queryId: string): this | The 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 | aggregate(how: AwsCloudwatchAggregate): this | How to turn the series into one number (default "latest", the newest datapoint). An aggregate combines the datapoints the window holds: a "sum" of per-minute Sums is the window's total. |
missingDataAs | missingDataAs(value: number): this | Return value when 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 mean 0; for a latency or a CPU reading it usually means the query is looking in the wrong place. |
id_? | id_?: string | The series to read (set by id); the only one when unset. |
aggregate_ | aggregate_: AwsCloudwatchAggregate | How to turn the series into one number (set by aggregate). |
missingData_? | missingData_?: number | The value to return when the series is empty (set by missingDataAs). |
type AwsCloudwatchStatistic = SampleCount | Average | Sum | Minimum | Maximum | IQM | p${number} | ${"tm" | "wm" | "tc" | "ts"}${string} | ${"TM" | "WM" | "TC" | "TS" | "PR"}(${string}) A CloudWatch statistic: one of the five basic statistics, the interquartile mean IQM, or a percentile (p99, p99.9) or other extended statistic (tm90, TM(10%:90%), PR(100:2000), …).
class AwsConfigureGetSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
varname | varname(name: string): this | The setting to read (positional), e.g. "region". |
class AwsConfigureSetSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
varname | varname(name: string): this | The setting to write (positional), e.g. "region". |
value | value(text: string): this | The value to write (positional). |
class AwsEcrBatchDeleteImageSettings extends AwsSettings Settings for aws ecr batch-delete-image.
| Member | Signature | Doc |
|---|---|---|
repositoryName | repositoryName(name: string): this | The repository to delete from (--repository-name). |
registryId | registryId(id: string): this | The registry's account id, when not the caller's (--registry-id). |
imageTag | imageTag(tag: string): this | Delete the image with this tag (--image-ids); repeatable. |
imageDigest | imageDigest(digest: string): this | Delete the image with this digest (--image-ids); repeatable. |
class AwsEcrDescribeImagesSettings extends AwsSettings Settings for aws ecr describe-images.
| Member | Signature | Doc |
|---|---|---|
repositoryName | repositoryName(name: string): this | The repository to describe (--repository-name). |
registryId | registryId(id: string): this | The registry's account id, when not the caller's (--registry-id). |
imageTag | imageTag(tag: string): this | Describe the image with this tag (--image-ids); repeatable. |
imageDigest | imageDigest(digest: string): this | Describe the image with this digest (--image-ids); repeatable. |
tagStatus | tagStatus(status: TAGGED | UNTAGGED | ANY): this | Only images with this tag status (--filter tagStatus=…). |
class AwsEcrDescribeRepositoriesSettings extends AwsSettings Settings for aws ecr describe-repositories.
| Member | Signature | Doc |
|---|---|---|
repositoryNames | repositoryNames(...names: string[]): this | Only these repositories (--repository-names); all when omitted. |
registryId | registryId(id: string): this | The registry's account id, when not the caller's (--registry-id). |
class AwsEcrGetLoginPasswordSettings extends 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 extends AwsSettings Settings for aws ecs describe-services.
| Member | Signature | Doc |
|---|---|---|
cluster | cluster(name: string): this | The cluster the services run in (--cluster). |
services | services(...names: string[]): this | The services to describe (--services); repeatable. |
class AwsEcsRegisterTaskDefinitionSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
cliInputJson | cliInputJson(value: string): this | The whole request as JSON (--cli-input-json): a file:// path to the document, or the document itself. |
family | family(name: string): this | The task definition family (--family). |
containerDefinitions | containerDefinitions(json: string): this | The container definitions, as a JSON array or a file:// path (--container-definitions). |
taskRoleArn | taskRoleArn(arn: string): this | The role the task's containers assume (--task-role-arn). |
executionRoleArn | executionRoleArn(arn: string): this | The role ECS uses to pull images and read secrets (--execution-role-arn). |
networkMode | networkMode(mode: string): this | The Docker networking mode (--network-mode), e.g. "awsvpc". |
requiresCompatibilities | requiresCompatibilities(...types: string[]): this | The launch types the definition must suit (--requires-compatibilities). |
cpu | cpu(value: string): this | CPU units for the task (--cpu), e.g. "256". |
memory | memory(value: string): this | Memory for the task in MiB (--memory), e.g. "512". |
class AwsEcsRunTaskSettings extends AwsSettings Settings for aws ecs run-task.
| Member | Signature | Doc |
|---|---|---|
cluster | cluster(name: string): this | The cluster to run the task in (--cluster). |
taskDefinition | taskDefinition(value: string): this | The task definition to run (--task-definition). |
count | count(value: number): this | How many copies to start (--count). |
launchType | launchType(value: string): this | The launch type (--launch-type): "FARGATE", "EC2" or "EXTERNAL". |
networkConfiguration | networkConfiguration(json: string): this | The awsvpc network configuration, as JSON (--network-configuration). |
overrides | overrides(json: string): this | Container overrides, as JSON (--overrides). |
startedBy | startedBy(value: string): this | A label for who started the task (--started-by). |
group | group(name: string): this | The task group name (--group). |
class AwsEcsUpdateServiceSettings extends AwsSettings Settings for aws ecs update-service.
| Member | Signature | Doc |
|---|---|---|
cluster | cluster(name: string): this | The cluster the service runs in (--cluster); the default cluster when omitted. |
service | service(name: string): this | The service to update (--service). |
taskDefinition | taskDefinition(value: string): this | The task definition to run, as family:revision or an ARN (--task-definition). |
desiredCount | desiredCount(count: number): this | How many tasks to keep running (--desired-count). |
forceNewDeployment | forceNewDeployment(): this | Start a new deployment even when nothing changed (--force-new-deployment). |
healthCheckGracePeriodSeconds | healthCheckGracePeriodSeconds(seconds: number): this | Seconds to ignore failing health checks after a task starts (--health-check-grace-period-seconds). |
class AwsEcsWaitServicesStableSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
cluster | cluster(name: string): this | The cluster the services run in (--cluster). |
services | services(...names: string[]): this | The services to wait for (--services); repeatable. |
class AwsEksDescribeClusterSettings extends AwsSettings Settings for aws eks describe-cluster.
| Member | Signature | Doc |
|---|---|---|
name | name(cluster: string): this | The cluster (--name). |
class AwsEksUpdateKubeconfigSettings extends AwsSettings Settings for aws eks update-kubeconfig.
| Member | Signature | Doc |
|---|---|---|
name | name(cluster: string): this | The cluster (--name). |
kubeconfig | kubeconfig(path: string): this | The kubeconfig file to write (--kubeconfig); ~/.kube/config by default. |
alias | alias(name: string): this | The context's name (--alias); the cluster ARN by default. |
userAlias | userAlias(name: string): this | The user entry's name (--user-alias). |
roleArn | roleArn(arn: string): this | A role to assume when authenticating to the cluster (--role-arn). |
dryRun | dryRun(): this | Print the configuration instead of writing it (--dry-run). |
class AwsLambdaCanary A Lambda alias as a canary platform. Create one with lambdaCanary; hand it to @zuke/canary's c.platform(...).
Exposure is a share of the alias's invocations, set exactly.
| Member | Signature | Doc |
|---|---|---|
describe | describe(): string | "Lambda alias api:live", for the build summary. |
stage | stage(ctx: AwsLambdaCanaryContext): Promise<void> | Read the alias and its stable version, publish the candidate (or take the version given) and wait for it to be Active, then record the rollout: the function, alias and AWS flags every later call is checked against, the alias's ARN, the stable version and the candidate with their code hashes. The alias itself is not changed, so the candidate takes no traffic yet — though publishing a code source does make it the function's $LATEST. Refuses an alias that already splits its traffic — another rollout, or one left behind — and one that points at $LATEST, which weighted routing does not allow; and a candidate that is the stable version, which is what publishing unchanged code and configuration gives back. A stage run again over a record of the same rollout checks it and changes nothing. |
expose | expose(percent: number, ctx: AwsLambdaCanaryContext): Promise<number> | Send percent of the alias's invocations to the candidate, as its additional weight; the stable version keeps the rest. First the configuration is compared with the record; then the alias is read, and this refuses — changing nothing — unless it is still the alias staged, still points at the stable version, and splits only with the candidate, and unless the candidate still has the code staged. The update carries the alias's revision, so a change made in between fails it. |
promote | promote(ctx: AwsLambdaCanaryContext): Promise<void> | Point the alias at the candidate and clear its routing, so the candidate takes every invocation. Before that, the same checks as expose: the record, the alias's ARN, that it still splits only between the stable version and the candidate, and the candidate's code. An alias already pointing at the candidate with no routing is left as it is, so a promote run again changes nothing. |
abort | abort(ctx: AwsLambdaCanaryContext): Promise<void> | Take the candidate's traffic back. Idempotent. What it does depends on what this rollout recorded: - The rollout is staged (a rollback mid-rollout): once the configuration and the alias's ARN match the record, the candidate's weight comes off the alias, leaving any other weight as it is. The update is written even when the candidate has no share, so an expose of this rollout still in flight — a zuke cancel from another process races it — fails on the revision instead of landing afterwards; a write that loses such a race reads the alias again and retries. An alias already pointing at the candidate — promoted, or moved there — goes back to the stable version, once that version still has the code recorded; one that also splits with another version is a newer rollout built on the candidate, and this refuses rather than undo it too. - stage failed before recording it: the alias was never changed, so nothing runs. - Any other stage marker: the record is damaged, and this refuses. - Nothing recorded, on a rollback (ctx.reason is "rollback"): nothing was staged, so nothing runs — the stable version is not even read. - Nothing recorded, run by hand (rollout.abort on its own, a fresh run, or an engine that names no reason): the alias goes to the version set with AwsLambdaCanarySettings.stable and its routing is cleared. Without one this refuses, since claiming a rollback it cannot do would be worse. |
exposure | exposure: traffic | The alias splits invocations, so exposure is a traffic share. |
interface AwsLambdaCanaryContext The part of the canary engine's context the Lambda platform uses: the rollout's durable state, where the staged versions are recorded, and the build summary. The engine hands a richer context; this is the narrow view.
| Member | Signature | Doc |
|---|---|---|
reportSummary | reportSummary(pairs: SummaryPairs): void | Add key/value pairs to the calling target's row in the build summary. |
state | state: TargetStateHandle | The rollout's durable platform state, shared by every call. |
reason? | reason?: rollback | hand-run | Why abort runs: "rollback" when the engine undoes a rollout, "hand-run" for rollout.abort run on its own. An engine older than this field leaves it out, which is treated as a hand run — the behaviour from before the field existed. |
class AwsLambdaCanarySettings How lambdaCanary reaches the alias and finds the candidate, configured through its lambda.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function to roll out — its name, partial ARN or ARN. |
alias | alias(name: string): this | The alias whose traffic the canary splits, e.g. "live". It must already exist and point at a published version: that version is the stable one. |
zipFile | zipFile(path: string): this | The candidate's deployment package on disk, shipped and published by stage (update-function-code --zip-file --publish). Name one code source — this, s3Bucket with s3Key, or imageUri — or a version instead. |
s3Bucket | s3Bucket(name: string): this | The bucket holding the candidate's package (--s3-bucket). |
s3Key | s3Key(key: string): this | The candidate package's key in that bucket (--s3-key). |
s3ObjectVersion | s3ObjectVersion(version: string): this | The candidate package object's version (--s3-object-version). |
imageUri | imageUri(uri: string): this | The candidate's container image, for an image function (--image-uri). |
version | version(number: string): this | An already published version to roll out — one the build published itself, for example with AwsTasks.lambdaPublishedVersion. Use this or a code source, not both. Unlike a code source it leaves the function's $LATEST as it is. |
stable | stable(number: string): this | The version to send all traffic back to when rollout.abort is run by hand. Such a run is fresh, with no record of a rollout, so it has nothing else to go on — and the release it is undoing has usually been promoted already. A rollback the engine runs mid-rollout does not use it: that one takes the candidate's weight off the alias instead. |
aws | aws(configure: Configure<AwsSettings>): this | Global options for every command the platform runs — (a) => a.profile("deploy").region("eu-west-1"), a .toolPath(...), or a .runner(...), the seam a test answers through. The flags it gives are recorded in the rollout's state, which is plain JSON: never pass a secret on the command line here. A reader's --output and --query are its own and are set after it. |
functionName_? | functionName_?: string | The function's name or ARN (set by functionName). |
alias_? | alias_?: string | The alias whose traffic is split (set by alias). |
zipFile_? | zipFile_?: string | The deployment package on disk (set by zipFile). |
s3Bucket_? | s3Bucket_?: string | The bucket holding the package (set by s3Bucket). |
s3Key_? | s3Key_?: string | The package's key in that bucket (set by s3Key). |
s3ObjectVersion_? | s3ObjectVersion_?: string | The package object's version (set by s3ObjectVersion). |
imageUri_? | imageUri_?: string | The container image (set by imageUri). |
version_? | version_?: string | An already published candidate version (set by version). |
stable_? | stable_?: string | The version a hand-run rollback returns to (set by stable). |
aws_ | aws_: Configure<AwsSettings> | Global options for every command (set by aws). |
class AwsLambdaGetAliasSettings extends AwsSettings Settings for aws lambda get-alias.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
name | name(alias: string): this | The alias to describe (--name), e.g. "live". |
class AwsLambdaGetFunctionSettings extends AwsSettings Settings for aws lambda get-function.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
qualifier | qualifier(value: string): this | A version or alias to describe instead of $LATEST (--qualifier). |
class AwsLambdaInvokeSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
payload | payload(json: string): this | The 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-out to send the text as it is. |
invocationType | invocationType(value: RequestResponse | Event | DryRun): this | Wait for the response, queue the event, or only check access (--invocation-type). |
logType | logType(value: None | Tail): this | "Tail" returns the last 4 KB of the execution log, base64-encoded (--log-type). |
qualifier | qualifier(value: string): this | A version or alias to invoke (--qualifier). |
outfile | outfile(path: string): this | The file the function's response is written to (positional). |
class AwsLambdaPublishVersionSettings extends AwsSettings Settings for aws lambda publish-version.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
description | description(text: string): this | A description of the version (--description). |
codeSha256 | codeSha256(hash: string): this | Publish only if the code still has this SHA-256 (--code-sha256). |
revisionId | revisionId(id: string): this | Publish only if the function is still at this revision (--revision-id). |
class AwsLambdaUpdateAliasSettings extends AwsSettings Settings for aws lambda update-alias.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
name | name(alias: string): this | The alias to move (--name), e.g. "live". |
functionVersion | functionVersion(version: string): this | The version the alias points at (--function-version). |
description | description(text: string): this | A description of the alias (--description). |
additionalVersionWeight | additionalVersionWeight(version: string, weight: number): this | Send 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. |
revisionId | revisionId(id: string): this | Update only if the alias is still at this revision (--revision-id) — the RevisionId a get-alias read, so a change made in between fails the update instead of being overwritten. |
clearRouting | clearRouting(): this | Clear the alias's weighted routing, sending all traffic to its version (--routing-config with no additional weights). |
class AwsLambdaUpdateFunctionCodeSettings extends AwsSettings Settings for aws lambda update-function-code.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
zipFile | zipFile(path: string): this | The deployment package on disk (--zip-file). The CLI reads the file when the path carries its fileb:// prefix, which this adds unless the path already has it. |
s3Bucket | s3Bucket(name: string): this | The bucket holding the deployment package (--s3-bucket). |
s3Key | s3Key(key: string): this | The package's key in that bucket (--s3-key). |
s3ObjectVersion | s3ObjectVersion(version: string): this | The package object's version (--s3-object-version). |
imageUri | imageUri(uri: string): this | The container image, for an image-packaged function (--image-uri). |
publish | publish(): this | Publish a new version once the code is updated (--publish). |
dryRun | dryRun(): this | Validate the request without updating the function (--dry-run). |
revisionId | revisionId(id: string): this | Update only if the function is still at this revision (--revision-id). |
architectures | architectures(...values: string[]): this | The instruction set architectures (--architectures), e.g. "arm64". |
class AwsLambdaUpdateFunctionConfigurationSettings extends AwsSettings Settings for aws lambda update-function-configuration.
| Member | Signature | Doc |
|---|---|---|
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
environment | environment(variables: Record<string, string>): this | The 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 | timeout(seconds: number): this | The longest an invocation may run, in seconds (--timeout). |
memorySize | memorySize(mib: number): this | Memory for the function in MiB (--memory-size). |
handler | handler(name: string): this | The handler entry point (--handler), e.g. "index.handler". |
runtime | runtime(name: string): this | The runtime (--runtime), e.g. "nodejs22.x". |
role | role(arn: string): this | The execution role's ARN (--role). |
description | description(text: string): this | A description of the function (--description). |
layers | layers(...arns: string[]): this | The layers to attach, by version ARN (--layers); replaces the set. |
type AwsLambdaWaiter = function-active | function-active-v2 | function-exists | function-updated | function-updated-v2 | published-version-active The states aws lambda wait can wait for. function-updated-v2 waits for an update in progress to finish; published-version-active for a version just published to leave Pending — SnapStart and image functions take a while, and Lambda fails invocations of a version until it is Active.
class AwsLambdaWaitSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
waiter | waiter(name: AwsLambdaWaiter): this | The state to wait for, e.g. "published-version-active". |
functionName | functionName(name: string): this | The function's name or ARN (--function-name). |
qualifier | qualifier(value: string): this | The version or alias to wait on (--qualifier). |
class AwsLogsFilterLogEventsSettings extends AwsSettings Settings for aws logs filter-log-events.
| Member | Signature | Doc |
|---|---|---|
logGroupName | logGroupName(name: string): this | The log group to search (--log-group-name). |
logStreamNames | logStreamNames(...names: string[]): this | Only these streams (--log-stream-names); repeatable. |
logStreamNamePrefix | logStreamNamePrefix(prefix: string): this | Only streams whose name starts with this (--log-stream-name-prefix). |
filterPattern | filterPattern(pattern: string): this | A CloudWatch Logs filter pattern (--filter-pattern), e.g. "ERROR". |
startTime | startTime(time: Date): this | The start of the range (--start-time, sent as epoch milliseconds). |
endTime | endTime(time: Date): this | The end of the range (--end-time, sent as epoch milliseconds). |
window | window(duration: string | number, end?: Date): this | The duration up to end — now, unless given — as the time range. |
class AwsLogsGetQueryResultsSettings extends AwsSettings Settings for aws logs get-query-results.
| Member | Signature | Doc |
|---|---|---|
queryId | queryId(id: string): this | The id start-query returned (--query-id). |
nextToken | nextToken(token: string): this | The page after the one that returned this token (--next-token). |
class AwsLogsInsightsQuerySettings Settings for AwsTasks.logsInsightsQuery: the query, and how long to wait for it.
| Member | Signature | Doc |
|---|---|---|
logGroupNames | logGroupNames(...names: string[]): this | The log groups to query (--log-group-names); repeatable. |
queryString | queryString(query: string): this | The Logs Insights query (--query-string). |
startTime | startTime(time: Date): this | The start of the range. |
endTime | endTime(time: Date): this | The end of the range. |
window | window(duration: string | number, end?: Date): this | The duration up to end — now, unless given — as the time range. |
limit | limit(rows: number): this | The most rows to return (--limit). |
timeout | timeout(duration: string | number): this | How 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. |
pollInterval | pollInterval(duration: string | number): this | The pause between polls for the results ("2s", or ms; default 1 second). |
aws | aws(configure: Configure<AwsSettings>): this | Global options for every command the query runs — (a) => a.profile("prod").region("eu-west-1"), a .toolPath(...), or a .runner(...). |
signal | signal(signal: AbortSignal): this | Cancel the query with signal: the poll stops at once, the query is stopped, and the reader fails with the signal's reason. Pass a target's ctx.signal here — core's own run signal reaches each aws command already, but not the pause between two polls. |
logGroupNames_ | logGroupNames_: string[] | The log groups to query (set by logGroupNames). |
queryString_? | queryString_?: string | The Logs Insights query (set by queryString). |
start_? | start_?: Date | The start of the range (set by startTime or window). |
end_? | end_?: Date | The end of the range (set by endTime or window). |
limit_? | limit_?: number | The most rows to return (set by limit). |
timeout_ | timeout_: number | How long to wait for the query, in ms (set by timeout). |
pollInterval_ | pollInterval_: number | The pause between polls, in ms (set by pollInterval). |
aws_ | aws_: Configure<AwsSettings> | Global options for every command (set by aws). |
signal_? | signal_?: AbortSignal | Cancels the wait and stops the query (set by signal). |
type AwsLogsInsightsRow = Record<string, string> One row of a Logs Insights result: each field the query returned, by name.
class AwsLogsQueryError extends Error A CloudWatch Logs Insights query did not complete: the service reported it Failed, Cancelled or Timeout, or it was still running when the reader's own timeout ran out.
| Member | Signature | Doc |
|---|---|---|
name | name: string | The error name. |
class AwsLogsStartQuerySettings extends AwsSettings Settings for aws logs start-query.
| Member | Signature | Doc |
|---|---|---|
logGroupNames | logGroupNames(...names: string[]): this | The log groups to query (--log-group-names); repeatable. |
queryString | queryString(query: string): this | The Logs Insights query (--query-string). |
startTime | startTime(time: Date): this | The start of the range (--start-time, sent as epoch seconds). |
endTime | endTime(time: Date): this | The end of the range (--end-time, sent as epoch seconds). |
window | window(duration: string | number, end?: Date): this | The duration up to end — now, unless given — as the time range. |
limit | limit(rows: number): this | The most rows to return (--limit). |
class AwsLogsStopQuerySettings extends AwsSettings Settings for aws logs stop-query.
| Member | Signature | Doc |
|---|---|---|
queryId | queryId(id: string): this | The id start-query returned (--query-id). |
class AwsLogsTailSettings extends AwsSettings Settings for aws logs tail. With follow the command never ends on its own — bound it with .killAfter(ms).
| Member | Signature | Doc |
|---|---|---|
groupName | groupName(name: string): this | The log group to tail (positional). |
since | since(value: string): this | How far back to start (--since), e.g. "10m" or an ISO timestamp. |
follow | follow(): this | Keep printing new events as they arrive (--follow). |
filterPattern | filterPattern(pattern: string): this | A CloudWatch Logs filter pattern (--filter-pattern). |
format | format(value: detailed | short | json): this | How each event is printed (--format). |
logStreamNames | logStreamNames(...names: string[]): this | Only these streams (--log-stream-names); repeatable. |
logStreamNamePrefix | logStreamNamePrefix(prefix: string): this | Only streams whose name starts with this (--log-stream-name-prefix). |
class AwsOutputError extends Error The AWS CLI succeeded but printed something a reader cannot use: output that is not JSON, JSON of an unexpected shape, an empty or multi-line answer where one value was expected, or a capture that was truncated.
The message never quotes the output itself. Several readers return credentials and secret payloads, and an error that echoed what the CLI printed would put the secret in the build log it was read to stay out of.
| Member | Signature | Doc |
|---|---|---|
name | name: string | The error name. |
type AwsOutputFormat = json | text | table | yaml | yaml-stream | off The values the AWS CLI's --output option accepts.
class AwsS3CpSettings extends AwsSettings Settings for aws s3 cp.
| Member | Signature | Doc |
|---|---|---|
source | source(path: string): this | The local path or s3:// URI to copy from (positional). |
destination | destination(path: string): this | The local path or s3:// URI to copy to (positional). |
recursive | recursive(): this | Copy every file under a directory or prefix (--recursive). |
exclude | exclude(pattern: string): this | Skip files matching the pattern (--exclude); repeatable, order kept. |
include | include(pattern: string): this | Copy files matching the pattern despite an earlier exclude (--include). |
dryrun | dryrun(): this | Print what would be copied without copying it (--dryrun). |
acl | acl(value: string): this | A canned ACL for the uploaded objects (--acl), e.g. "private". |
contentType | contentType(value: string): this | The uploaded objects' content type (--content-type). |
cacheControl | cacheControl(value: string): this | The uploaded objects' Cache-Control (--cache-control). |
storageClass | storageClass(value: string): this | The storage class for the uploaded objects (--storage-class). |
sse | sse(value: string): this | Server-side encryption (--sse): "AES256" or "aws:kms". |
sseKmsKeyId | sseKmsKeyId(id: string): this | The KMS key for aws:kms server-side encryption (--sse-kms-key-id). |
onlyShowErrors | onlyShowErrors(): this | Print only errors and warnings (--only-show-errors). |
noProgress | noProgress(): this | Leave out the file-transfer progress lines (--no-progress). |
class AwsS3LsSettings extends AwsSettings Settings for aws s3 ls.
| Member | Signature | Doc |
|---|---|---|
path | path(uri: string): this | The s3:// URI to list (positional); the buckets when omitted. |
recursive | recursive(): this | List every object under the prefix (--recursive). |
humanReadable | humanReadable(): this | Print sizes as KiB, MiB, … (--human-readable). |
summarize | summarize(): this | Print the object count and total size (--summarize). |
class AwsS3MbSettings extends AwsSettings Settings for aws s3 mb.
| Member | Signature | Doc |
|---|---|---|
bucket | bucket(uri: string): this | The bucket to make, as an s3:// URI (positional). |
class AwsS3PresignSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
path | path(uri: string): this | The s3:// object to presign (positional). |
expiresIn | expiresIn(seconds: number): this | How long the URL stays valid, in seconds (--expires-in; default 3600). |
class AwsS3RmSettings extends AwsSettings Settings for aws s3 rm.
| Member | Signature | Doc |
|---|---|---|
path | path(uri: string): this | The s3:// object or prefix to remove (positional). |
recursive | recursive(): this | Remove every object under the prefix (--recursive). |
exclude | exclude(pattern: string): this | Keep objects matching the pattern (--exclude); repeatable, order kept. |
include | include(pattern: string): this | Remove objects matching the pattern despite an earlier exclude (--include). |
dryrun | dryrun(): this | Print what would be removed without removing it (--dryrun). |
class AwsS3SyncSettings extends AwsSettings Settings for aws s3 sync.
| Member | Signature | Doc |
|---|---|---|
source | source(path: string): this | The local directory or s3:// prefix to sync from (positional). |
destination | destination(path: string): this | The local directory or s3:// prefix to sync to (positional). |
delete | delete(): this | Delete files at the destination that the source does not have (--delete), which makes the destination a mirror rather than a superset. |
exclude | exclude(pattern: string): this | Skip files matching the pattern (--exclude); repeatable, order kept. |
include | include(pattern: string): this | Sync files matching the pattern despite an earlier exclude (--include). |
dryrun | dryrun(): this | Print what would change without changing it (--dryrun). |
exactTimestamps | exactTimestamps(): this | Treat same-size files with different timestamps as changed (--exact-timestamps). |
sizeOnly | sizeOnly(): this | Compare by size alone, ignoring timestamps (--size-only). |
acl | acl(value: string): this | A canned ACL for the uploaded objects (--acl). |
contentType | contentType(value: string): this | The uploaded objects' content type (--content-type). |
cacheControl | cacheControl(value: string): this | The uploaded objects' Cache-Control (--cache-control). |
storageClass | storageClass(value: string): this | The storage class for the uploaded objects (--storage-class). |
onlyShowErrors | onlyShowErrors(): this | Print only errors and warnings (--only-show-errors). |
noProgress | noProgress(): this | Leave out the file-transfer progress lines (--no-progress). |
class AwsSecretsmanagerGetSecretValueSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
secretId | secretId(id: string): this | The secret's name or ARN (--secret-id). |
versionId | versionId(id: string): this | A specific version, by id (--version-id). |
versionStage | versionStage(label: string): this | A specific version, by staging label (--version-stage); AWSCURRENT by default. |
class AwsSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
profile | profile(name: string): this | The named profile from the shared config and credentials files (--profile). |
region | region(name: string): this | The AWS Region to send the request to (--region), e.g. "eu-west-1". |
output | output(format: AwsOutputFormat): this | The output format (--output): json, text, table, yaml or yaml-stream. |
query | query(expression: string): this | A JMESPath expression that filters the response (--query). |
endpointUrl | endpointUrl(url: string): this | Send the request to this URL instead of the service's default endpoint (--endpoint-url). |
noCliPager | noCliPager(): this | Pass --no-cli-pager explicitly. The pager is already off through AWS_PAGER (see AwsSettings); the flag is for a build that wants it on the command line as well. AWS CLI v2 only. |
noVerifySsl | noVerifySsl(): this | Skip 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. |
noSignRequest | noSignRequest(): this | Send the request unsigned, without loading credentials (--no-sign-request). |
caBundle | caBundle(path: string): this | The CA certificate bundle to verify TLS against (--ca-bundle). |
cliReadTimeout | cliReadTimeout(seconds: number): this | The socket read timeout in seconds; 0 blocks forever (--cli-read-timeout). |
cliConnectTimeout | cliConnectTimeout(seconds: number): this | The socket connect timeout in seconds; 0 blocks forever (--cli-connect-timeout). |
debug | debug(): this | Turn 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 | flag(name: string, value?: string | number): this | Add 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 with file:// or fileb:// is replaced by that file's contents — which then leave the machine in the request. Never pass an untrusted value here. |
runner | runner(run: AwsSettingsRunner): this | Replace how this command is run. The default spawns the CLI; this is the seam a test answers commands through, and the way a build executes aws through something else. The runner reads the argv from the settings it is handed and must not call their run() — that is the call it replaces. |
run | run(): Promise<CommandOutput> | Run the command — through the runner when one is set, otherwise by spawning the CLI. Either way the output is reported to the settings' output hook and a non-zero exit throws a CommandError unless .noThrow() was called. |
type AwsSettingsRunner = unknown Runs one prepared aws command and returns what the process produced. The default spawns the CLI; a test, or a build that executes the CLI some other way, injects its own with AwsSettings.runner. The runner only produces the output: the exit code is judged afterwards exactly as for a spawned process, so a non-zero code still raises a CommandError unless the settings say .noThrow().
class AwsSsmGetParameterSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
name | name(value: string): this | The parameter's name or ARN (--name). |
withDecryption | withDecryption(): this | Return a SecureString decrypted (--with-decryption). Without it, a SecureString comes back as ciphertext. |
type AwsSsmParameterType = String | StringList | SecureString The kinds of parameter Parameter Store keeps.
class AwsSsmPutParameterSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
name | name(value: string): this | The parameter's name (--name). |
value | value(text: string): this | The value, given literally (--value). Refuses a value starting with file:// or fileb://: the CLI would read the named file rather than store the text — use valueFile when that is the intent. |
valueFile | valueFile(path: string): this | Read 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 | type(value: AwsSsmParameterType): this | The parameter's type (--type). |
overwrite | overwrite(): this | Replace an existing parameter (--overwrite). |
keyId | keyId(id: string): this | The KMS key that encrypts a SecureString (--key-id). |
description | description(text: string): this | A description of the parameter (--description). |
tier | tier(value: Standard | Advanced | Intelligent-Tiering): this | The storage tier (--tier). |
dataType | dataType(value: string): this | The data type (--data-type), e.g. "aws:ec2:image". |
class AwsStsAssumeRoleSettings extends 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.
| Member | Signature | Doc |
|---|---|---|
roleArn | roleArn(arn: string): this | The role to assume (--role-arn). |
roleSessionName | roleSessionName(name: string): this | An identifier for the session, shown in CloudTrail (--role-session-name). |
durationSeconds | durationSeconds(seconds: number): this | How long the credentials last, in seconds (--duration-seconds). |
externalId | externalId(id: string): this | The external id the role's trust policy requires (--external-id). |
policy | policy(json: string): this | An inline session policy, as a JSON document (--policy). |
serialNumber | serialNumber(serial: string): this | The MFA device's serial number or ARN (--serial-number). |
tokenCode | tokenCode(code: string): this | The code the MFA device shows (--token-code). |
class AwsStsGetCallerIdentitySettings extends AwsSettings Settings for aws sts get-caller-identity.
const AwsTasks: AwsTasksApi Typed task functions for the aws CLI.
interface AwsTasksApi The shape of AwsTasks.
| Member | Signature | Doc |
|---|---|---|
run | run(configure?: Configure<AwsSettings>): Promise<CommandOutput> | Run any aws command, built with .command(service, operation, …). |
stsGetCallerIdentity | stsGetCallerIdentity(configure?: Configure<AwsStsGetCallerIdentitySettings>): Promise<CommandOutput> | Who the build runs as: aws sts get-caller-identity. |
accountId | accountId(configure?: Configure<AwsStsGetCallerIdentitySettings>): Promise<string> | The AWS account id the build runs as, read back as a string. Pins --query Account --output text. |
stsAssumeRole | stsAssumeRole(configure?: Configure<AwsStsAssumeRoleSettings>): Promise<CommandOutput> | Take on a role's temporary credentials: aws sts assume-role (captured, never streamed). |
configureGet | configureGet(configure?: Configure<AwsConfigureGetSettings>): Promise<CommandOutput> | Read a CLI setting: aws configure get. |
configureSet | configureSet(configure?: Configure<AwsConfigureSetSettings>): Promise<CommandOutput> | Write a CLI setting: aws configure set. |
s3Cp | s3Cp(configure?: Configure<AwsS3CpSettings>): Promise<CommandOutput> | Copy a file or tree to, from or within S3: aws s3 cp. |
s3Sync | s3Sync(configure?: Configure<AwsS3SyncSettings>): Promise<CommandOutput> | Sync a tree to, from or within S3: aws s3 sync. |
s3Ls | s3Ls(configure?: Configure<AwsS3LsSettings>): Promise<CommandOutput> | List buckets or objects: aws s3 ls. |
s3Rm | s3Rm(configure?: Configure<AwsS3RmSettings>): Promise<CommandOutput> | Remove objects: aws s3 rm. |
s3Mb | s3Mb(configure?: Configure<AwsS3MbSettings>): Promise<CommandOutput> | Make a bucket: aws s3 mb. |
s3Presign | s3Presign(configure?: Configure<AwsS3PresignSettings>): Promise<CommandOutput> | Print a presigned URL for an object: aws s3 presign. |
ecrGetLoginPassword | ecrGetLoginPassword(configure?: Configure<AwsEcrGetLoginPasswordSettings>): Promise<CommandOutput> | Print a registry password: aws ecr get-login-password (captured, never streamed). |
ecrLoginPassword | ecrLoginPassword(configure?: Configure<AwsEcrGetLoginPasswordSettings>): Promise<string> | The ECR registry password, read back as a string, for docker login --password-stdin. |
ecrDescribeImages | ecrDescribeImages(configure?: Configure<AwsEcrDescribeImagesSettings>): Promise<CommandOutput> | Describe a repository's images: aws ecr describe-images. |
ecrDescribeRepositories | ecrDescribeRepositories(configure?: Configure<AwsEcrDescribeRepositoriesSettings>): Promise<CommandOutput> | Describe repositories: aws ecr describe-repositories. |
ecrBatchDeleteImage | ecrBatchDeleteImage(configure?: Configure<AwsEcrBatchDeleteImageSettings>): Promise<CommandOutput> | Delete images: aws ecr batch-delete-image. |
ecsUpdateService | ecsUpdateService(configure?: Configure<AwsEcsUpdateServiceSettings>): Promise<CommandOutput> | Roll a service onto a task definition: aws ecs update-service. |
ecsDescribeServices | ecsDescribeServices(configure?: Configure<AwsEcsDescribeServicesSettings>): Promise<CommandOutput> | Describe services: aws ecs describe-services. |
ecsWaitServicesStable | ecsWaitServicesStable(configure?: Configure<AwsEcsWaitServicesStableSettings>): Promise<CommandOutput> | Block until services are stable: aws ecs wait services-stable. |
ecsRegisterTaskDefinition | ecsRegisterTaskDefinition(configure?: Configure<AwsEcsRegisterTaskDefinitionSettings>): Promise<CommandOutput> | Register a task definition: aws ecs register-task-definition. |
ecsRunTask | ecsRunTask(configure?: Configure<AwsEcsRunTaskSettings>): Promise<CommandOutput> | Start a one-off task: aws ecs run-task. |
lambdaUpdateFunctionCode | lambdaUpdateFunctionCode(configure?: Configure<AwsLambdaUpdateFunctionCodeSettings>): Promise<CommandOutput> | Ship new code: aws lambda update-function-code. |
lambdaUpdateFunctionConfiguration | lambdaUpdateFunctionConfiguration(configure?: Configure<AwsLambdaUpdateFunctionConfigurationSettings>): Promise<CommandOutput> | Change a function's settings: aws lambda update-function-configuration. |
lambdaPublishVersion | lambdaPublishVersion(configure?: Configure<AwsLambdaPublishVersionSettings>): Promise<CommandOutput> | Publish a version: aws lambda publish-version. |
lambdaPublishedVersion | lambdaPublishedVersion(configure?: Configure<AwsLambdaPublishVersionSettings>): Promise<string> | Publish 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. |
lambdaUpdateAlias | lambdaUpdateAlias(configure?: Configure<AwsLambdaUpdateAliasSettings>): Promise<CommandOutput> | Move an alias: aws lambda update-alias. |
lambdaGetAlias | lambdaGetAlias(configure?: Configure<AwsLambdaGetAliasSettings>): Promise<CommandOutput> | Describe an alias: aws lambda get-alias. |
lambdaGetFunction | lambdaGetFunction(configure?: Configure<AwsLambdaGetFunctionSettings>): Promise<CommandOutput> | Describe a function: aws lambda get-function. |
lambdaWait | lambdaWait(configure?: Configure<AwsLambdaWaitSettings>): Promise<CommandOutput> | Wait for a function or version to reach a state: aws lambda wait. |
lambdaInvoke | lambdaInvoke(configure?: Configure<AwsLambdaInvokeSettings>): Promise<CommandOutput> | Invoke a function: aws lambda invoke. |
cloudformationDeploy | cloudformationDeploy(configure?: Configure<AwsCloudformationDeploySettings>): Promise<CommandOutput> | Create or update a stack: aws cloudformation deploy. |
cloudformationDescribeStacks | cloudformationDescribeStacks(configure?: Configure<AwsCloudformationDescribeStacksSettings>): Promise<CommandOutput> | Describe stacks: aws cloudformation describe-stacks. |
stackOutput | stackOutput(stack: string, key: string, configure?: Configure<AwsCloudformationDescribeStacksSettings>): Promise<string> | One output of a stack, read back as a string. Pins a --query projecting that output and --output json; fails when the stack has no such output. |
cloudformationDeleteStack | cloudformationDeleteStack(configure?: Configure<AwsCloudformationDeleteStackSettings>): Promise<CommandOutput> | Delete a stack: aws cloudformation delete-stack. |
cloudformationWait | cloudformationWait(configure?: Configure<AwsCloudformationWaitSettings>): Promise<CommandOutput> | Block until a stack reaches a state: aws cloudformation wait <waiter>. |
secretsmanagerGetSecretValue | secretsmanagerGetSecretValue(configure?: Configure<AwsSecretsmanagerGetSecretValueSettings>): Promise<CommandOutput> | Read a secret: aws secretsmanager get-secret-value (captured, never streamed). |
secretString | secretString(configure?: Configure<AwsSecretsmanagerGetSecretValueSettings>): Promise<string> | A secret's SecretString, read back exactly — multi-line values and surrounding whitespace included. Pins --query SecretString --output json; fails for a binary secret. |
ssmGetParameter | ssmGetParameter(configure?: Configure<AwsSsmGetParameterSettings>): Promise<CommandOutput> | Read a parameter: aws ssm get-parameter (captured, never streamed). |
parameterValue | parameterValue(configure?: Configure<AwsSsmGetParameterSettings>): Promise<string> | A parameter's value, read back exactly. Pins --query Parameter.Value --output json; add .withDecryption() for a SecureString. |
ssmPutParameter | ssmPutParameter(configure?: Configure<AwsSsmPutParameterSettings>): Promise<CommandOutput> | Write a parameter: aws ssm put-parameter. |
eksUpdateKubeconfig | eksUpdateKubeconfig(configure?: Configure<AwsEksUpdateKubeconfigSettings>): Promise<CommandOutput> | Write a kubeconfig entry for a cluster: aws eks update-kubeconfig. |
eksDescribeCluster | eksDescribeCluster(configure?: Configure<AwsEksDescribeClusterSettings>): Promise<CommandOutput> | Describe a cluster: aws eks describe-cluster. |
cloudwatchGetMetricData | cloudwatchGetMetricData(configure?: Configure<AwsCloudwatchGetMetricDataSettings>): Promise<CommandOutput> | Read metric datapoints: aws cloudwatch get-metric-data. |
metricValue | metricValue(configure: Configure<AwsCloudwatchMetricValueSettings>): Promise<number> | One 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. |
cloudwatchGetMetricStatistics | cloudwatchGetMetricStatistics(configure?: Configure<AwsCloudwatchGetMetricStatisticsSettings>): Promise<CommandOutput> | Read metric statistics: aws cloudwatch get-metric-statistics. |
cloudwatchDescribeAlarms | cloudwatchDescribeAlarms(configure?: Configure<AwsCloudwatchDescribeAlarmsSettings>): Promise<CommandOutput> | Describe alarms: aws cloudwatch describe-alarms. |
alarmState | alarmState(name: string, configure?: Configure<AwsCloudwatchDescribeAlarmsSettings>): Promise<AwsCloudwatchAlarmState> | The state of one metric, composite or log alarm: OK, ALARM or INSUFFICIENT_DATA. |
logsStartQuery | logsStartQuery(configure?: Configure<AwsLogsStartQuerySettings>): Promise<CommandOutput> | Start a Logs Insights query: aws logs start-query. |
logsGetQueryResults | logsGetQueryResults(configure?: Configure<AwsLogsGetQueryResultsSettings>): Promise<CommandOutput> | Read a Logs Insights query's results: aws logs get-query-results. |
logsStopQuery | logsStopQuery(configure?: Configure<AwsLogsStopQuerySettings>): Promise<CommandOutput> | Stop a running Logs Insights query: aws logs stop-query. |
logsInsightsQuery | logsInsightsQuery(configure: Configure<AwsLogsInsightsQuerySettings>): Promise<AwsLogsInsightsRow[]> | Run a Logs Insights query to the end and return its rows: start it, poll get-query-results until it is Complete, and fail with an AwsLogsQueryError when it ends otherwise or outlasts the timeout. |
logsFilterLogEvents | logsFilterLogEvents(configure?: Configure<AwsLogsFilterLogEventsSettings>): Promise<CommandOutput> | Search a log group's events: aws logs filter-log-events. |
logsTail | logsTail(configure?: Configure<AwsLogsTailSettings>): Promise<CommandOutput> | Print a log group's recent events: aws logs tail. |
type AwsTime = Date | string A time given as a Date or as a string the CLI parses (ISO 8601).
function cloudwatch(configure: Configure<AwsCloudwatchAnalysisSettings>): AwsCloudwatchAnalysis An analysis that reads a CloudWatch metric over a recent window and fails the canary when any datapoint is out of bounds — or when there is no data, unless AwsCloudwatchAnalysisSettings.missingDataAs says what no data means. Each datapoint covers one period, so a .max(5) on a per-minute Sum means "no minute with more than five".
The lambda runs on each check, so it may read resolved parameters, and every failure message — one from the lambda included — passes through the run's redactor.
function lambdaCanary(configure: Configure<AwsLambdaCanarySettings>): AwsLambdaCanary A Lambda alias as a canary platform, for @zuke/canary:
c.platform(lambdaCanary((l) =>
l.functionName("api").alias("live").zipFile("dist/api.zip")
.aws((a) => a.profile("deploy").region("eu-west-1"))
))
The lambda runs on every call, so it may read resolved parameters.
- stage — reads the alias (get-alias), whose version becomes the stable one; waits out an update in progress (wait function-updated-v2) and publishes the candidate with update-function-code --publish, or takes .version(...); reads it back with get-function; waits for it to be Active (wait published-version-active); records the rollout. The alias is not changed. - expose — update-alias --routing-config AdditionalVersionWeights={"<candidate>": <n/100>} --revision-id <rev>. - promote — update-alias --function-version <candidate> with the routing cleared. - abort — takes the candidate's weight off mid-rollout; run by hand, --function-version <stable> with the routing cleared. A rollback with nothing recorded runs nothing: nothing was staged.
Every call after stage that has its record — expose, promote, and abort mid-rollout — compares the configured function, alias and AWS flags with the record, reads the alias and checks its ARN (which names the account and region), and refuses on any difference before changing anything. Expose and promote also check that the alias splits only as the rollout left it and that the candidate still has the code staged. Each update-alias carries the alias's --revision-id, so a change made between the read and the update fails it. A hand-run abort has no record and uses the configuration as it is.
Lambda's weighted routing needs the two versions to share an execution role and a dead-letter configuration; the update fails, and the canary rolls back, when they do not.