【发布时间】:2021-06-10 10:00:47
【问题描述】:
我是锻造新手。我已经设置好 aws 并拥有 accessKeyId 和 secretAccessKey。当我运行查看器时,我得到一个“ConfigError: Missing region in config”
出于某种奇怪的原因,甚至删除了客户端 ID 和客户端密码。但它没有说明客户端 ID 和客户端密钥
const awsParamStore = require( 'aws-param-store' );
awsParamStore.getParametersByPath(" https://s3aecshare.s3.af-south-1.amazonaws.com/RVT_Test/rac_basic_sample_project.rvt");
const awsFlag = process.env.FORGE_AWS_FLAG;
//const paramStore = {"region": process.env.AWS_REGION}
const paramStore = {"region": "af-south-1"}
const clientId = process.env.FORGE_CLIENT_ID;
//const clientId ="-----------------------------";
//const clientSecret = process.env.FORGE_CLIENT_SECRET;
const clientSecret = "---------------------------";
// Autodesk Forge AWS configuration for SSM service
module.exports = {
// Required scopes for your application on server-side
scopeInternal: ['bucket:create', 'bucket:read', 'data:read', 'data:create', 'data:write'],
// Required scope of the token sent to the client
scopePublic: ['viewables:read'],
getParamStore: function() {
// If not running on AWS, paramStore requires access and secret AWS Keys
if (awsFlag){
return paramStore;
}else{
paramStore.credentials =
{
"accessKeyId" : "-------------------------------------",
"secretAccessKey" :"--------------------------------------"
};
}
return paramStore;
},
forgeAWSClientId: async function() {
let parameter = await awsParamStore.getParameter( clientId , this.getParamStore());
return parameter.Value;
},
forgeAWSClientSecret: async function() {
let parameter = await awsParamStore.getParameter( clientSecret ,this.getParamStore());
return parameter.Value;
}
【问题讨论】:
-
你到底想做什么?我在您的 sn-p 代码中看到的是一些试图从 AWS 检索密钥的逻辑,但实际上与 Forge 没有任何关系。您也可以在这里分享其余的实现吗?
-
感谢您的回复@PetrBroz,我正在尝试在亚马逊上托管文件。因此,当我运行该应用程序时,它从 aws 中提取,我想也许我应该向 aws 寻求支持?
-
是的,如果您在从 aws-param-store 检索数据时因区域设置而遇到问题,您可能需要寻求他们的支持。
标签: javascript autodesk-forge autodesk-viewer autodesk forge