S3 Upload
Type: DEVRAMPS:S3:UPLOAD
Category: deploy
Version: 1.0.0
Description
Upload a bundle artifact to an S3 bucket, with optional decompression.
Downloads a bundle artifact from DevRamps artifact storage and uploads it to a user-specified S3 bucket. Supports decompressing the bundle ZIP before uploading so files land in their original directory structure — ideal for deploying frontend assets to S3 for CloudFront serving.
When decompress is enabled, individual files are uploaded preserving their
relative directory structure under the specified prefix. Content-Type is
auto-detected from file extensions for common web file types (HTML, CSS, JS,
JSON, images, fonts, etc.). Custom S3 metadata such as Cache-Control can be
applied to all uploaded files.
When clean is enabled, all existing objects under the target prefix are
deleted before uploading. This ensures stale files from previous deployments
are removed.
Commonly chained with DEVRAMPS:CLOUDFRONT:INVALIDATE to bust CDN cache
after deploying new assets.
Parameters
Required Parameters
| Parameter | Type | Description |
|---|---|---|
source_s3_url | string | S3 URL of the bundle artifact (e.g., s3://bucket/key.zip). Use ${{ stage.artifacts['name'].s3_url }} to reference a bundle artifact. |
bucket | string | Target S3 bucket name. |
decompress | boolean | When true, extract the ZIP and upload individual files preserving directory structure. When false, upload the ZIP as a single object. |
clean | boolean | When true, delete all existing objects under the target prefix before uploading. |
Optional Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prefix | string | - | Key prefix path within the bucket (e.g., 'assets/'). |
metadata | object | - | S3 object metadata to apply to uploaded files. |
account_id | string | - | AWS account ID. Defaults to stage account. |
region | string | - | AWS region. Defaults to stage region. |
Example Usage
- type: DEVRAMPS:S3:UPLOAD
name: Deploy Frontend to S3
params:
source_s3_url: ${{ stage.artifacts['frontend-bundle'].s3_url }}
bucket: my-frontend-bucket
prefix: assets/
decompress: true
clean: true
metadata:
cache_control: "max-age=31536000"