Sign inSign up

davidb31/s3-resource-simple

By davidb31

•Updated over 6 years ago

Concourse CI Resource for uploading files to S3 (fork of 18F)

Image
0

1M+

davidb31/s3-resource-simple repository overview

⁠Simple S3 Resource for Concourse CI⁠

Resource to upload files to S3. Unlike the the official S3 Resource⁠, this Resource can upload or download multiple files.

This repository is a fork of 18F/s3-resource-simple⁠ with support of:

⁠Usage

Include the following in your Pipeline YAML file, replacing the values in the angle brackets (< >):

resource_types:
- name: s3-sync
  type: docker-image
  source:
    repository: davidb31/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]
    options: [<optional, see note below>]
    region: <optional, see note below>
jobs:
- name: <job name>
  plan:
  - <some Resource or Task that outputs files>
  - put: <resource name>
    params:
      options: [<optional, see note below>]
      dir: <optional, see note below>
⁠AWS Credentials

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.

⁠options

The options parameter is 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⁠. Final options is the concatenation of the one defined into "resources/source" and into "put/params".

⁠dir

Use to upload from a subfolder of the working directory.

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 dir in our put configuration:

      - put: "results-bucket"
        params:
          dir: 'results'
⁠region

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

Tag summary

Content type

Image

Digest

Size

46.7 MB

Last updated

over 6 years ago

docker pull davidb31/s3-resource-simple