0.1.5 • Published 6 years ago

rxjs-aws-bindings v0.1.5

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

RxJS-AWS-Bindings

RxJS bindings for the AWS JavaScript SDK

Installing

npm i --save rxjs-aws-bindings

Importing into your project

JavaScript

const RxAWS = require('rxjs-aws-bindings');

TypeScript

import * as RxAWS from 'rxjs-aws-bindings';

Example

Submit an AWS Batch job, using config obtained from an S3 bucket.

import * as RxAWS from 'rxjs-aws-bindings';

const S3 = new RxAWS.S3({
  region: 'eu-west-2'
});

const Batch = new RxAWS.Batch({
  maxRetries: 1
});

const getObjectParams = {
  Bucket: process.env.MY_CONFIG_BUCKET,
  Key: process.env.MY_CONFIG_FILENAME
};

S3.getObject(getObjectParams).pipe(
  flatMap((s3GetObjectResponse) => {

    const config = JSON.parse(s3GetObjectResponse.Body.toString('utf8'));

    return Batch.submitJob({
      jobDefinition: config.JOB_DEFINITION,
      jobName: config.JOB_NAME,
      jobQueue: config.JOB_QUEUE
    });
  })
)
.subscribe({
  error: (err) => console.error('Somethings gone wrong!!!:', err),
  complete: () => console.log('Successfully submitted batch job!!!')
});

License

This project is licensed under the MIT License - see the LICENSE file for details

0.1.5

6 years ago

0.1.4

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago