node.js - 如何检查 AWS 开发工具包是否提供了凭据?

标签 node.js amazon-web-services aws-sdk

many ways为 AWS 开发工具包提供凭证以执行操作。

在我尝试在我们的持续部署系统上操作之前,我想确保任何方法都成功地设置了接口(interface)。

如何检查 AWS 开发工具包是否能够找到凭据?

最佳答案

您可以通过 config.credentials property 访问它们在主要客户端上。 SDK 中包含的所有 AWS 服务库都有一个 config property .

Class: AWS.Config

The main configuration class used by all service objects to set the region, credentials, and other options for requests.

By default, credentials and region settings are left unconfigured. This should be configured by the application before using any AWS service APIs.

// Using S3
var s3 = new AWS.S3();
console.log(s3.config.credentials);

关于node.js - 如何检查 AWS 开发工具包是否提供了凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38254107/

相关文章:

amazon-web-services - 使用自签名证书验证复制从属服务器上的主机身份

amazon-web-services - 使用 http 端点访问 lambda 中的 HTTP 请求( header 、查询字符串、cookie、正文)对象

javascript - 如何使用dust.js在服务器和客户端上编写模板

node.js - 使用 Cucumber 在 Node 中异步执行 JavaScript

amazon-web-services - 从跨堆栈共享的 API 网关删除 Lambda 时出错

tomcat - 如何模拟产品环境

node.js - Angular 和 Nodejs 的文件夹结构

node.js - 错误: Cannot find module 'mongodb'

php - 云端签名的 url 有问题(找不到指定参数的帐户)

amazon-web-services - 如何使用 CLI 在 S3-Bucket 上添加基于 AWS-Lambda 的触发器