New to Kestra?
Use blueprints to kickstart your first workflows.
Audit Alibaba Cloud OSS for objects stuck on the Standard storage tier past their expected age and alert Slack before costs grow.
An Alibaba Cloud OSS lifecycle rule that is missing, misconfigured, or scoped to the wrong prefix lets objects sit on the expensive Standard storage class indefinitely instead of transitioning to Infrequent Access, Archive, or Cold Archive - a cost drift that is invisible until a monthly bill review. This blueprint lists objects on a schedule and alerts Slack with the exact keys, sizes, and ages of anything still on Standard well past a configured age threshold.
periodic_storage_class_check (io.kestra.plugin.core.trigger.Schedule) runs once a day, explicitly passing alibaba_region, bucket_name, object_prefix, max_object_age_days, and max_files_to_scan through its own inputs: block so the flow is self-contained when the trigger fires. Shipped disabled so a manual run can be verified first.probe_list_objects (io.kestra.plugin.alibaba.oss.List) lists up to max_files_to_scan objects under object_prefix, capturing each object's key, size, lastModified, and storageClass.evaluate_storage_class_drift (io.kestra.plugin.core.flow.If) branches on whether any returned object is still Standard class and older than max_object_age_days.then (STORAGE_CLASS_DRIFT_DETECTED): alert_storage_class_drift reports every flagged object's key, size, and age to Slack.else (HEALTHY): log_storage_class_healthy records the clean pass along with how many objects were scanned.log_audit_complete always runs last, printing the total objects scanned regardless of which branch fired.errors block alerts Slack separately if the flow itself fails outright - a missing bucket or invalid credentials.storageClass and lastModified fields, not a separately-maintained spreadsheet of what should have transitioned by when.io.kestra.plugin.alibaba.oss.List combined with jq's fromdateiso8601/now date-window pattern, reusing the same approach this repository's AWS Certificate Manager sentinel established, applied here to a completely different plugin with no prior blueprint coverage at all.List task used for governance monitoring rather than for basic data ingestion.OSS lifecycle rules run silently and have no built-in "alert me if objects aren't transitioning as expected" primitive - a rule that stopped matching due to a prefix change produces no error, just a growing Standard-tier footprint. Kestra supplies the schedule, the HEALTHY/STORAGE_CLASS_DRIFT_DETECTED classification as a first-class branch, and an execution history showing exactly when drift was first detected and for which objects.
alibaba_region, bucket_name, object_prefix).Local testing: Alibaba Cloud publishes its own lightweight, Ruby-based OSS-Emulator for testing and debugging against the same OSS APIs, and the List task's own endpointOverride and pathStyleAccess properties are explicitly documented as being "useful with custom endpoints such as a local emulator." Exact Docker packaging and current maintenance status of that emulator were not independently confirmed; a real Alibaba Cloud account remains the most complete way to exercise this blueprint.
ALIBABA_ACCESS_KEY_ID / ALIBABA_ACCESS_KEY_SECRET: credentials for io.kestra.plugin.alibaba.oss.List.SLACK_WEBHOOK_URL: Slack incoming webhook used by alert_storage_class_drift and the errors block.SECRET_, base64-encoded - for example SECRET_ALIBABA_ACCESS_KEY_SECRET=$(echo -n '<your-secret-key>' | base64) - and read back in flows with {{ secret('NAME') }}.| Input | Type | Default | Description |
|---|---|---|---|
alibaba_region |
STRING | cn-hangzhou |
Alibaba Cloud region the OSS endpoint is derived from |
bucket_name |
STRING | REPLACE-WITH-YOUR-BUCKET-NAME |
The target OSS bucket to audit |
object_prefix |
STRING | "" |
Optional key prefix to scope the audit |
max_object_age_days |
INT | 90 |
Inactivity age threshold in days for Standard-tier objects |
max_files_to_scan |
INT | 1000 |
Max objects returned by List (capped at 1000 limit) |
outputs.probe_list_objects.objects (list): every scanned object's key, size, etag, lastModified, and storageClass (verified fields from the List task's own OssObject model).ALIBABA_ACCESS_KEY_ID, ALIBABA_ACCESS_KEY_SECRET, and SLACK_WEBHOOK_URL secrets.log_storage_class_healthy fires if nothing is drifted.max_object_age_days below the real age of a known Standard-tier object, and re-run to confirm alert_storage_class_drift fires with the correct key and age.periodic_storage_class_check once you trust the check against your real bucket.bucket_name/object_prefix combinations with io.kestra.plugin.core.flow.Loop to audit multiple buckets or logical folders in one run.max_object_age_days progressively and track the flagged count over several executions (via Kestra's own execution history) to see whether drift is growing or shrinking after a lifecycle policy fix.io.kestra.plugin.alibaba.oss.Copy to re-upload a drifted object with an explicit storage class override, behind an explicit approval gate - deliberately kept out of this sentinel so the monitoring path never changes storage class on its own.List caps results at maxFiles (hard limit 1000, default 25) - verified directly from the task's own Javadoc, which logs a warning when more objects match. A bucket or prefix with more objects than max_files_to_scan will only have its first page audited; this blueprint does not paginate beyond that cap.regexp filter is intentionally unused here - the task's own Javadoc notes it is time-boxed against catastrophic backtracking and limited to 256 characters, which is a safety feature worth knowing about if you extend this blueprint to filter by key pattern.OssObject output fields (key, size, etag, lastModified, storageClass), and the OSS storage class names are taken verbatim from the plugin's own source - but no Kestra engine was run to execute this flow end to end.