2

On Angular/Typescript trying to retrieve the value from Parameter Store on AWS based on its name.

Error message:

 ERROR Error: Uncaught (in promise): CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
    CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

The code inplemented:

import { SSM } from "aws-sdk";


const getParameterWorker = async (name:string, decrypt:boolean) : Promise<string> => {
  const ssm = new SSM();
  const result = await ssm
  .getParameter({ Name: name, WithDecryption: decrypt })
  .promise();
  return result.Parameter.Value;
}

export const getParameter = async (name:string) : Promise<string> => {
   return getParameterWorker(name,false);
}

async ngOnInit() {
  const records = await getParameter("parameter_path_name");
   .
   .
   .
}

However, the AWS_SDK_LOAD_CONFIG=1 has been set already, what other reasons could cause this issue?

Kobe24
  • 199
  • 1
  • 5

0 Answers0