Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
AWS FileSystemCredentials is not a constructor

I'm trying to load a JSON config file to protect my AWS keys

a.FileSystemCredentials is not a constructor
at constructor.loadFromPath(aws - sdk.min.js: 46)

This error is preventing me from using AWS.config.loadFromPath('../../s3.config.json');

It works fine when i use the unprotected AWS.config.update([json]); where json is the actual jsonData

app.js:

AWS.config.loadFromPath('../../s3.config.json');
var hub = new AWS.S3({ params: {Bucket: 'mybucket'} });

s3.config.json

{ "accessKeyId": "keyid", "secretAccessKey": "secretkey", "region": "us-east-1" }

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I have the same issue. You are probably loading the aws js sdk for browser.

As you can see: https://sdk.amazonaws.com/builder/js/, AWS.FileSystemCredentials is not included, that is why FileSystemCredentials is not a constructor (to be more specific it is undefined). It looks like you can only use AWS.config.loadFromPath on server side (with something like node.js).

over 4 years ago · Santiago Trujillo Relatório

0

Loading credentials from a JSON document is not supported in browser scripts.You have to create an identity pool and give permission for the required access

const AWS = require('aws-sdk')
AWS.config.update({region: 'us-east-1'});

AWS.config.credentials = new AWS.CognitoIdentityCredentials({IdentityPoolId: 'ur pool id'});
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda