[小ネタ]Amazon Q Developer in chat applicationsをAWS CLIで操作する際には特定リージョンを指定する必要がある「Could not connect to the endpoint URL 」の対処方法

[小ネタ]Amazon Q Developer in chat applicationsをAWS CLIで操作する際には特定リージョンを指定する必要がある「Could not connect to the endpoint URL 」の対処方法

2025.10.27

Amazon Q Developer in chat applicationsをAWS CLIで操作する必要がありました。

CloudShellで以下のコマンドを実行したところCould not connect to the endpoint URLエラーがでました。

aws chatbot describe-slack-workspaces
出力結果
Could not connect to the endpoint URL: "https://chatbot.us-east-1.amazonaws.com/describe-slack-workspaces"

このエラーの対応方法について解説します。

すぐに解決策を知りたい方へ:: 特定のリージョン(us-east-2等)を指定すればエラーが解消されます。

aws chatbot describe-slack-workspaces --region us-east-2

結論

Amazon Q Developer in chat applicationsのAPIが、特定のリージョンでのみ利用可能だからです。

対応しているリージョンは以下です。(2025年10月時点)

US East (Ohio) - us-east-2
US West (Oregon) - us-west-2
Asia Pacific (Singapore) - ap-southeast-1
Europe (Ireland) - eu-west-1

Welcome - Amazon Q Developer in chat applicationsから引用

今回私は、CloudShellでAWS CLIを実行しました。

このときセットされていたリージョンは、us-east-1で対応しているリージョンではなかったためエラーが発生しました。

printenv | grep AWS_REGION
出力結果
AWS_REGION=us-east-1

リージョンを指定することで、エラーが解消しました。

aws chatbot describe-slack-workspaces --region us-east-2
出力結果
{
    "SlackWorkspaces": [
        {
            "SlackTeamId": "T12345678",
            "SlackTeamName": "hoge",
            "State": "ENABLED"
        },
        {
            "SlackTeamId": "T23456789",
            "SlackTeamName": "test",
            "State": "ENABLED"
        }
    ]
}

リージョン間操作確認

別のリージョンで作成した設定が他のリージョンでも確認可能か気になり調べてみました。

us-east-2でSlackチャンネル設定を作成します。

aws chatbot create-slack-channel-configuration \
    --configuration-name "test-us-east-2" \
    --slack-team-id "<SlackチームID>" \  # 例: T12345678
    --slack-channel-id "<SlackチャンネルID>" \ # 例: C12345678
    --iam-role-arn "<IAM Role ARN>" \
    --region us-east-2

Slackチャンネル設定を作成したus-east-2を指定して参照してみます。

aws chatbot describe-slack-channel-configurations --region us-east-2

正常に作成できており、参照できました。

出力結果
{
    "SlackChannelConfigurations": [
        {
            "SlackTeamName": "test",
            "SlackTeamId": "T12345678",
            "SlackChannelId": "C12345678",
            "SlackChannelName": "random",
            "ChatConfigurationArn": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/test-us-east-2",
            "IamRoleArn": "arn:aws:iam::1234567890:role/aws-service-role/management.chatbot.amazonaws.com/AWSServiceRoleForAWSChatbot",
            "SnsTopicArns": [],
            "ConfigurationName": "test-us-east-2",
            "LoggingLevel": "NONE",
            "GuardrailPolicyArns": [
                "arn:aws:iam::aws:policy/AdministratorAccess"
            ],
            "UserAuthorizationRequired": false,
            "Tags": [],
            "State": "ENABLED"
        }
    ]
}

別のリージョン(us-west-2)を指定して参照してみます。

aws chatbot describe-slack-channel-configurations --region us-west-2

同様の結果が返ってきました。

出力結果
{
    "SlackChannelConfigurations": [
        {
            "SlackTeamName": "test",
            "SlackTeamId": "T12345678",
            "SlackChannelId": "C12345678",
            "SlackChannelName": "random",
            "ChatConfigurationArn": "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/test-us-east-2",
            "IamRoleArn": "arn:aws:iam::1234567890:role/aws-service-role/management.chatbot.amazonaws.com/AWSServiceRoleForAWSChatbot",
            "SnsTopicArns": [],
            "ConfigurationName": "test-us-east-2",
            "LoggingLevel": "NONE",
            "GuardrailPolicyArns": [
                "arn:aws:iam::aws:policy/AdministratorAccess"
            ],
            "UserAuthorizationRequired": false,
            "Tags": [],
            "State": "ENABLED"
        }
    ]
}

作成したリージョンとは別のリージョン(us-west-2)で削除ができるか確認してみました。

aws chatbot delete-slack-channel-configuration \
    --chat-configuration-arn "arn:aws:chatbot::1234567890:chat-configuration/slack-channel/test-us-east-2" \
    --region us-west-2

削除に成功しました。

aws chatbot describe-slack-channel-configurations --region us-west-2
出力結果
{
    "SlackChannelConfigurations": []
}

作成したリージョンでしか削除や変更ができない場合、困りそうと思い試してみました。

別リージョンでも削除・変更ができるため、作成することに関してはリージョンにこだわらなくても支障は無さそうです。

CloudTrailのログは指定したリージョンで残るため、ログのトレースの観点ではリージョンはある程度合わせておいたほうが良さそうです。

参考

https://github.com/aws/aws-cli/issues/8658

この記事をシェアする

FacebookHatena blogX

関連記事