aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.59k stars 1.55k forks source link

SageMaker ListDevices in us-west-1 "This operation is not supported in this region" #4584

Closed ziadkh-amzn closed 7 months ago

ziadkh-amzn commented 7 months ago

Describe the bug

When using ListDevicesCommand in us-west-1, the command fails with the error: "This operation is not supported in this region"

Expected Behavior

Return a list of devices

Current Behavior

Throws an error

Reproduction Steps

import { SageMakerClient, ListDevicesCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
const client = new SageMakerClient(config);
const input = { // ListDevicesRequest
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
  LatestHeartbeatAfter: new Date("TIMESTAMP"),
  ModelName: "STRING_VALUE",
  DeviceFleetName: "STRING_VALUE",
};
const command = new ListDevicesCommand(input);
const response = await client.send(command);

Possible Solution

No response

Additional Information/Context

No response

SDK version used

3.458.0

Environment details (OS name and version, etc.)

Docker Lambda Amazon Linux

aBurmeseDev commented 7 months ago

Hi @ziadkh-amzn - sorry for the delay. I'm not able to reproduce this behavior. Can you make sure to specify the region in your client initialization like the following?

const client = new SageMakerClient({
    region: "us-west-1"
});

Can you also verify by running CLI command aws sagemaker list-devices --region us-west-1? Here's doc for reference: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sagemaker/list-devices.html

github-actions[bot] commented 7 months ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.