AWS 证书管理器无法访问的主机:`acm.undefined.amazonaws.com'

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

我一直在使用 AWS SDK v2.846.0 为不同的域创建 SSL 证书,但是当我发出请求时出现此错误:

“无法访问主机:acm.undefined.amazonaws.com'. This service may not be available in the us-east-1' 区域。”

有人知道我能做什么吗?

我正在使用此文档:https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/ACM.html#requestCertificate-property

您的 ACM 凭据对象中似乎未定义区域。

要提供选项(包括访问密钥、密钥和区域),您可以将它们传递到服务构造函数中,例如

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

或者您可以更新 SDK 的配置对象,但您必须在创建服务对象之前执行此操作,例如:

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