# connector-s3-upload-token

An Apollo [`DataSource`](https://github.com/apollographql/apollo-server/tree/f63fc5adcd092db682c0d62b904e9077d206ebd8/packages/apollo-datasource)
for interacting with [STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html) to get temporary access to upload to an S3 Bucket / path

## Usage

### Configuring / Usage

```js
const config = {
    uploadBucket: 'qa-ows-payments', // Bucket that needs the file uploaded to it
    uploadTokenDuration: 1000, // How long to allow the token to be valid for
    uploadRoleArn: 'uploading as',
    region: 'us-east-1',
};

const s3UploadTokenConnector = new S3UploadTokenConnector(config);
const s3UploadToken = s3UploadTokenConnector.getUploadToken('folder-to-upload-to');
```
