Skip to content

ar4mirez/hapi-aws

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

hapi-aws

AWS plugin for HapiJS.

travis build codecov coverage version downloads semantic-release

Dependency Status devDependency Status Build Status

Install

$ npm install hapi-aws

Usage

// Using server register.

server.register({
    register: require('hapi-aws'),
    options: {
        global: {
            accessKeyId: 'accessKeyId',
            secretAccessKey: 'secretAccessKey',
            region: 'us-east-1'
        },
        services: [{
            name: 'ec2Identification',
            service: 'EC2',
            options: {
                accessKeyId: 'anotherAccessKeyId',
                secretAccessKey: 'anotherSecretAccessKey',
            }
        }, {
            name: 's3Identification',
            service: 'S3',
            options: {
                region: 'us-west-2'
            }
        }]
    }
})

// Using manifest.
{
    ...
    registration: [{
        plugin: 'hapi-aws',
        options: {
            global: {
                accessKeyId: 'accessKeyId',
                secretAccessKey: 'secretAccessKey',
                region: 'us-east-1'
            },
            services: [{
                name: 's3Identification',
                service: 'S3',
                options: {
                    region: 'us-west-2'
                }
            }]
        }
    }]
}

AWS Supported services

Check the following services here: AWS Services

When passing a service please drop the AWS namespace example:

service.name: [string] used later to access the service like: server.plugins['hapi-aws'].aws.ec2Identification

service.service: [string] from the previous list exmple: EC2