Search code examples
node.jsamazon-web-servicesamazon-certificate-manager

AWS certificate manager Inaccessible host: `acm.undefined.amazonaws.com'


I have been using AWS SDK v2.846.0 for create a SSL certificate for diferent domains, but when I do a request the I get this error:

"Inaccessible host: acm.undefined.amazonaws.com'. This service may not be available in the us-east-1' region."

Someone know what I could do?

I am using this documentation: https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ACM.html#requestCertificate-property


Solution

  • It looks like the region is undefined in your ACM credentials object.

    To supply options (including access key, secret key, and region), you can either pass them into the service constructor e.g.

    options = { secretAccessKey: skid, accessKeyId: akid, region: 'us-east-2' };
    acm = new AWS.ACM(options);
    

    Or you can update the SDK's config object but you must do this before you create your service object, for example:

    options = { secretAccessKey: skid, accessKeyId: akid, region: 'us-east-2' };
    AWS.config.update(options);
    acm = new AWS.ACM();