无法连接到端点 URL:"https://translate.region.amazonaws.com/"

Could not connect to the endpoint URL: "https://translate.region.amazonaws.com/"

我正在尝试 运行 来自 AWS docs AWS Translate 服务的基本 cli 示例:

aws translate translate-text \
            --region region \
            --source-language-code "en" \
            --target-language-code "es" \
            --text "hello, world"

但我得到:

Could not connect to the endpoint URL: "https://translate.region.amazonaws.com/"

我的 ~/.aws/config 文件如下所示:

[default]
region = eu-central-1
output = json

我还从 AWS 控制台(通过网络 ui)测试了这项服务并且它有效,什么会导致它失败?

特定区域 eu-central-1 根据您的问题有效

% aws translate translate-text \
            --region eu-central-1 \
            --source-language-code "en" \
            --target-language-code "es" \
            --text "hello, world"
{
    "TranslatedText": "hola, mundo",
    "SourceLanguageCode": "en",
    "TargetLanguageCode": "es"
}