Delete S3 objects
Delete one object, or every object under a prefix, from an S3 bucket. Use it to clear old backups or build output.
Install v1.0.0
Installs the template into your Argo namespace. The URL is pinned to this version.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/s3-delete/1.0.0/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/s3-delete/1.0.0/template.yaml
Facts
- Category
- Object storage
- Tags
- aws-cli object-storage
- Entrypoint
delete- Template SHA-256
81f49576f4638eeb74b83bfc97287fbaf980a23c7ae43e4aa5213680ed75732c- Source
- s3-delete at catalog commit 67458f7
- API
- item document, latest template.yaml
Images and provenance
Every image is pinned by digest, so a rebuilt tag can never change what this version runs.
| Repository | Tag | Digest |
|---|---|---|
amazon/aws-cli | 2.39.3 | sha256:d557b3524475d70dd3104cf44d96568ee3188897b73a6ece2b37aa50e1af362f |
Parameters
| Name | Description | Default |
|---|---|---|
bucket required |
S3 bucket, without the s3:// prefix. Example acme-db-backups |
none |
key required |
Object key, or the prefix to clear when recursive is "true". Example checkout/2026-09/ |
none |
aws-access-key-id-key |
Key in that Secret that holds the access key id. | access-key-id |
aws-secret-access-key-key |
Key in that Secret that holds the secret access key. | secret-access-key |
aws-secret-name |
Name of the Kubernetes Secret that holds the AWS credentials. | aws-credentials |
recursive |
Set to "true" to delete everything under the key as a prefix. One of true, false |
false |
region |
AWS region of the resource. | us-east-1 |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: s3-delete
labels:
dagweave.io/catalog-item: s3-delete
annotations:
dagweave.io/catalog-version: "1.0.0"
dagweave.io/catalog-category: "Object storage"
spec:
entrypoint: delete
templates:
- name: delete
inputs:
parameters:
- name: bucket
- name: key
- name: recursive
default: "false"
- name: region
default: "us-east-1"
- name: aws-secret-name
default: "aws-credentials"
- name: aws-access-key-id-key
default: "access-key-id"
- name: aws-secret-access-key-key
default: "secret-access-key"
retryStrategy:
limit: "2"
retryPolicy: OnError
backoff:
duration: 10s
factor: "2"
maxDuration: 2m
container:
# amazon/aws-cli:2.39.3
image: amazon/aws-cli@sha256:d557b3524475d70dd3104cf44d96568ee3188897b73a6ece2b37aa50e1af362f
command: [sh, -c]
args:
- |
set -eu
set -- s3 rm "s3://${S3_BUCKET}/${S3_KEY}"
if [ "${RECURSIVE}" = "true" ]; then set -- "$@" --recursive; fi
aws "$@"
env:
- name: S3_BUCKET
value: "{{inputs.parameters.bucket}}"
- name: S3_KEY
value: "{{inputs.parameters.key}}"
- name: RECURSIVE
value: "{{inputs.parameters.recursive}}"
- name: AWS_DEFAULT_REGION
value: "{{inputs.parameters.region}}"
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.aws-secret-name}}"
key: "{{inputs.parameters.aws-access-key-id-key}}"
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.aws-secret-name}}"
key: "{{inputs.parameters.aws-secret-access-key-key}}"
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 256Mi
Version history
Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.
-
1.0.0 latest 2026-10-18
Initial release.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/s3-delete/1.0.0/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/s3-delete/1.0.0/template.yaml
Run it once
After installing, from the command line.
argo submit -n argo --from workflowtemplate/s3-delete \
-p bucket=acme-db-backups \
-p key=checkout/2026-09/
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: s3-delete-
spec:
workflowTemplateRef:
name: s3-delete
arguments:
parameters:
- name: bucket
value: "acme-db-backups"
- name: key
value: "checkout/2026-09/"
As a step of a larger workflow
steps:
- - name: s3-delete
templateRef:
name: s3-delete
template: delete