本文整理汇总了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;未经允许,请勿转载。 |
请发表评论