Resource to upload files to S3. This Resource can upload or download multiple files.
1M+
Resource to upload files to S3. Unlike the the official S3 Resource, this Resource can upload or download multiple files.
Include the following in your Pipeline YAML file, replacing the values in the angle brackets (< >):
resource_types:
- name: <resource type name>
type: docker-image
source:
repository: 18fgsa/s3-resource-simple
resources:
- name: <resource name>
type: <resource type name>
source:
access_key_id: {{aws-access-key}}
secret_access_key: {{aws-secret-key}}
bucket: {{aws-bucket}}
path: [<optional>, use to sync to a specific path of the bucket instead of root of bucket]
uploadOptions: [<optional, see note below>]
downloadOptions: [<optional, see note below>]
region: <optional, see below>
jobs:
- name: <job name>
plan:
- <some Resource or Task that outputs files>
- put: <resource name>
The access_key_id and secret_access_key are optional and if not provided the EC2 Metadata service will be queried for role based credentials.
The uploadOptions & downloadOptions parameters are synonymous with the options that aws cli accepts for sync. Please see S3 Sync Options and pay special attention to the Use of Exclude and Include Filters.
UploadOptions will be used when the out step is performed.
DownloadOptions will be used when the in step is performed.
Given the following directory test:
test
├── results
│ ├── 1.json
│ └── 2.json
└── scripts
└── bad.sh
we can upload only the results subdirectory by using the following uploadOptions in our task configuration:
uploadOptions:
- "--exclude '*'"
- "--include 'results/*'"
we can exclude all the files in s3 from being downloaded by using the following downloadOptions in our task configuration:
downloadOptions:
- "--exclude '*'"
Interacting with some AWS regions (like London) requires AWS Signature Version 4. This options allows you to explicitly specify region where your bucket is located (if this is set, AWS_DEFAULT_REGION env variable will be set accordingly).
region: eu-west-2
Content type
Image
Digest
Size
47.4 MB
Last updated
over 8 years ago
docker pull chillbrodev/s3-resource-simple:v3