本文整理汇总了TypeScript中aws-sdk.config.update方法的典型用法代码示例。如果您正苦于以下问题:TypeScript config.update方法的具体用法?TypeScript config.update怎么用?TypeScript config.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aws-sdk.config
的用法示例。
在下文中一共展示了config.update方法的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;
}
示例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
});
}
示例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
});
}
示例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);
}
});
}
示例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;
}
示例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);
});
}
示例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);
示例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
示例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"]});
};
示例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();