初始化环境文件

This commit is contained in:
CN-JS-HuiBai
2026-04-04 12:49:09 +08:00
parent 07742d2688
commit c607af6fac
5971 changed files with 515160 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
export const getAwsRegionExtensionConfiguration = (runtimeConfig) => {
return {
setRegion(region) {
runtimeConfig.region = region;
},
region() {
return runtimeConfig.region;
},
};
};
export const resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
return {
region: awsRegionExtensionConfiguration.region(),
};
};

View File

@@ -0,0 +1,3 @@
export * from "./extensions";
export * from "./regionConfig/awsRegionConfig";
export * from "./regionConfig/stsRegionDefaultResolver";

View File

@@ -0,0 +1,2 @@
export { REGION_ENV_NAME, REGION_INI_NAME, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, } from "@smithy/config-resolver";
export { resolveRegionConfig } from "@smithy/config-resolver";

View File

@@ -0,0 +1,3 @@
export function stsRegionDefaultResolver() {
return async () => "us-east-1";
}

View File

@@ -0,0 +1,16 @@
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@smithy/config-resolver";
import { loadConfig } from "@smithy/node-config-provider";
export function stsRegionDefaultResolver(loaderConfig = {}) {
return loadConfig({
...NODE_REGION_CONFIG_OPTIONS,
async default() {
if (!warning.silence) {
console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");
}
return "us-east-1";
},
}, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig });
}
export const warning = {
silence: false,
};

View File

@@ -0,0 +1,3 @@
export function stsRegionDefaultResolver() {
return async () => "us-east-1";
}