How to use the aws-sdk.EnvironmentCredentials function in aws-sdk

To help you get started, we’ve selected a few aws-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-samples / aws-lambda-zombie-workshop / ElasticSearchLambda / ZombieWorkshopSearchIndexing.js View on Github external
var AWS = require('aws-sdk');
var path = require('path');

/* == Globals == */
var esDomain = {
    region: 'us-west-2',
    endpoint: 'https://ENDPOINT_HERE',
    index: 'messages',
    doctype: 'message'
};
var endpoint = new AWS.Endpoint(esDomain.endpoint);
var creds = new AWS.EnvironmentCredentials('AWS');


/* Lambda "main": Execution begins here */
exports.handler = function(event, context) {
    
        console.log(JSON.stringify(event, null, '  '));
        event.Records.forEach(function(record) {
            if (typeof record.dynamodb.NewImage != 'undefined')
             {
                var doc = {message: {
                    name: record.dynamodb.NewImage.name.S,
                    message: record.dynamodb.NewImage.message.S,
                    channel: record.dynamodb.NewImage.channel.S,
                    timestamp: record.dynamodb.NewImage.timestamp.N}
                }
                console.log('document posted to ElasticSearch: ' + JSON.stringify(doc))
github awslabs / aws-data-lake-solution / source / api / services / logging / lib / logging.js View on Github external
"use strict";

let AWS = require('aws-sdk');
let moment = require('moment');
let _ = require('underscore');

let creds = new AWS.EnvironmentCredentials('AWS'); // Lambda provided credentials

const dynamoConfig = {
    credentials: creds,
    region: process.env.AWS_REGION
};
const docClient = new AWS.DynamoDB.DocumentClient(dynamoConfig);
const cloudwatchlogs = new AWS.CloudWatchLogs({
    region: process.env.AWS_REGION
});
const ddbTable = 'data-lake-settings';
const logName = '/datalake/audit-log';

let logging = (function() {

    let logging = function() {};
github awslabs / aws-connected-vehicle-solution / source / services / driversafety / lib / driver-safety.js View on Github external
*  OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions    * 
 *  and limitations under the License.                                                                                * 
 *********************************************************************************************************************/

/**
 * @author Solution Builders
 */

'use strict';

let shortid = require('shortid');
let moment = require('moment');
let _ = require('underscore');
let AWS = require('aws-sdk');

let creds = new AWS.EnvironmentCredentials('AWS'); // Lambda provided credentials
const dynamoConfig = {
    credentials: creds,
    region: process.env.AWS_REGION
};
const ddbTable = process.env.VEHICLE_TRIP_TBL;

/**
 * Performs operations for driver safety recording and management actions interfacing primiarly with
 * Amazon DynamoDB table.
 *
 * @class dtc
 */
let driversafety = (function() {

    /**
     * @class driversafety
github encrypted-dev / userbase / src / proof-of-concept / tools / ssh.js View on Github external
      function () { return new aws.EnvironmentCredentials('AMAZON') },
      function () { return new aws.SharedIniFileCredentials({ profile }) },
github awslabs / media-analysis-solution / source / helper / lib / s3helper.js View on Github external
*                                                                                                                    * 
 *      http://www.apache.org/licenses/LICENSE-2.0                                                                    * 
 *                                                                                                                    * 
 *  or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 
 *  OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions    * 
 *  and limitations under the License.                                                                                * 
 *********************************************************************************************************************/ 
 
/** 
 * @author Solution Builders 
 */ 

'use strict';

let AWS = require('aws-sdk');
let creds = new AWS.EnvironmentCredentials('AWS');

/**
 * Helper function to interact with S3 on behalf of a
 * cfn custom resource
 *
 * @class s3helper
 */
let s3helper = (function() {

    /**
     * @class s3helper
     * @constructor
     */
    let s3helper = function() {};

    /**
github awslabs / media-analysis-solution / source / analysis / lib / upload / upload.js View on Github external
*                                                                                                                    * 
 *      http://www.apache.org/licenses/LICENSE-2.0                                                                    * 
 *                                                                                                                    * 
 *  or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 
 *  OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions    * 
 *  and limitations under the License.                                                                                * 
 *********************************************************************************************************************/ 
 
/** 
 * @author Solution Builders 
 */ 

'use strict';

let AWS = require('aws-sdk');
let creds = new AWS.EnvironmentCredentials('AWS');

const s3Bucket = process.env.S3_BUCKET;

/**
 * Uploads response data to S3
 *
 * @class uplaod
 */

 let upload = (function() {

   /**
    * @class upload
    * @constructor
    */
    let upload = function() {};
github arabold / aws-to-slack / src / parsers / cloudwatch / chart.js View on Github external
				() => new AWS.EnvironmentCredentials("AMAZON"),
				() => new AWS.SharedIniFileCredentials({ profile: config.profile || "default" }),
github MoonMail / MoonMail / lists-microservice / src / lib / elasticsearch / index.js View on Github external
function awsCredentials() {
  return new AWS.EnvironmentCredentials('AWS');
}
github khalidx / resource-x / src / index.ts View on Github external
        () => new AWS.EnvironmentCredentials('AWS'),
        () => new AWS.SharedIniFileCredentials()
github awslabs / media-analysis-solution / source / analysis / lib / image / image.js View on Github external
*      http://www.apache.org/licenses/LICENSE-2.0                                                                    * 
 *                                                                                                                    * 
 *  or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 
 *  OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions    * 
 *  and limitations under the License.                                                                                * 
 *********************************************************************************************************************/ 
 
/** 
 * @author Solution Builders 
 */ 

'use strict';

let AWS = require('aws-sdk');
let upload = require('./../upload');
let creds = new AWS.EnvironmentCredentials('AWS');

const s3Bucket = process.env.S3_BUCKET;
const confidence_score = parseInt(process.env.CONFIDENCE_SCORE);

/**
 * Performs operations for image recognition actions using
 * Amazon Rekognition.
 *
 * @class image
 */

 let image = (function() {

   /**
    * @class image
    * @constructor