-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow to specify region for data-module (#4)
* allow to specify region for data-module Co-authored-by: Norbert Nader <nnader@amazon.com>
- Loading branch information
1 parent
113a1bd
commit ae2ef66
Showing
4 changed files
with
12 additions
and
11 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
packages/components/src/testing/testing-ground/siteWiseQueries.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { IoTSiteWiseClient } from '@aws-sdk/client-iotsitewise'; | ||
import { Credentials, Provider } from '@aws-sdk/types'; | ||
|
||
// Fall back region if none provided as an env variable `AWS_REGION`. | ||
const DEFAULT_REGION = 'us-west-2'; | ||
|
||
export const sitewiseSdk = (credentials: Credentials | Provider<Credentials>) => | ||
export const sitewiseSdk = (credentials: Credentials | Provider<Credentials>, awsRegion?: string) => | ||
new IoTSiteWiseClient({ | ||
region: DEFAULT_REGION, | ||
endpoint: `https://iotsitewise.${DEFAULT_REGION}.amazonaws.com/`, | ||
region: awsRegion || DEFAULT_REGION, | ||
endpoint: `https://iotsitewise.${awsRegion || DEFAULT_REGION}.amazonaws.com/`, | ||
credentials, | ||
}); |