Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onebeyond/systemic-aws-s3
A Systemic component for the AWS S3 SDK v3
https://github.com/onebeyond/systemic-aws-s3
aws hacktoberfest systemic
Last synced: about 2 months ago
JSON representation
A Systemic component for the AWS S3 SDK v3
- Host: GitHub
- URL: https://github.com/onebeyond/systemic-aws-s3
- Owner: onebeyond
- License: mit
- Created: 2021-03-12T16:01:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T08:28:24.000Z (5 months ago)
- Last Synced: 2024-05-16T23:53:12.064Z (4 months ago)
- Topics: aws, hacktoberfest, systemic
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@guidesmiths/systemic-aws-s3
- Size: 379 KB
- Stars: 2
- Watchers: 8
- Forks: 3
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[![Maintainability](https://api.codeclimate.com/v1/badges/fb29150fdbf11ffb3b83/maintainability)](https://codeclimate.com/github/onebeyond/systemic-aws-s3/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/fb29150fdbf11ffb3b83/test_coverage)](https://codeclimate.com/github/onebeyond/systemic-aws-s3/test_coverage)# Systemic AWS S3
A [Systemic](https://guidesmiths.github.io/systemic/#/) component for the [AWS S3 SDK v3](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html).
## How to use it
### Configuration
A typical, simple configuration looks like this:
```json
{
"region": "us-east-1",
"credentials": {
"secretAccessKey": "test",
"accessKeyId": "test"
}
}
```[Here](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/s3clientconfig.html) you can finde the complete configuration interface of S3Client class constructor that set the region, credentials and other options.
### Initialize the component
As with any other [Systemic component](https://guidesmiths.github.io/systemic/#/?id=components), you can run it with the `start` method:
```js
const initAWSS3 = require('systemic-aws-s3');
const { start } = initAWSS3();const api = await start({ config }); // configuration similar to the one above
```### Call the API commands
As the AWS API has dozens of commands, intead of having one wrapper for each of them, the component exposes one single command `commandExecutor` that can be used to call any of the commands exposed by the api:
For example, to list all the objects in a specific bucket:
```js
const listObjectConfig = {
commandParams: { Bucket: bucketName },
commandName: 'listObjects'
}
const res = await api.commandExecutor(listObjectConfig);
```You can check all the available commands [here](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/classes/s3.html).
### Custom commands
In the future, this component will also expose some custom commands not supported by the official API.
## Guide for developers
### How to test it
You can test the whole test suite running one of these commands:
```bash
# all tests will be executed once
npm run test# tests will be executed every time code changes (useful when coding)
npm run test:watch
```In case that you want to just execute a certain test case, you can also use these scripts to up / tear down the infra.
```bash
npm run infra:up
npm run infra:down
```