當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript aws-sdk.config類代碼示例

本文整理匯總了TypeScript中aws-sdk.config的典型用法代碼示例。如果您正苦於以下問題:TypeScript config類的具體用法?TypeScript config怎麽用?TypeScript config使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了config類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

 constructor(public config: AWSConfig) {
   awsConfig.update({
     credentials: new Credentials(config.accessKeyId, config.secretAccessKey),
     region: config.region
   });
   this.db = new DynamoDB() as any;
 }
開發者ID:colinmathews,項目名稱:node-workhorse-aws,代碼行數:7,代碼來源:dynamodb-state-manager.ts

示例2: configureAWS

 private configureAWS(config:DeployConfig) {
   if (this.hasConfiguredAWS) {
     return;
   }
   this.hasConfiguredAWS = true;
   awsConfig.update({
     credentials: new Credentials(config.accessKeyId, config.secretAccessKey),
     region: config.region
   });
 }
開發者ID:colinmathews,項目名稱:deploy-lambda,代碼行數:10,代碼來源:delete-old-versions.ts

示例3: constructor

 constructor(public config: S3Config) {
   awsConfig.update({
     credentials: new Credentials(config.accessKeyId, config.secretAccessKey),
     region: config.region
   });
   this.s3 = new S3({
     credentials: new Credentials(config.accessKeyId, config.secretAccessKey),
     region: config.region,
     bucket: config.bucket
   });
 }
開發者ID:colinmathews,項目名稱:s3-append,代碼行數:11,代碼來源:s3-consolidator.ts

示例4: run

  run(config:DeployConfig): Promise<any> {
    awsConfig.update({
      credentials: new Credentials(config.accessKeyId, config.secretAccessKey),
      region: config.region
    });

    return this.publish(config)
    .then((result:any[]) => {
      if (config.lambdaAlias) {
        return this.pointAlias(config, result);
      }
    });
  }
開發者ID:colinmathews,項目名稱:deploy-lambda,代碼行數:13,代碼來源:publish-functions.ts

示例5: _getAWS

 _getAWS(params) {
   params = params || this.resources || {};
   params.accessKeyId = params.accessKeyId || process.env["AWS_ACCESS_KEY_ID"];
   params.secretAccessKey =
     params.secretAccessKey || process.env["AWS_SECRET_ACCESS_KEY"];
   params.sessionToken =
     params.sessionToken || process.env["AWS_SESSION_TOKEN"];
   params.region =
     params.region || process.env["AWS_DEFAULT_REGION"] || "us-east-1";
   AWS.config.update({
     accessKeyId: params.accessKeyId,
     secretAccessKey: params.secretAccessKey,
     sessionToken: params.sessionToken,
     region: params.region
   });
   return AWS;
 }
開發者ID:loopingz,項目名稱:webda-shell,代碼行數:17,代碼來源:aws.ts

示例6: processGetAWS

export function processGetAWS(request: GetAWSSignRequest, callback: (GetAWSSignResponse) => void) {
    aws.config.update({
        accessKeyId: AWS_ACCESS_KEY,
        secretAccessKey: AWS_SECRET_KEY,
        signatureVersion: 'v4',
        region: 'eu-central-1'
    });
    const s3 = new aws.S3();
    let extension = path.extname(request.fileName == null ? 'default.jpg' : request.fileName);

    const url = request.token + '/stage_' + request.stageId + '/quest_' + request.questId + '/f_' + new Date().getTime() + '_' + request.type + extension;
    const s3_params = {
        Bucket: S3_BUCKET,
        Key: url,
        Expires: 60,
        ContentType: request.fileType,
        ACL: 'public-read'
    };
    s3.getSignedUrl('putObject', s3_params, function (err, data) {
        let result: GetAWSSignResponse;
        if (err) {
            result = {
                success: false
            };
        }
        else {
            result = {
                sign: data,
                url: 'https://' + S3_BUCKET + '.s3.amazonaws.com/' + url,
                success: true

            };
        }
        callback(result);
    });
}
開發者ID:anstarovoyt,項目名稱:dmmquest,代碼行數:36,代碼來源:AwsClient.ts

示例7: require

import {NinjaAccount, Account} from './ninjaAccount';
import {Promise} from 'es6-promise';
import * as AWS from 'aws-sdk';

const config = require('./UNconfig.json');

AWS.config.update({
    region: 'eu-west-1'
});

const d = (d0: number): number => new Date().getTime() - d0;

export function getRequestToken (event, context, callback) {
}

export function checkUnfollow (event, context, callback) {
    const d0 = new Date().getTime();
    if (!config.app_key || !config.app_secret)
        return callback(new Error('Please fill app_key and app_secret in UNconfig.json'));

    const ID = event.params.path.id;
    const q = new NinjaAccount(config, ID);
    q.checkUnfollow()
        .then((recap) => callback(null, {status: 'OK', recap: recap, duration: d(d0)}))
        .catch((err: Error) => callback(null, {status: 'error', message: err.message, duration: d(d0)}));
}

export function checkAll (event, context, cb) {
    const callback = (err, data?) => {
        if (err) console.log('error - ', err);
        console.log(data);
開發者ID:PLhery,項目名稱:unfollowNinjaLambda,代碼行數:31,代碼來源:index.ts

示例8: new

var iterating = false;

/**
 * Configure logging
 */
var logger = new (winston.Logger)({
  transports: [
    new (winston.transports.Console)({ level: 'debug' })
  ]
})

/**
 * Set up AWS
 */
AWS.config.update({region: 'us-east-1'});
var ddb = new AWS.DynamoDB.DocumentClient(),
    dynamo =  promise.promisifyAll(ddb);

/**
 * Functions for retrieving data from DB
 */

// get all items in the run number given a hash
// if following is true, get only future predictions from the timestamp
async function getAllOfRunNumber(hash, following) {
  // calculate a range of values. run numbers are per day,
  // so this gets us a list of all other predictions given the run number and a timestamp

  let unixTime = Number(hash.prdt) * 1000
開發者ID:open-cta,項目名稱:wss-api,代碼行數:29,代碼來源:app.ts

示例9: constructor

 constructor({FIREBASECONFIG, AWSCONFIG}) {
   this.firebase = firebase.initializeApp(FIREBASECONFIG);
   this.database = this.firebase.database();
   this.registryBucket = AWSCONFIG.Bucket;
   config.update({ accessKeyId: AWSCONFIG["aws_access_key_id"], secretAccessKey: AWSCONFIG["aws_secret_access_key"], region: AWSCONFIG["region"]});
 };
開發者ID:tbtimes,項目名稱:lede-cli,代碼行數:6,代碼來源:default.fetcher.ts

示例10:

/// <reference path="../_all.d.ts" />
"use strict";

import { config } from "./config";
import * as AWS from "aws-sdk";

AWS.config.update(config.database);

export var database = new AWS.DynamoDB.DocumentClient();
開發者ID:hoangnguyenba,項目名稱:chat-server,代碼行數:9,代碼來源:database.ts


注:本文中的aws-sdk.config類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。