Expand description
AWS S3 SDK function wrappers for caching deployer artifacts
Structs§
- Region
- The region to send requests to.
Constants§
- PRESIGN_
DURATION - Duration for pre-signed URLs (6 hours)
- S3_
BUCKET_ NAME - S3 bucket name for caching deployer artifacts
- S3_
DEPLOYMENTS_ PREFIX - S3 prefix for per-deployment data
- S3_
TOOLS_ BINARIES_ PREFIX - S3 prefix for tool binaries: tools/binaries/{tool}/{version}/{platform}/{filename}
- S3_
TOOLS_ CONFIGS_ PREFIX - S3 prefix for tool configs: tools/configs/{deployer_version}/{component}/{file}
Functions§
- cache_
content_ and_ presign - Caches content to S3 if it doesn’t exist, then returns a pre-signed URL
- cache_
file_ and_ presign - Caches a file to S3 by digest if it doesn’t exist, then returns a pre-signed URL
- create_
s3_ client - Creates an S3 client for the specified AWS region
- delete_
bucket - Deletes a bucket (must be empty first)
- delete_
bucket_ and_ contents - Deletes all objects in a bucket and then deletes the bucket itself
- delete_
prefix - Deletes all objects under a prefix in S3 using batch delete (up to 1000 objects per request)
- ensure_
bucket_ exists - Ensures the S3 bucket exists, creating it if necessary
- hash_
file - Computes the SHA256 hash of a file and returns it as a hex string
- is_
no_ such_ bucket_ error - Checks if an error is a “bucket does not exist” error
- object_
exists - Checks if an object exists in S3
- presign_
url - Generates a pre-signed URL for downloading an object from S3
- upload_
and_ presign - Uploads a file to S3 and returns a pre-signed URL for downloading it
- upload_
file - Uploads a file to S3