diff --git a/clients/client-accessanalyzer/src/AccessAnalyzerClient.ts b/clients/client-accessanalyzer/src/AccessAnalyzerClient.ts index 270b4957fffa..16a6f69d59b3 100644 --- a/clients/client-accessanalyzer/src/AccessAnalyzerClient.ts +++ b/clients/client-accessanalyzer/src/AccessAnalyzerClient.ts @@ -309,6 +309,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-accessanalyzer/src/runtimeConfig.ts b/clients/client-accessanalyzer/src/runtimeConfig.ts index 48185ed2296f..4bf04437b4c2 100644 --- a/clients/client-accessanalyzer/src/runtimeConfig.ts +++ b/clients/client-accessanalyzer/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AccessAnalyzerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-account/src/AccountClient.ts b/clients/client-account/src/AccountClient.ts index 4934900ad7df..39f1618bd542 100644 --- a/clients/client-account/src/AccountClient.ts +++ b/clients/client-account/src/AccountClient.ts @@ -222,6 +222,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-account/src/runtimeConfig.ts b/clients/client-account/src/runtimeConfig.ts index 44e52597735a..973462fa6cc3 100644 --- a/clients/client-account/src/runtimeConfig.ts +++ b/clients/client-account/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AccountClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AccountClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-acm-pca/src/ACMPCAClient.ts b/clients/client-acm-pca/src/ACMPCAClient.ts index e84fbd027d16..1c1571688bcb 100644 --- a/clients/client-acm-pca/src/ACMPCAClient.ts +++ b/clients/client-acm-pca/src/ACMPCAClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-acm-pca/src/runtimeConfig.ts b/clients/client-acm-pca/src/runtimeConfig.ts index 238941f8016f..9a02ef767499 100644 --- a/clients/client-acm-pca/src/runtimeConfig.ts +++ b/clients/client-acm-pca/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ACMPCAClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ACMPCAClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-acm/src/ACMClient.ts b/clients/client-acm/src/ACMClient.ts index 9666b46d0548..f3f243dd1e5f 100644 --- a/clients/client-acm/src/ACMClient.ts +++ b/clients/client-acm/src/ACMClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-acm/src/runtimeConfig.ts b/clients/client-acm/src/runtimeConfig.ts index eb7dd95454e3..2067b79d96cd 100644 --- a/clients/client-acm/src/runtimeConfig.ts +++ b/clients/client-acm/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ACMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ACMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-amp/src/AmpClient.ts b/clients/client-amp/src/AmpClient.ts index d7c81534ff04..f36326164513 100644 --- a/clients/client-amp/src/AmpClient.ts +++ b/clients/client-amp/src/AmpClient.ts @@ -294,6 +294,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-amp/src/runtimeConfig.ts b/clients/client-amp/src/runtimeConfig.ts index 4556aeb79bbc..835d0df025ff 100644 --- a/clients/client-amp/src/runtimeConfig.ts +++ b/clients/client-amp/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AmpClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AmpClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-amplify/src/AmplifyClient.ts b/clients/client-amplify/src/AmplifyClient.ts index 0619edbd59f4..9db14eb0fe61 100644 --- a/clients/client-amplify/src/AmplifyClient.ts +++ b/clients/client-amplify/src/AmplifyClient.ts @@ -306,6 +306,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-amplify/src/runtimeConfig.ts b/clients/client-amplify/src/runtimeConfig.ts index a97db3c06cd4..40da41bf3ebb 100644 --- a/clients/client-amplify/src/runtimeConfig.ts +++ b/clients/client-amplify/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AmplifyClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AmplifyClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-amplifybackend/src/AmplifyBackendClient.ts b/clients/client-amplifybackend/src/AmplifyBackendClient.ts index de99ccc69b9c..30a6d18dff01 100644 --- a/clients/client-amplifybackend/src/AmplifyBackendClient.ts +++ b/clients/client-amplifybackend/src/AmplifyBackendClient.ts @@ -285,6 +285,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-amplifybackend/src/runtimeConfig.ts b/clients/client-amplifybackend/src/runtimeConfig.ts index ad0ae8474a57..687bd718da2e 100644 --- a/clients/client-amplifybackend/src/runtimeConfig.ts +++ b/clients/client-amplifybackend/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AmplifyBackendClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AmplifyBackendClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-amplifyuibuilder/src/AmplifyUIBuilderClient.ts b/clients/client-amplifyuibuilder/src/AmplifyUIBuilderClient.ts index aeb5163b6673..f854cc0ee5ea 100644 --- a/clients/client-amplifyuibuilder/src/AmplifyUIBuilderClient.ts +++ b/clients/client-amplifyuibuilder/src/AmplifyUIBuilderClient.ts @@ -255,6 +255,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-amplifyuibuilder/src/runtimeConfig.ts b/clients/client-amplifyuibuilder/src/runtimeConfig.ts index 0cd7ab1c2b0f..b0d3a1dd54ee 100644 --- a/clients/client-amplifyuibuilder/src/runtimeConfig.ts +++ b/clients/client-amplifyuibuilder/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AmplifyUIBuilderClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AmplifyUIBuilderClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-api-gateway/src/APIGatewayClient.ts b/clients/client-api-gateway/src/APIGatewayClient.ts index dc6ce57b292a..6b8b6b9841ac 100644 --- a/clients/client-api-gateway/src/APIGatewayClient.ts +++ b/clients/client-api-gateway/src/APIGatewayClient.ts @@ -658,6 +658,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-api-gateway/src/runtimeConfig.ts b/clients/client-api-gateway/src/runtimeConfig.ts index f1f0e992889b..933c6cd88012 100644 --- a/clients/client-api-gateway/src/runtimeConfig.ts +++ b/clients/client-api-gateway/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: APIGatewayClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: APIGatewayClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApiClient.ts b/clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApiClient.ts index 1afca2ba7af7..c5e60a7cf84b 100644 --- a/clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApiClient.ts +++ b/clients/client-apigatewaymanagementapi/src/ApiGatewayManagementApiClient.ts @@ -171,6 +171,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts b/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts index 135d0b711099..17030b36b94a 100644 --- a/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts +++ b/clients/client-apigatewaymanagementapi/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApiGatewayManagementApiClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-apigatewayv2/src/ApiGatewayV2Client.ts b/clients/client-apigatewayv2/src/ApiGatewayV2Client.ts index c772aef1d90d..8ed4e214a093 100644 --- a/clients/client-apigatewayv2/src/ApiGatewayV2Client.ts +++ b/clients/client-apigatewayv2/src/ApiGatewayV2Client.ts @@ -420,6 +420,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-apigatewayv2/src/runtimeConfig.ts b/clients/client-apigatewayv2/src/runtimeConfig.ts index 23b9ca8f5501..ff3cc40b4886 100644 --- a/clients/client-apigatewayv2/src/runtimeConfig.ts +++ b/clients/client-apigatewayv2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApiGatewayV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApiGatewayV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-app-mesh/src/AppMeshClient.ts b/clients/client-app-mesh/src/AppMeshClient.ts index c59e5fef7bcb..32aa7fd83c15 100644 --- a/clients/client-app-mesh/src/AppMeshClient.ts +++ b/clients/client-app-mesh/src/AppMeshClient.ts @@ -330,6 +330,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-app-mesh/src/runtimeConfig.ts b/clients/client-app-mesh/src/runtimeConfig.ts index cb791dd3fce4..e13ca3981cc7 100644 --- a/clients/client-app-mesh/src/runtimeConfig.ts +++ b/clients/client-app-mesh/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppMeshClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppMeshClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appconfig/src/AppConfigClient.ts b/clients/client-appconfig/src/AppConfigClient.ts index 98dfb451103d..3721ecc86717 100644 --- a/clients/client-appconfig/src/AppConfigClient.ts +++ b/clients/client-appconfig/src/AppConfigClient.ts @@ -366,6 +366,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appconfig/src/runtimeConfig.ts b/clients/client-appconfig/src/runtimeConfig.ts index cfe35dc88fe8..c1d4ed09ed25 100644 --- a/clients/client-appconfig/src/runtimeConfig.ts +++ b/clients/client-appconfig/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppConfigClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppConfigClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appconfigdata/src/AppConfigDataClient.ts b/clients/client-appconfigdata/src/AppConfigDataClient.ts index dedde6011019..0c3bfe0c1385 100644 --- a/clients/client-appconfigdata/src/AppConfigDataClient.ts +++ b/clients/client-appconfigdata/src/AppConfigDataClient.ts @@ -173,6 +173,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appconfigdata/src/runtimeConfig.ts b/clients/client-appconfigdata/src/runtimeConfig.ts index 9c5870e01f6d..54ecfdcb5b6d 100644 --- a/clients/client-appconfigdata/src/runtimeConfig.ts +++ b/clients/client-appconfigdata/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppConfigDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppConfigDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appfabric/src/AppFabricClient.ts b/clients/client-appfabric/src/AppFabricClient.ts index fa0b3b1aeaec..0e1080630c98 100644 --- a/clients/client-appfabric/src/AppFabricClient.ts +++ b/clients/client-appfabric/src/AppFabricClient.ts @@ -285,6 +285,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appfabric/src/runtimeConfig.ts b/clients/client-appfabric/src/runtimeConfig.ts index c9250043be53..20f101c858cc 100644 --- a/clients/client-appfabric/src/runtimeConfig.ts +++ b/clients/client-appfabric/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppFabricClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppFabricClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appflow/src/AppflowClient.ts b/clients/client-appflow/src/AppflowClient.ts index db3768325e11..4ce83468e8e1 100644 --- a/clients/client-appflow/src/AppflowClient.ts +++ b/clients/client-appflow/src/AppflowClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appflow/src/runtimeConfig.ts b/clients/client-appflow/src/runtimeConfig.ts index d20f5521cbb1..4144772de9c6 100644 --- a/clients/client-appflow/src/runtimeConfig.ts +++ b/clients/client-appflow/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppflowClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppflowClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appintegrations/src/AppIntegrationsClient.ts b/clients/client-appintegrations/src/AppIntegrationsClient.ts index c869bde3c567..492df5b87d67 100644 --- a/clients/client-appintegrations/src/AppIntegrationsClient.ts +++ b/clients/client-appintegrations/src/AppIntegrationsClient.ts @@ -279,6 +279,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appintegrations/src/runtimeConfig.ts b/clients/client-appintegrations/src/runtimeConfig.ts index 10847b596e3e..09810ac03385 100644 --- a/clients/client-appintegrations/src/runtimeConfig.ts +++ b/clients/client-appintegrations/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppIntegrationsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppIntegrationsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts b/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts index 89d284b1626a..d9208fa8916f 100644 --- a/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts +++ b/clients/client-application-auto-scaling/src/ApplicationAutoScalingClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-application-auto-scaling/src/runtimeConfig.ts b/clients/client-application-auto-scaling/src/runtimeConfig.ts index 5e1dea6e6e2a..efd14aa5afde 100644 --- a/clients/client-application-auto-scaling/src/runtimeConfig.ts +++ b/clients/client-application-auto-scaling/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApplicationAutoScalingClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApplicationAutoScalingClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-application-discovery-service/src/ApplicationDiscoveryServiceClient.ts b/clients/client-application-discovery-service/src/ApplicationDiscoveryServiceClient.ts index f469d372fef0..7b06a39de7aa 100644 --- a/clients/client-application-discovery-service/src/ApplicationDiscoveryServiceClient.ts +++ b/clients/client-application-discovery-service/src/ApplicationDiscoveryServiceClient.ts @@ -300,6 +300,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-application-discovery-service/src/runtimeConfig.ts b/clients/client-application-discovery-service/src/runtimeConfig.ts index a83eb66a0190..f7046d1ff88e 100644 --- a/clients/client-application-discovery-service/src/runtimeConfig.ts +++ b/clients/client-application-discovery-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApplicationDiscoveryServiceClientConfig const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApplicationDiscoveryServiceClientConfig defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-application-insights/src/ApplicationInsightsClient.ts b/clients/client-application-insights/src/ApplicationInsightsClient.ts index 411b8fe8deec..08fbcf25b9fe 100644 --- a/clients/client-application-insights/src/ApplicationInsightsClient.ts +++ b/clients/client-application-insights/src/ApplicationInsightsClient.ts @@ -288,6 +288,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-application-insights/src/runtimeConfig.ts b/clients/client-application-insights/src/runtimeConfig.ts index 719e90cb27cb..fdc408d8b0a7 100644 --- a/clients/client-application-insights/src/runtimeConfig.ts +++ b/clients/client-application-insights/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApplicationInsightsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApplicationInsightsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-application-signals/src/ApplicationSignalsClient.ts b/clients/client-application-signals/src/ApplicationSignalsClient.ts index be92e8804587..995444a13979 100644 --- a/clients/client-application-signals/src/ApplicationSignalsClient.ts +++ b/clients/client-application-signals/src/ApplicationSignalsClient.ts @@ -240,6 +240,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-application-signals/src/runtimeConfig.ts b/clients/client-application-signals/src/runtimeConfig.ts index 343416f730c9..b6896618fc73 100644 --- a/clients/client-application-signals/src/runtimeConfig.ts +++ b/clients/client-application-signals/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApplicationSignalsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApplicationSignalsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-applicationcostprofiler/src/ApplicationCostProfilerClient.ts b/clients/client-applicationcostprofiler/src/ApplicationCostProfilerClient.ts index e2bc63477b03..63e47cfb95e7 100644 --- a/clients/client-applicationcostprofiler/src/ApplicationCostProfilerClient.ts +++ b/clients/client-applicationcostprofiler/src/ApplicationCostProfilerClient.ts @@ -201,6 +201,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-applicationcostprofiler/src/runtimeConfig.ts b/clients/client-applicationcostprofiler/src/runtimeConfig.ts index bb28346151b4..7a006ac7826f 100644 --- a/clients/client-applicationcostprofiler/src/runtimeConfig.ts +++ b/clients/client-applicationcostprofiler/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ApplicationCostProfilerClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ApplicationCostProfilerClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-apprunner/src/AppRunnerClient.ts b/clients/client-apprunner/src/AppRunnerClient.ts index 257f630153de..0d8ef1267791 100644 --- a/clients/client-apprunner/src/AppRunnerClient.ts +++ b/clients/client-apprunner/src/AppRunnerClient.ts @@ -336,6 +336,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-apprunner/src/runtimeConfig.ts b/clients/client-apprunner/src/runtimeConfig.ts index 92ce84e5ce2f..341b857705c7 100644 --- a/clients/client-apprunner/src/runtimeConfig.ts +++ b/clients/client-apprunner/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppRunnerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppRunnerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appstream/src/AppStreamClient.ts b/clients/client-appstream/src/AppStreamClient.ts index 0bc791bbe79c..091f0686efb0 100644 --- a/clients/client-appstream/src/AppStreamClient.ts +++ b/clients/client-appstream/src/AppStreamClient.ts @@ -522,6 +522,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appstream/src/runtimeConfig.ts b/clients/client-appstream/src/runtimeConfig.ts index 7b8e977998b6..3be6ed51f522 100644 --- a/clients/client-appstream/src/runtimeConfig.ts +++ b/clients/client-appstream/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppStreamClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppStreamClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-appsync/src/AppSyncClient.ts b/clients/client-appsync/src/AppSyncClient.ts index 1fd3157f75f2..c5c7fe08e746 100644 --- a/clients/client-appsync/src/AppSyncClient.ts +++ b/clients/client-appsync/src/AppSyncClient.ts @@ -456,6 +456,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-appsync/src/runtimeConfig.ts b/clients/client-appsync/src/runtimeConfig.ts index af4440609eed..2f387838a57d 100644 --- a/clients/client-appsync/src/runtimeConfig.ts +++ b/clients/client-appsync/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppSyncClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppSyncClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-apptest/src/AppTestClient.ts b/clients/client-apptest/src/AppTestClient.ts index 4f17f36c6e04..7523a09a51d4 100644 --- a/clients/client-apptest/src/AppTestClient.ts +++ b/clients/client-apptest/src/AppTestClient.ts @@ -258,6 +258,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-apptest/src/runtimeConfig.ts b/clients/client-apptest/src/runtimeConfig.ts index 546b4ff89e7a..fe6dda2340f3 100644 --- a/clients/client-apptest/src/runtimeConfig.ts +++ b/clients/client-apptest/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AppTestClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AppTestClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-arc-zonal-shift/src/ARCZonalShiftClient.ts b/clients/client-arc-zonal-shift/src/ARCZonalShiftClient.ts index 125e23ffd554..b49b027b8a21 100644 --- a/clients/client-arc-zonal-shift/src/ARCZonalShiftClient.ts +++ b/clients/client-arc-zonal-shift/src/ARCZonalShiftClient.ts @@ -225,6 +225,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-arc-zonal-shift/src/runtimeConfig.ts b/clients/client-arc-zonal-shift/src/runtimeConfig.ts index 257496a9c67f..5267f319c431 100644 --- a/clients/client-arc-zonal-shift/src/runtimeConfig.ts +++ b/clients/client-arc-zonal-shift/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ARCZonalShiftClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ARCZonalShiftClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-artifact/src/ArtifactClient.ts b/clients/client-artifact/src/ArtifactClient.ts index 88d82c8bc357..3e1da6d3bafb 100644 --- a/clients/client-artifact/src/ArtifactClient.ts +++ b/clients/client-artifact/src/ArtifactClient.ts @@ -189,6 +189,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-artifact/src/commands/GetReportCommand.ts b/clients/client-artifact/src/commands/GetReportCommand.ts index 192a4d7c9512..80354052eb8a 100644 --- a/clients/client-artifact/src/commands/GetReportCommand.ts +++ b/clients/client-artifact/src/commands/GetReportCommand.ts @@ -86,8 +86,8 @@ export interface GetReportCommandOutput extends GetReportResponse, __MetadataBea * // operation. If callers do not provide a version, it will default to the * // report's latest version * const input = { - * "reportId": "report-1hVFddebtfDNJAUf", - * "termToken": "term-token-gPFEGk7CF4wS901w7ppYclt7" + * "reportId": "report-abcdef0123456789", + * "termToken": "term-token-abcdefghijklm01234567890" * }; * const command = new GetReportCommand(input); * const response = await client.send(command); diff --git a/clients/client-artifact/src/commands/GetReportMetadataCommand.ts b/clients/client-artifact/src/commands/GetReportMetadataCommand.ts index aff337fed61c..251c8e0fd606 100644 --- a/clients/client-artifact/src/commands/GetReportMetadataCommand.ts +++ b/clients/client-artifact/src/commands/GetReportMetadataCommand.ts @@ -110,18 +110,18 @@ export interface GetReportMetadataCommandOutput extends GetReportMetadataRespons * "reportDetails": { * "version": 1, * "name": "Name of report", - * "arn": "arn:aws:artifact:us-east-1::report/report-bqhUJF3FrQZsMJpb:1", + * "arn": "arn:aws:artifact:us-east-1::report/report-abcdef0123456789:1", * "category": "Artifact Category", * "companyName": "AWS", * "createdAt": "2022-05-27T23:17:00.343940Z", * "description": "Description of report", - * "id": "report-bqhUJF3FrQZsMJpb", + * "id": "report-abcdef0123456789", * "periodEnd": "2022-04-01T20:32:04Z", * "periodStart": "2022-04-01T20:32:04Z", * "productName": "Product of report", * "series": "Artifact Series", * "state": "PUBLISHED", - * "termArn": "arn:aws:artifact:us-east-1::term/term-gLJGG12NyPtYcmtu:1" + * "termArn": "arn:aws:artifact:us-east-1::term/term-abcdef0123456789:1" * } * } * *\/ diff --git a/clients/client-artifact/src/commands/GetTermForReportCommand.ts b/clients/client-artifact/src/commands/GetTermForReportCommand.ts index a0b0b8b088b8..943de08ad74f 100644 --- a/clients/client-artifact/src/commands/GetTermForReportCommand.ts +++ b/clients/client-artifact/src/commands/GetTermForReportCommand.ts @@ -84,14 +84,14 @@ export interface GetTermForReportCommandOutput extends GetTermForReportResponse, * // The GetTermForReport operation is invoked on a reportId and on a optional version. * // If callers do not provide a version, it will default to the report's latest version. * const input = { - * "reportId": "report-bqhUJF3FrQZsMJpb" + * "reportId": "report-abcdef0123456789" * }; * const command = new GetTermForReportCommand(input); * const response = await client.send(command); * /* response == * { * "documentPresignedUrl": "", - * "termToken": "term-token-gPFEGk7CF4wS901w7ppYclt7" + * "termToken": "term-token-abcdefghijklm01234567890" * } * *\/ * // example id: example-1 diff --git a/clients/client-artifact/src/commands/ListReportsCommand.ts b/clients/client-artifact/src/commands/ListReportsCommand.ts index 0b86abc444ce..acde4eae63e9 100644 --- a/clients/client-artifact/src/commands/ListReportsCommand.ts +++ b/clients/client-artifact/src/commands/ListReportsCommand.ts @@ -107,11 +107,11 @@ export interface ListReportsCommandOutput extends ListReportsResponse, __Metadat * { * "version": 1, * "name": "Name of report", - * "arn": "arn:aws:artifact:us-east-1::report/report-bqhUJF3FrQZsMJpb", + * "arn": "arn:aws:artifact:us-east-1::report/report-abcdef0123456789", * "category": "Artifact Category", * "companyName": "AWS", * "description": "Description of report", - * "id": "report-bqhUJF3FrQZsMJpb", + * "id": "report-abcdef0123456789", * "periodEnd": "2022-04-01T20:32:04Z", * "periodStart": "2022-04-01T20:32:04Z", * "productName": "Product of report", diff --git a/clients/client-artifact/src/runtimeConfig.ts b/clients/client-artifact/src/runtimeConfig.ts index 1a66cd026860..ab6780842617 100644 --- a/clients/client-artifact/src/runtimeConfig.ts +++ b/clients/client-artifact/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ArtifactClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ArtifactClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-athena/src/AthenaClient.ts b/clients/client-athena/src/AthenaClient.ts index 00110da56370..89fc073eba68 100644 --- a/clients/client-athena/src/AthenaClient.ts +++ b/clients/client-athena/src/AthenaClient.ts @@ -462,6 +462,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-athena/src/runtimeConfig.ts b/clients/client-athena/src/runtimeConfig.ts index 3f71bf373591..2b6bb75a1f56 100644 --- a/clients/client-athena/src/runtimeConfig.ts +++ b/clients/client-athena/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AthenaClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AthenaClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-auditmanager/src/AuditManagerClient.ts b/clients/client-auditmanager/src/AuditManagerClient.ts index 5d6aec163040..e28204e6d2bf 100644 --- a/clients/client-auditmanager/src/AuditManagerClient.ts +++ b/clients/client-auditmanager/src/AuditManagerClient.ts @@ -465,6 +465,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-auditmanager/src/runtimeConfig.ts b/clients/client-auditmanager/src/runtimeConfig.ts index 218d53b90566..c03aaae0a64a 100644 --- a/clients/client-auditmanager/src/runtimeConfig.ts +++ b/clients/client-auditmanager/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AuditManagerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AuditManagerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-auto-scaling-plans/src/AutoScalingPlansClient.ts b/clients/client-auto-scaling-plans/src/AutoScalingPlansClient.ts index 49b34a3bc598..f18526b5b316 100644 --- a/clients/client-auto-scaling-plans/src/AutoScalingPlansClient.ts +++ b/clients/client-auto-scaling-plans/src/AutoScalingPlansClient.ts @@ -192,6 +192,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-auto-scaling-plans/src/runtimeConfig.ts b/clients/client-auto-scaling-plans/src/runtimeConfig.ts index 5fe1ff1d9ae2..8ee9e0fac0ed 100644 --- a/clients/client-auto-scaling-plans/src/runtimeConfig.ts +++ b/clients/client-auto-scaling-plans/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AutoScalingPlansClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AutoScalingPlansClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-auto-scaling/src/AutoScalingClient.ts b/clients/client-auto-scaling/src/AutoScalingClient.ts index 8bbe84cdba5c..38da347ea774 100644 --- a/clients/client-auto-scaling/src/AutoScalingClient.ts +++ b/clients/client-auto-scaling/src/AutoScalingClient.ts @@ -498,6 +498,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-auto-scaling/src/runtimeConfig.ts b/clients/client-auto-scaling/src/runtimeConfig.ts index fd9ee716ef54..4f74a6167e39 100644 --- a/clients/client-auto-scaling/src/runtimeConfig.ts +++ b/clients/client-auto-scaling/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: AutoScalingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: AutoScalingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-b2bi/src/B2biClient.ts b/clients/client-b2bi/src/B2biClient.ts index 74504a4abd90..612f6aa29875 100644 --- a/clients/client-b2bi/src/B2biClient.ts +++ b/clients/client-b2bi/src/B2biClient.ts @@ -264,6 +264,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-b2bi/src/runtimeConfig.ts b/clients/client-b2bi/src/runtimeConfig.ts index d7c4a23afcb3..da690084bcec 100644 --- a/clients/client-b2bi/src/runtimeConfig.ts +++ b/clients/client-b2bi/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: B2biClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: B2biClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-backup-gateway/src/BackupGatewayClient.ts b/clients/client-backup-gateway/src/BackupGatewayClient.ts index 3a2ee3a47b80..19e23470dc12 100644 --- a/clients/client-backup-gateway/src/BackupGatewayClient.ts +++ b/clients/client-backup-gateway/src/BackupGatewayClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-backup-gateway/src/runtimeConfig.ts b/clients/client-backup-gateway/src/runtimeConfig.ts index 265d3f786ea4..c1669f46b7a6 100644 --- a/clients/client-backup-gateway/src/runtimeConfig.ts +++ b/clients/client-backup-gateway/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BackupGatewayClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BackupGatewayClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-backup/src/BackupClient.ts b/clients/client-backup/src/BackupClient.ts index 954a4be9fe64..e26151219a2b 100644 --- a/clients/client-backup/src/BackupClient.ts +++ b/clients/client-backup/src/BackupClient.ts @@ -594,6 +594,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-backup/src/runtimeConfig.ts b/clients/client-backup/src/runtimeConfig.ts index 83db8a906fb8..ea1d08d9d080 100644 --- a/clients/client-backup/src/runtimeConfig.ts +++ b/clients/client-backup/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BackupClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BackupClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-batch/src/BatchClient.ts b/clients/client-batch/src/BatchClient.ts index 62b04df9ed83..e7ff3e815a4c 100644 --- a/clients/client-batch/src/BatchClient.ts +++ b/clients/client-batch/src/BatchClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-batch/src/runtimeConfig.ts b/clients/client-batch/src/runtimeConfig.ts index 5d82c7ed229e..d08c51f85a2e 100644 --- a/clients/client-batch/src/runtimeConfig.ts +++ b/clients/client-batch/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BatchClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BatchClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bcm-data-exports/src/BCMDataExportsClient.ts b/clients/client-bcm-data-exports/src/BCMDataExportsClient.ts index a0fbf6cb1ff7..0dba9b64ea04 100644 --- a/clients/client-bcm-data-exports/src/BCMDataExportsClient.ts +++ b/clients/client-bcm-data-exports/src/BCMDataExportsClient.ts @@ -204,6 +204,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bcm-data-exports/src/runtimeConfig.ts b/clients/client-bcm-data-exports/src/runtimeConfig.ts index e0f8ea477dd0..b73528849aa7 100644 --- a/clients/client-bcm-data-exports/src/runtimeConfig.ts +++ b/clients/client-bcm-data-exports/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BCMDataExportsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BCMDataExportsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bcm-pricing-calculator/src/BCMPricingCalculatorClient.ts b/clients/client-bcm-pricing-calculator/src/BCMPricingCalculatorClient.ts index fa465553dc64..2bbc660134d4 100644 --- a/clients/client-bcm-pricing-calculator/src/BCMPricingCalculatorClient.ts +++ b/clients/client-bcm-pricing-calculator/src/BCMPricingCalculatorClient.ts @@ -339,6 +339,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bcm-pricing-calculator/src/runtimeConfig.ts b/clients/client-bcm-pricing-calculator/src/runtimeConfig.ts index 63007694e885..1f39d2ec53cf 100644 --- a/clients/client-bcm-pricing-calculator/src/runtimeConfig.ts +++ b/clients/client-bcm-pricing-calculator/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BCMPricingCalculatorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BCMPricingCalculatorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts index e88b2dc89c8a..8110c6b4a1c4 100644 --- a/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts +++ b/clients/client-bedrock-agent-runtime/src/BedrockAgentRuntimeClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts b/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts index 12b6af371492..c5ec03eead13 100644 --- a/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts +++ b/clients/client-bedrock-agent-runtime/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: BedrockAgentRuntimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: BedrockAgentRuntimeClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bedrock-agent/src/BedrockAgentClient.ts b/clients/client-bedrock-agent/src/BedrockAgentClient.ts index ea2523256543..b361a9eda1c0 100644 --- a/clients/client-bedrock-agent/src/BedrockAgentClient.ts +++ b/clients/client-bedrock-agent/src/BedrockAgentClient.ts @@ -456,6 +456,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bedrock-agent/src/runtimeConfig.ts b/clients/client-bedrock-agent/src/runtimeConfig.ts index abf9be5ff5cb..1404d8c572c8 100644 --- a/clients/client-bedrock-agent/src/runtimeConfig.ts +++ b/clients/client-bedrock-agent/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BedrockAgentClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BedrockAgentClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts b/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts index 6ee64682d725..c83bc0bf0d18 100644 --- a/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts +++ b/clients/client-bedrock-data-automation-runtime/src/BedrockDataAutomationRuntimeClient.ts @@ -173,6 +173,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts index a2ff8a98e194..5177a8c253ef 100644 --- a/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts +++ b/clients/client-bedrock-data-automation-runtime/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BedrockDataAutomationRuntimeClientConfi const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BedrockDataAutomationRuntimeClientConfi defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bedrock-data-automation/src/BedrockDataAutomationClient.ts b/clients/client-bedrock-data-automation/src/BedrockDataAutomationClient.ts index 8e60d60e7162..67a732f91342 100644 --- a/clients/client-bedrock-data-automation/src/BedrockDataAutomationClient.ts +++ b/clients/client-bedrock-data-automation/src/BedrockDataAutomationClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bedrock-data-automation/src/runtimeConfig.ts b/clients/client-bedrock-data-automation/src/runtimeConfig.ts index 60166d5990ea..fbc4d6ca3e97 100644 --- a/clients/client-bedrock-data-automation/src/runtimeConfig.ts +++ b/clients/client-bedrock-data-automation/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BedrockDataAutomationClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BedrockDataAutomationClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bedrock-runtime/src/BedrockRuntimeClient.ts b/clients/client-bedrock-runtime/src/BedrockRuntimeClient.ts index 5d25f32c696d..22f021d9c164 100644 --- a/clients/client-bedrock-runtime/src/BedrockRuntimeClient.ts +++ b/clients/client-bedrock-runtime/src/BedrockRuntimeClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bedrock-runtime/src/runtimeConfig.ts b/clients/client-bedrock-runtime/src/runtimeConfig.ts index 1ba1ea8224af..eb1c9cdb8944 100644 --- a/clients/client-bedrock-runtime/src/runtimeConfig.ts +++ b/clients/client-bedrock-runtime/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: BedrockRuntimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: BedrockRuntimeClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-bedrock/src/BedrockClient.ts b/clients/client-bedrock/src/BedrockClient.ts index 0f1f3e21e68b..12fc36dd68e0 100644 --- a/clients/client-bedrock/src/BedrockClient.ts +++ b/clients/client-bedrock/src/BedrockClient.ts @@ -441,6 +441,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-bedrock/src/runtimeConfig.ts b/clients/client-bedrock/src/runtimeConfig.ts index 02d04f6814a9..d13508174384 100644 --- a/clients/client-bedrock/src/runtimeConfig.ts +++ b/clients/client-bedrock/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BedrockClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BedrockClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-billing/src/BillingClient.ts b/clients/client-billing/src/BillingClient.ts index 051cb172c636..ba3056ac65d3 100644 --- a/clients/client-billing/src/BillingClient.ts +++ b/clients/client-billing/src/BillingClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-billing/src/runtimeConfig.ts b/clients/client-billing/src/runtimeConfig.ts index ecad54238bb5..4453ecf325b3 100644 --- a/clients/client-billing/src/runtimeConfig.ts +++ b/clients/client-billing/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BillingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BillingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-billingconductor/src/BillingconductorClient.ts b/clients/client-billingconductor/src/BillingconductorClient.ts index a0d85f477e97..da141fa93279 100644 --- a/clients/client-billingconductor/src/BillingconductorClient.ts +++ b/clients/client-billingconductor/src/BillingconductorClient.ts @@ -312,6 +312,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-billingconductor/src/runtimeConfig.ts b/clients/client-billingconductor/src/runtimeConfig.ts index 6eb6dbd43a55..3f7aa15aa4f3 100644 --- a/clients/client-billingconductor/src/runtimeConfig.ts +++ b/clients/client-billingconductor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BillingconductorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BillingconductorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-braket/src/BraketClient.ts b/clients/client-braket/src/BraketClient.ts index fe975ca9aa11..5eec08f00494 100644 --- a/clients/client-braket/src/BraketClient.ts +++ b/clients/client-braket/src/BraketClient.ts @@ -207,6 +207,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-braket/src/runtimeConfig.ts b/clients/client-braket/src/runtimeConfig.ts index 77254d82c313..05fca81076dc 100644 --- a/clients/client-braket/src/runtimeConfig.ts +++ b/clients/client-braket/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BraketClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BraketClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-budgets/src/BudgetsClient.ts b/clients/client-budgets/src/BudgetsClient.ts index f4bdff7f3d62..1a4f2cd85982 100644 --- a/clients/client-budgets/src/BudgetsClient.ts +++ b/clients/client-budgets/src/BudgetsClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-budgets/src/runtimeConfig.ts b/clients/client-budgets/src/runtimeConfig.ts index 8880b3c5d6eb..764357de5ebf 100644 --- a/clients/client-budgets/src/runtimeConfig.ts +++ b/clients/client-budgets/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: BudgetsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: BudgetsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chatbot/src/ChatbotClient.ts b/clients/client-chatbot/src/ChatbotClient.ts index f2d814d1ad8f..cff627854850 100644 --- a/clients/client-chatbot/src/ChatbotClient.ts +++ b/clients/client-chatbot/src/ChatbotClient.ts @@ -345,6 +345,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chatbot/src/runtimeConfig.ts b/clients/client-chatbot/src/runtimeConfig.ts index d69a978cbeb2..902365d87fd2 100644 --- a/clients/client-chatbot/src/runtimeConfig.ts +++ b/clients/client-chatbot/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChatbotClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChatbotClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chime-sdk-identity/src/ChimeSDKIdentityClient.ts b/clients/client-chime-sdk-identity/src/ChimeSDKIdentityClient.ts index 199af1aff784..2a77c89d68cd 100644 --- a/clients/client-chime-sdk-identity/src/ChimeSDKIdentityClient.ts +++ b/clients/client-chime-sdk-identity/src/ChimeSDKIdentityClient.ts @@ -327,6 +327,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chime-sdk-identity/src/runtimeConfig.ts b/clients/client-chime-sdk-identity/src/runtimeConfig.ts index 227f0d61512d..0b8645e8b238 100644 --- a/clients/client-chime-sdk-identity/src/runtimeConfig.ts +++ b/clients/client-chime-sdk-identity/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChimeSDKIdentityClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChimeSDKIdentityClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chime-sdk-media-pipelines/src/ChimeSDKMediaPipelinesClient.ts b/clients/client-chime-sdk-media-pipelines/src/ChimeSDKMediaPipelinesClient.ts index ce3823b3406c..cc22f5c0b75b 100644 --- a/clients/client-chime-sdk-media-pipelines/src/ChimeSDKMediaPipelinesClient.ts +++ b/clients/client-chime-sdk-media-pipelines/src/ChimeSDKMediaPipelinesClient.ts @@ -339,6 +339,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chime-sdk-media-pipelines/src/runtimeConfig.ts b/clients/client-chime-sdk-media-pipelines/src/runtimeConfig.ts index 80c9a511ef1d..ee7a80964f61 100644 --- a/clients/client-chime-sdk-media-pipelines/src/runtimeConfig.ts +++ b/clients/client-chime-sdk-media-pipelines/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChimeSDKMediaPipelinesClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChimeSDKMediaPipelinesClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chime-sdk-meetings/src/ChimeSDKMeetingsClient.ts b/clients/client-chime-sdk-meetings/src/ChimeSDKMeetingsClient.ts index 35bd51b8ca68..1773927a4801 100644 --- a/clients/client-chime-sdk-meetings/src/ChimeSDKMeetingsClient.ts +++ b/clients/client-chime-sdk-meetings/src/ChimeSDKMeetingsClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chime-sdk-meetings/src/runtimeConfig.ts b/clients/client-chime-sdk-meetings/src/runtimeConfig.ts index 4dee8d914c14..f7b17c4e5663 100644 --- a/clients/client-chime-sdk-meetings/src/runtimeConfig.ts +++ b/clients/client-chime-sdk-meetings/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChimeSDKMeetingsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChimeSDKMeetingsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts b/clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts index 8275a68831d4..56030ec51e8d 100644 --- a/clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts +++ b/clients/client-chime-sdk-messaging/src/ChimeSDKMessagingClient.ts @@ -414,6 +414,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chime-sdk-messaging/src/runtimeConfig.ts b/clients/client-chime-sdk-messaging/src/runtimeConfig.ts index 2224694c6021..7a3195b2cac6 100644 --- a/clients/client-chime-sdk-messaging/src/runtimeConfig.ts +++ b/clients/client-chime-sdk-messaging/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChimeSDKMessagingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChimeSDKMessagingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chime-sdk-voice/src/ChimeSDKVoiceClient.ts b/clients/client-chime-sdk-voice/src/ChimeSDKVoiceClient.ts index 25dfeb42f34c..2bad67920b66 100644 --- a/clients/client-chime-sdk-voice/src/ChimeSDKVoiceClient.ts +++ b/clients/client-chime-sdk-voice/src/ChimeSDKVoiceClient.ts @@ -669,6 +669,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chime-sdk-voice/src/runtimeConfig.ts b/clients/client-chime-sdk-voice/src/runtimeConfig.ts index 11ec1c19d111..9dd6145aa062 100644 --- a/clients/client-chime-sdk-voice/src/runtimeConfig.ts +++ b/clients/client-chime-sdk-voice/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChimeSDKVoiceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChimeSDKVoiceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-chime/src/ChimeClient.ts b/clients/client-chime/src/ChimeClient.ts index ec175cc2a965..062561da4fec 100644 --- a/clients/client-chime/src/ChimeClient.ts +++ b/clients/client-chime/src/ChimeClient.ts @@ -1083,6 +1083,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-chime/src/runtimeConfig.ts b/clients/client-chime/src/runtimeConfig.ts index 4b1de5245799..f4583b449ccd 100644 --- a/clients/client-chime/src/runtimeConfig.ts +++ b/clients/client-chime/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ChimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ChimeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cleanrooms/src/CleanRoomsClient.ts b/clients/client-cleanrooms/src/CleanRoomsClient.ts index f5520d4a60c2..c074db824046 100644 --- a/clients/client-cleanrooms/src/CleanRoomsClient.ts +++ b/clients/client-cleanrooms/src/CleanRoomsClient.ts @@ -591,6 +591,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cleanrooms/src/runtimeConfig.ts b/clients/client-cleanrooms/src/runtimeConfig.ts index a81087211582..ace53a882482 100644 --- a/clients/client-cleanrooms/src/runtimeConfig.ts +++ b/clients/client-cleanrooms/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CleanRoomsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CleanRoomsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cleanroomsml/src/CleanRoomsMLClient.ts b/clients/client-cleanroomsml/src/CleanRoomsMLClient.ts index a2804213d538..83a32b6b866a 100644 --- a/clients/client-cleanroomsml/src/CleanRoomsMLClient.ts +++ b/clients/client-cleanroomsml/src/CleanRoomsMLClient.ts @@ -477,6 +477,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cleanroomsml/src/runtimeConfig.ts b/clients/client-cleanroomsml/src/runtimeConfig.ts index f7d1b17628f6..f30f7cb1b1a8 100644 --- a/clients/client-cleanroomsml/src/runtimeConfig.ts +++ b/clients/client-cleanroomsml/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CleanRoomsMLClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CleanRoomsMLClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloud9/src/Cloud9Client.ts b/clients/client-cloud9/src/Cloud9Client.ts index 6d85a9590264..662de3694212 100644 --- a/clients/client-cloud9/src/Cloud9Client.ts +++ b/clients/client-cloud9/src/Cloud9Client.ts @@ -228,6 +228,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloud9/src/runtimeConfig.ts b/clients/client-cloud9/src/runtimeConfig.ts index 6a8480744e1e..64dfdb0a21ca 100644 --- a/clients/client-cloud9/src/runtimeConfig.ts +++ b/clients/client-cloud9/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Cloud9ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Cloud9ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudcontrol/src/CloudControlClient.ts b/clients/client-cloudcontrol/src/CloudControlClient.ts index 974712fd8730..ae1534f455d9 100644 --- a/clients/client-cloudcontrol/src/CloudControlClient.ts +++ b/clients/client-cloudcontrol/src/CloudControlClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudcontrol/src/runtimeConfig.ts b/clients/client-cloudcontrol/src/runtimeConfig.ts index 632f5991bf44..e41898f1d584 100644 --- a/clients/client-cloudcontrol/src/runtimeConfig.ts +++ b/clients/client-cloudcontrol/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudControlClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudControlClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-clouddirectory/src/CloudDirectoryClient.ts b/clients/client-clouddirectory/src/CloudDirectoryClient.ts index 6e6f5ec8569e..448a8e338580 100644 --- a/clients/client-clouddirectory/src/CloudDirectoryClient.ts +++ b/clients/client-clouddirectory/src/CloudDirectoryClient.ts @@ -441,6 +441,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-clouddirectory/src/runtimeConfig.ts b/clients/client-clouddirectory/src/runtimeConfig.ts index 2eb19d918fc1..31097306d213 100644 --- a/clients/client-clouddirectory/src/runtimeConfig.ts +++ b/clients/client-clouddirectory/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudDirectoryClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudDirectoryClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudformation/src/CloudFormationClient.ts b/clients/client-cloudformation/src/CloudFormationClient.ts index 95189b8b65cf..7b8dc7e6fad2 100644 --- a/clients/client-cloudformation/src/CloudFormationClient.ts +++ b/clients/client-cloudformation/src/CloudFormationClient.ts @@ -537,6 +537,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudformation/src/runtimeConfig.ts b/clients/client-cloudformation/src/runtimeConfig.ts index 92695b2dca89..bcf6cc424288 100644 --- a/clients/client-cloudformation/src/runtimeConfig.ts +++ b/clients/client-cloudformation/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudFormationClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudFormationClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudfront-keyvaluestore/src/CloudFrontKeyValueStoreClient.ts b/clients/client-cloudfront-keyvaluestore/src/CloudFrontKeyValueStoreClient.ts index 256814b8fbcf..7b23c239254e 100644 --- a/clients/client-cloudfront-keyvaluestore/src/CloudFrontKeyValueStoreClient.ts +++ b/clients/client-cloudfront-keyvaluestore/src/CloudFrontKeyValueStoreClient.ts @@ -186,6 +186,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudfront-keyvaluestore/src/runtimeConfig.ts b/clients/client-cloudfront-keyvaluestore/src/runtimeConfig.ts index 7ae2fbf062a8..1b8dc2819107 100644 --- a/clients/client-cloudfront-keyvaluestore/src/runtimeConfig.ts +++ b/clients/client-cloudfront-keyvaluestore/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudFrontKeyValueStoreClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,20 +43,26 @@ export const getRuntimeConfig = (config: CloudFrontKeyValueStoreClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS), + sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, profileConfig), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudfront/src/CloudFrontClient.ts b/clients/client-cloudfront/src/CloudFrontClient.ts index 75cc08332790..b75c208c4abe 100644 --- a/clients/client-cloudfront/src/CloudFrontClient.ts +++ b/clients/client-cloudfront/src/CloudFrontClient.ts @@ -762,6 +762,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudfront/src/runtimeConfig.ts b/clients/client-cloudfront/src/runtimeConfig.ts index 86cb8bde1440..953c9513261d 100644 --- a/clients/client-cloudfront/src/runtimeConfig.ts +++ b/clients/client-cloudfront/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudFrontClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudFrontClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudhsm-v2/src/CloudHSMV2Client.ts b/clients/client-cloudhsm-v2/src/CloudHSMV2Client.ts index 70a135608b85..db37c0f104be 100644 --- a/clients/client-cloudhsm-v2/src/CloudHSMV2Client.ts +++ b/clients/client-cloudhsm-v2/src/CloudHSMV2Client.ts @@ -225,6 +225,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudhsm-v2/src/runtimeConfig.ts b/clients/client-cloudhsm-v2/src/runtimeConfig.ts index cd2d728ac0f6..1dbda7e7ef74 100644 --- a/clients/client-cloudhsm-v2/src/runtimeConfig.ts +++ b/clients/client-cloudhsm-v2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudHSMV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudHSMV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudhsm/src/CloudHSMClient.ts b/clients/client-cloudhsm/src/CloudHSMClient.ts index 22e771f35d01..a766183f2cf6 100644 --- a/clients/client-cloudhsm/src/CloudHSMClient.ts +++ b/clients/client-cloudhsm/src/CloudHSMClient.ts @@ -231,6 +231,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudhsm/src/runtimeConfig.ts b/clients/client-cloudhsm/src/runtimeConfig.ts index 6d37c1812816..9033772a9650 100644 --- a/clients/client-cloudhsm/src/runtimeConfig.ts +++ b/clients/client-cloudhsm/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudHSMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudHSMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudsearch-domain/src/CloudSearchDomainClient.ts b/clients/client-cloudsearch-domain/src/CloudSearchDomainClient.ts index ccc2ba34f7f0..e3a4ada0bcdd 100644 --- a/clients/client-cloudsearch-domain/src/CloudSearchDomainClient.ts +++ b/clients/client-cloudsearch-domain/src/CloudSearchDomainClient.ts @@ -168,6 +168,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudsearch-domain/src/runtimeConfig.ts b/clients/client-cloudsearch-domain/src/runtimeConfig.ts index 130be908792b..a67ea3a66565 100644 --- a/clients/client-cloudsearch-domain/src/runtimeConfig.ts +++ b/clients/client-cloudsearch-domain/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudSearchDomainClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudSearchDomainClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudsearch/src/CloudSearchClient.ts b/clients/client-cloudsearch/src/CloudSearchClient.ts index f56a9404ee87..fde1ddd7ea69 100644 --- a/clients/client-cloudsearch/src/CloudSearchClient.ts +++ b/clients/client-cloudsearch/src/CloudSearchClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudsearch/src/runtimeConfig.ts b/clients/client-cloudsearch/src/runtimeConfig.ts index d8242caefdec..e6d0a8c61d28 100644 --- a/clients/client-cloudsearch/src/runtimeConfig.ts +++ b/clients/client-cloudsearch/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudSearchClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudSearchClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudtrail-data/src/CloudTrailDataClient.ts b/clients/client-cloudtrail-data/src/CloudTrailDataClient.ts index d0b725115d13..ca0424a98580 100644 --- a/clients/client-cloudtrail-data/src/CloudTrailDataClient.ts +++ b/clients/client-cloudtrail-data/src/CloudTrailDataClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudtrail-data/src/runtimeConfig.ts b/clients/client-cloudtrail-data/src/runtimeConfig.ts index d326f568f4cd..6223a0cc22fc 100644 --- a/clients/client-cloudtrail-data/src/runtimeConfig.ts +++ b/clients/client-cloudtrail-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudTrailDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudTrailDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudtrail/src/CloudTrailClient.ts b/clients/client-cloudtrail/src/CloudTrailClient.ts index 86ca64565f1e..d0e6d7489db3 100644 --- a/clients/client-cloudtrail/src/CloudTrailClient.ts +++ b/clients/client-cloudtrail/src/CloudTrailClient.ts @@ -375,6 +375,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudtrail/src/runtimeConfig.ts b/clients/client-cloudtrail/src/runtimeConfig.ts index f921b6cba371..32f04dd83668 100644 --- a/clients/client-cloudtrail/src/runtimeConfig.ts +++ b/clients/client-cloudtrail/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudTrailClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudTrailClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudwatch-events/src/CloudWatchEventsClient.ts b/clients/client-cloudwatch-events/src/CloudWatchEventsClient.ts index 1788ba5b0f58..cc547d7a9835 100644 --- a/clients/client-cloudwatch-events/src/CloudWatchEventsClient.ts +++ b/clients/client-cloudwatch-events/src/CloudWatchEventsClient.ts @@ -366,6 +366,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudwatch-events/src/runtimeConfig.ts b/clients/client-cloudwatch-events/src/runtimeConfig.ts index b7c1edd7b136..65938cda31b2 100644 --- a/clients/client-cloudwatch-events/src/runtimeConfig.ts +++ b/clients/client-cloudwatch-events/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CloudWatchEventsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CloudWatchEventsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts b/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts index 989c00697051..facea50c3461 100644 --- a/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts +++ b/clients/client-cloudwatch-logs/src/CloudWatchLogsClient.ts @@ -549,6 +549,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudwatch-logs/src/runtimeConfig.ts b/clients/client-cloudwatch-logs/src/runtimeConfig.ts index dab36d11e308..3ae8b87283c4 100644 --- a/clients/client-cloudwatch-logs/src/runtimeConfig.ts +++ b/clients/client-cloudwatch-logs/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: CloudWatchLogsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: CloudWatchLogsClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cloudwatch/src/CloudWatchClient.ts b/clients/client-cloudwatch/src/CloudWatchClient.ts index 24cee6713537..672ebcadfadb 100644 --- a/clients/client-cloudwatch/src/CloudWatchClient.ts +++ b/clients/client-cloudwatch/src/CloudWatchClient.ts @@ -323,6 +323,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cloudwatch/src/runtimeConfig.ts b/clients/client-cloudwatch/src/runtimeConfig.ts index 30170a477d79..6e3d71b6701d 100644 --- a/clients/client-cloudwatch/src/runtimeConfig.ts +++ b/clients/client-cloudwatch/src/runtimeConfig.ts @@ -36,6 +36,7 @@ export const getRuntimeConfig = (config: CloudWatchClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -47,22 +48,29 @@ export const getRuntimeConfig = (config: CloudWatchClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codeartifact/src/CodeartifactClient.ts b/clients/client-codeartifact/src/CodeartifactClient.ts index 6b10deb4e2ad..8108f18cc4dd 100644 --- a/clients/client-codeartifact/src/CodeartifactClient.ts +++ b/clients/client-codeartifact/src/CodeartifactClient.ts @@ -400,6 +400,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codeartifact/src/runtimeConfig.ts b/clients/client-codeartifact/src/runtimeConfig.ts index 53875f51e2d4..8d2bfd04f504 100644 --- a/clients/client-codeartifact/src/runtimeConfig.ts +++ b/clients/client-codeartifact/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeartifactClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeartifactClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codebuild/src/CodeBuildClient.ts b/clients/client-codebuild/src/CodeBuildClient.ts index f85919bc4d72..a2da3c9f9856 100644 --- a/clients/client-codebuild/src/CodeBuildClient.ts +++ b/clients/client-codebuild/src/CodeBuildClient.ts @@ -360,6 +360,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codebuild/src/runtimeConfig.ts b/clients/client-codebuild/src/runtimeConfig.ts index 35eb3475a7ea..f30feed115ba 100644 --- a/clients/client-codebuild/src/runtimeConfig.ts +++ b/clients/client-codebuild/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeBuildClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeBuildClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codecatalyst/src/CodeCatalystClient.ts b/clients/client-codecatalyst/src/CodeCatalystClient.ts index 89081dc4d835..30f75e2f3cde 100644 --- a/clients/client-codecatalyst/src/CodeCatalystClient.ts +++ b/clients/client-codecatalyst/src/CodeCatalystClient.ts @@ -323,6 +323,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codecatalyst/src/runtimeConfig.ts b/clients/client-codecatalyst/src/runtimeConfig.ts index f7eb436ebc41..765f28a8e2d1 100644 --- a/clients/client-codecatalyst/src/runtimeConfig.ts +++ b/clients/client-codecatalyst/src/runtimeConfig.ts @@ -34,6 +34,7 @@ export const getRuntimeConfig = (config: CodeCatalystClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -52,19 +53,25 @@ export const getRuntimeConfig = (config: CodeCatalystClientConfig) => { signer: new HttpBearerAuthSigner(), }, ], - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codecommit/src/CodeCommitClient.ts b/clients/client-codecommit/src/CodeCommitClient.ts index d6f9d8b3071a..c696dc336fba 100644 --- a/clients/client-codecommit/src/CodeCommitClient.ts +++ b/clients/client-codecommit/src/CodeCommitClient.ts @@ -552,6 +552,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codecommit/src/runtimeConfig.ts b/clients/client-codecommit/src/runtimeConfig.ts index af6683cea3bf..a49453d4c923 100644 --- a/clients/client-codecommit/src/runtimeConfig.ts +++ b/clients/client-codecommit/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeCommitClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeCommitClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codeconnections/src/CodeConnectionsClient.ts b/clients/client-codeconnections/src/CodeConnectionsClient.ts index a1a69b1d1c4e..7168e13df7e4 100644 --- a/clients/client-codeconnections/src/CodeConnectionsClient.ts +++ b/clients/client-codeconnections/src/CodeConnectionsClient.ts @@ -288,6 +288,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codeconnections/src/runtimeConfig.ts b/clients/client-codeconnections/src/runtimeConfig.ts index 2c4287c9ea89..c9b63670c28e 100644 --- a/clients/client-codeconnections/src/runtimeConfig.ts +++ b/clients/client-codeconnections/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeConnectionsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeConnectionsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codedeploy/src/CodeDeployClient.ts b/clients/client-codedeploy/src/CodeDeployClient.ts index b883d95e9eed..50d5f8d2654d 100644 --- a/clients/client-codedeploy/src/CodeDeployClient.ts +++ b/clients/client-codedeploy/src/CodeDeployClient.ts @@ -408,6 +408,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codedeploy/src/runtimeConfig.ts b/clients/client-codedeploy/src/runtimeConfig.ts index 6a11fe8ad176..9736f98f8f22 100644 --- a/clients/client-codedeploy/src/runtimeConfig.ts +++ b/clients/client-codedeploy/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeDeployClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeDeployClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codeguru-reviewer/src/CodeGuruReviewerClient.ts b/clients/client-codeguru-reviewer/src/CodeGuruReviewerClient.ts index 1850cac92b32..a254e8f626c8 100644 --- a/clients/client-codeguru-reviewer/src/CodeGuruReviewerClient.ts +++ b/clients/client-codeguru-reviewer/src/CodeGuruReviewerClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codeguru-reviewer/src/runtimeConfig.ts b/clients/client-codeguru-reviewer/src/runtimeConfig.ts index 1dad852aa96c..6d256dfcd60e 100644 --- a/clients/client-codeguru-reviewer/src/runtimeConfig.ts +++ b/clients/client-codeguru-reviewer/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeGuruReviewerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeGuruReviewerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codeguru-security/src/CodeGuruSecurityClient.ts b/clients/client-codeguru-security/src/CodeGuruSecurityClient.ts index ac8e4a8d6c14..d596deba2b59 100644 --- a/clients/client-codeguru-security/src/CodeGuruSecurityClient.ts +++ b/clients/client-codeguru-security/src/CodeGuruSecurityClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codeguru-security/src/runtimeConfig.ts b/clients/client-codeguru-security/src/runtimeConfig.ts index d378407d08cc..41d6712a8429 100644 --- a/clients/client-codeguru-security/src/runtimeConfig.ts +++ b/clients/client-codeguru-security/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeGuruSecurityClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeGuruSecurityClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codeguruprofiler/src/CodeGuruProfilerClient.ts b/clients/client-codeguruprofiler/src/CodeGuruProfilerClient.ts index 3cad866de5ca..9e90f9fc60fa 100644 --- a/clients/client-codeguruprofiler/src/CodeGuruProfilerClient.ts +++ b/clients/client-codeguruprofiler/src/CodeGuruProfilerClient.ts @@ -270,6 +270,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codeguruprofiler/src/runtimeConfig.ts b/clients/client-codeguruprofiler/src/runtimeConfig.ts index 546ec569940b..a0c256158bf1 100644 --- a/clients/client-codeguruprofiler/src/runtimeConfig.ts +++ b/clients/client-codeguruprofiler/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeGuruProfilerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeGuruProfilerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codepipeline/src/CodePipelineClient.ts b/clients/client-codepipeline/src/CodePipelineClient.ts index f506b661f221..4abb767b1f91 100644 --- a/clients/client-codepipeline/src/CodePipelineClient.ts +++ b/clients/client-codepipeline/src/CodePipelineClient.ts @@ -357,6 +357,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codepipeline/src/runtimeConfig.ts b/clients/client-codepipeline/src/runtimeConfig.ts index 351967387ef6..f16ea9db1615 100644 --- a/clients/client-codepipeline/src/runtimeConfig.ts +++ b/clients/client-codepipeline/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodePipelineClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodePipelineClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codestar-connections/src/CodeStarConnectionsClient.ts b/clients/client-codestar-connections/src/CodeStarConnectionsClient.ts index 01761a981099..6e5b8e3e59a6 100644 --- a/clients/client-codestar-connections/src/CodeStarConnectionsClient.ts +++ b/clients/client-codestar-connections/src/CodeStarConnectionsClient.ts @@ -288,6 +288,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codestar-connections/src/runtimeConfig.ts b/clients/client-codestar-connections/src/runtimeConfig.ts index 3f59b09049d0..015c01555045 100644 --- a/clients/client-codestar-connections/src/runtimeConfig.ts +++ b/clients/client-codestar-connections/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodeStarConnectionsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodeStarConnectionsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-codestar-notifications/src/CodestarNotificationsClient.ts b/clients/client-codestar-notifications/src/CodestarNotificationsClient.ts index 770d60c908a1..f3550c60d02e 100644 --- a/clients/client-codestar-notifications/src/CodestarNotificationsClient.ts +++ b/clients/client-codestar-notifications/src/CodestarNotificationsClient.ts @@ -222,6 +222,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-codestar-notifications/src/runtimeConfig.ts b/clients/client-codestar-notifications/src/runtimeConfig.ts index 1949c30dd37b..7eeca82787e0 100644 --- a/clients/client-codestar-notifications/src/runtimeConfig.ts +++ b/clients/client-codestar-notifications/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CodestarNotificationsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CodestarNotificationsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts b/clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts index 81f8cded0865..c9f1097036f7 100644 --- a/clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts +++ b/clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts @@ -705,6 +705,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cognito-identity-provider/src/runtimeConfig.ts b/clients/client-cognito-identity-provider/src/runtimeConfig.ts index 5fff34bd3fa3..eaca4b931f16 100644 --- a/clients/client-cognito-identity-provider/src/runtimeConfig.ts +++ b/clients/client-cognito-identity-provider/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CognitoIdentityProviderClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CognitoIdentityProviderClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cognito-identity/src/CognitoIdentityClient.ts b/clients/client-cognito-identity/src/CognitoIdentityClient.ts index dc39b104f6ac..cd21dd257250 100644 --- a/clients/client-cognito-identity/src/CognitoIdentityClient.ts +++ b/clients/client-cognito-identity/src/CognitoIdentityClient.ts @@ -267,6 +267,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cognito-identity/src/runtimeConfig.ts b/clients/client-cognito-identity/src/runtimeConfig.ts index 6142036599db..eb69c09be7da 100644 --- a/clients/client-cognito-identity/src/runtimeConfig.ts +++ b/clients/client-cognito-identity/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CognitoIdentityClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CognitoIdentityClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cognito-sync/src/CognitoSyncClient.ts b/clients/client-cognito-sync/src/CognitoSyncClient.ts index 48b2cb6da938..8d36305acca0 100644 --- a/clients/client-cognito-sync/src/CognitoSyncClient.ts +++ b/clients/client-cognito-sync/src/CognitoSyncClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cognito-sync/src/runtimeConfig.ts b/clients/client-cognito-sync/src/runtimeConfig.ts index 2c78c4145855..23ea071848fc 100644 --- a/clients/client-cognito-sync/src/runtimeConfig.ts +++ b/clients/client-cognito-sync/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CognitoSyncClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CognitoSyncClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-comprehend/src/ComprehendClient.ts b/clients/client-comprehend/src/ComprehendClient.ts index cdf1112840be..67ea61712443 100644 --- a/clients/client-comprehend/src/ComprehendClient.ts +++ b/clients/client-comprehend/src/ComprehendClient.ts @@ -600,6 +600,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-comprehend/src/runtimeConfig.ts b/clients/client-comprehend/src/runtimeConfig.ts index 44b0a793ceb8..f1c728e3ec15 100644 --- a/clients/client-comprehend/src/runtimeConfig.ts +++ b/clients/client-comprehend/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ComprehendClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ComprehendClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-comprehendmedical/src/ComprehendMedicalClient.ts b/clients/client-comprehendmedical/src/ComprehendMedicalClient.ts index e3bc7742fccc..8f9feff4dee8 100644 --- a/clients/client-comprehendmedical/src/ComprehendMedicalClient.ts +++ b/clients/client-comprehendmedical/src/ComprehendMedicalClient.ts @@ -303,6 +303,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-comprehendmedical/src/runtimeConfig.ts b/clients/client-comprehendmedical/src/runtimeConfig.ts index f810fa140bb4..968bf5425790 100644 --- a/clients/client-comprehendmedical/src/runtimeConfig.ts +++ b/clients/client-comprehendmedical/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ComprehendMedicalClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ComprehendMedicalClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-compute-optimizer/src/ComputeOptimizerClient.ts b/clients/client-compute-optimizer/src/ComputeOptimizerClient.ts index fdd035a070e8..b956229436a8 100644 --- a/clients/client-compute-optimizer/src/ComputeOptimizerClient.ts +++ b/clients/client-compute-optimizer/src/ComputeOptimizerClient.ts @@ -333,6 +333,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-compute-optimizer/src/runtimeConfig.ts b/clients/client-compute-optimizer/src/runtimeConfig.ts index b7289680b425..58cafe6c1d99 100644 --- a/clients/client-compute-optimizer/src/runtimeConfig.ts +++ b/clients/client-compute-optimizer/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ComputeOptimizerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ComputeOptimizerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-config-service/src/ConfigServiceClient.ts b/clients/client-config-service/src/ConfigServiceClient.ts index d755d9886885..8a3fdfb72494 100644 --- a/clients/client-config-service/src/ConfigServiceClient.ts +++ b/clients/client-config-service/src/ConfigServiceClient.ts @@ -711,6 +711,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-config-service/src/runtimeConfig.ts b/clients/client-config-service/src/runtimeConfig.ts index 809c6e643480..b19293653811 100644 --- a/clients/client-config-service/src/runtimeConfig.ts +++ b/clients/client-config-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConfigServiceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConfigServiceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-connect-contact-lens/src/ConnectContactLensClient.ts b/clients/client-connect-contact-lens/src/ConnectContactLensClient.ts index 8913c6524d1a..a0cd75f7cf08 100644 --- a/clients/client-connect-contact-lens/src/ConnectContactLensClient.ts +++ b/clients/client-connect-contact-lens/src/ConnectContactLensClient.ts @@ -169,6 +169,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-connect-contact-lens/src/runtimeConfig.ts b/clients/client-connect-contact-lens/src/runtimeConfig.ts index 83d372cef1c2..057b78add039 100644 --- a/clients/client-connect-contact-lens/src/runtimeConfig.ts +++ b/clients/client-connect-contact-lens/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConnectContactLensClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConnectContactLensClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-connect/src/ConnectClient.ts b/clients/client-connect/src/ConnectClient.ts index c8b769012f6c..f75657fbd99c 100644 --- a/clients/client-connect/src/ConnectClient.ts +++ b/clients/client-connect/src/ConnectClient.ts @@ -1515,6 +1515,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-connect/src/runtimeConfig.ts b/clients/client-connect/src/runtimeConfig.ts index d6b403dac718..89cee773367c 100644 --- a/clients/client-connect/src/runtimeConfig.ts +++ b/clients/client-connect/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConnectClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConnectClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-connectcampaigns/src/ConnectCampaignsClient.ts b/clients/client-connectcampaigns/src/ConnectCampaignsClient.ts index 9e22ba0ee1f9..740f35abec5b 100644 --- a/clients/client-connectcampaigns/src/ConnectCampaignsClient.ts +++ b/clients/client-connectcampaigns/src/ConnectCampaignsClient.ts @@ -261,6 +261,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-connectcampaigns/src/runtimeConfig.ts b/clients/client-connectcampaigns/src/runtimeConfig.ts index 81ab4d0778ee..a328a442b0ca 100644 --- a/clients/client-connectcampaigns/src/runtimeConfig.ts +++ b/clients/client-connectcampaigns/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConnectCampaignsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConnectCampaignsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-connectcampaignsv2/src/ConnectCampaignsV2Client.ts b/clients/client-connectcampaignsv2/src/ConnectCampaignsV2Client.ts index 917a0f16bb26..96a9e4558941 100644 --- a/clients/client-connectcampaignsv2/src/ConnectCampaignsV2Client.ts +++ b/clients/client-connectcampaignsv2/src/ConnectCampaignsV2Client.ts @@ -327,6 +327,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-connectcampaignsv2/src/runtimeConfig.ts b/clients/client-connectcampaignsv2/src/runtimeConfig.ts index 29d5fec601c0..06ab1390340a 100644 --- a/clients/client-connectcampaignsv2/src/runtimeConfig.ts +++ b/clients/client-connectcampaignsv2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConnectCampaignsV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConnectCampaignsV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-connectcases/src/ConnectCasesClient.ts b/clients/client-connectcases/src/ConnectCasesClient.ts index cabe9eab6ad0..812f5f3e09e0 100644 --- a/clients/client-connectcases/src/ConnectCasesClient.ts +++ b/clients/client-connectcases/src/ConnectCasesClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-connectcases/src/runtimeConfig.ts b/clients/client-connectcases/src/runtimeConfig.ts index 06abdc951b76..e1a78884d09c 100644 --- a/clients/client-connectcases/src/runtimeConfig.ts +++ b/clients/client-connectcases/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConnectCasesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConnectCasesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-connectparticipant/src/ConnectParticipantClient.ts b/clients/client-connectparticipant/src/ConnectParticipantClient.ts index fe4d04be1b7c..3691b91993d5 100644 --- a/clients/client-connectparticipant/src/ConnectParticipantClient.ts +++ b/clients/client-connectparticipant/src/ConnectParticipantClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-connectparticipant/src/runtimeConfig.ts b/clients/client-connectparticipant/src/runtimeConfig.ts index f91a5d501c97..81332314c981 100644 --- a/clients/client-connectparticipant/src/runtimeConfig.ts +++ b/clients/client-connectparticipant/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ConnectParticipantClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ConnectParticipantClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-controlcatalog/src/ControlCatalogClient.ts b/clients/client-controlcatalog/src/ControlCatalogClient.ts index fc1b9c4e94b6..2ef1e519830f 100644 --- a/clients/client-controlcatalog/src/ControlCatalogClient.ts +++ b/clients/client-controlcatalog/src/ControlCatalogClient.ts @@ -180,6 +180,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-controlcatalog/src/runtimeConfig.ts b/clients/client-controlcatalog/src/runtimeConfig.ts index a7887084eeef..65c390729527 100644 --- a/clients/client-controlcatalog/src/runtimeConfig.ts +++ b/clients/client-controlcatalog/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ControlCatalogClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ControlCatalogClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-controltower/src/ControlTowerClient.ts b/clients/client-controltower/src/ControlTowerClient.ts index 8ca18e2f7446..14b003cc1a93 100644 --- a/clients/client-controltower/src/ControlTowerClient.ts +++ b/clients/client-controltower/src/ControlTowerClient.ts @@ -285,6 +285,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-controltower/src/runtimeConfig.ts b/clients/client-controltower/src/runtimeConfig.ts index 895bd4218645..bc956f7d4ed0 100644 --- a/clients/client-controltower/src/runtimeConfig.ts +++ b/clients/client-controltower/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ControlTowerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ControlTowerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cost-and-usage-report-service/src/CostAndUsageReportServiceClient.ts b/clients/client-cost-and-usage-report-service/src/CostAndUsageReportServiceClient.ts index b08787ba8705..66aa19d8a54b 100644 --- a/clients/client-cost-and-usage-report-service/src/CostAndUsageReportServiceClient.ts +++ b/clients/client-cost-and-usage-report-service/src/CostAndUsageReportServiceClient.ts @@ -201,6 +201,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts b/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts index 03d08cf71a66..f4f102d486c2 100644 --- a/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts +++ b/clients/client-cost-and-usage-report-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CostAndUsageReportServiceClientConfig) const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CostAndUsageReportServiceClientConfig) defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cost-explorer/src/CostExplorerClient.ts b/clients/client-cost-explorer/src/CostExplorerClient.ts index 81c7699637d3..fc42fed5d0f0 100644 --- a/clients/client-cost-explorer/src/CostExplorerClient.ts +++ b/clients/client-cost-explorer/src/CostExplorerClient.ts @@ -399,6 +399,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cost-explorer/src/runtimeConfig.ts b/clients/client-cost-explorer/src/runtimeConfig.ts index 3a395eca87c9..585a1f1bfc21 100644 --- a/clients/client-cost-explorer/src/runtimeConfig.ts +++ b/clients/client-cost-explorer/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CostExplorerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CostExplorerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-cost-optimization-hub/src/CostOptimizationHubClient.ts b/clients/client-cost-optimization-hub/src/CostOptimizationHubClient.ts index f2427000b97b..b77b9e14735a 100644 --- a/clients/client-cost-optimization-hub/src/CostOptimizationHubClient.ts +++ b/clients/client-cost-optimization-hub/src/CostOptimizationHubClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-cost-optimization-hub/src/runtimeConfig.ts b/clients/client-cost-optimization-hub/src/runtimeConfig.ts index 449d6c1db864..992610da3a70 100644 --- a/clients/client-cost-optimization-hub/src/runtimeConfig.ts +++ b/clients/client-cost-optimization-hub/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CostOptimizationHubClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CostOptimizationHubClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-customer-profiles/src/CustomerProfilesClient.ts b/clients/client-customer-profiles/src/CustomerProfilesClient.ts index 99c643792807..00b7a882eb4e 100644 --- a/clients/client-customer-profiles/src/CustomerProfilesClient.ts +++ b/clients/client-customer-profiles/src/CustomerProfilesClient.ts @@ -471,6 +471,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-customer-profiles/src/runtimeConfig.ts b/clients/client-customer-profiles/src/runtimeConfig.ts index 96327edf2e7d..6887f39847b7 100644 --- a/clients/client-customer-profiles/src/runtimeConfig.ts +++ b/clients/client-customer-profiles/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: CustomerProfilesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: CustomerProfilesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-data-pipeline/src/DataPipelineClient.ts b/clients/client-data-pipeline/src/DataPipelineClient.ts index f4c70ca0d198..08851988f3e9 100644 --- a/clients/client-data-pipeline/src/DataPipelineClient.ts +++ b/clients/client-data-pipeline/src/DataPipelineClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-data-pipeline/src/runtimeConfig.ts b/clients/client-data-pipeline/src/runtimeConfig.ts index 04cb74c2022d..90b71c268297 100644 --- a/clients/client-data-pipeline/src/runtimeConfig.ts +++ b/clients/client-data-pipeline/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DataPipelineClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DataPipelineClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts b/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts index a99907de8213..ab3694ede6df 100644 --- a/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts +++ b/clients/client-database-migration-service/src/DatabaseMigrationServiceClient.ts @@ -777,6 +777,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-database-migration-service/src/runtimeConfig.ts b/clients/client-database-migration-service/src/runtimeConfig.ts index d45c603ac2ca..4d0f09965937 100644 --- a/clients/client-database-migration-service/src/runtimeConfig.ts +++ b/clients/client-database-migration-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DatabaseMigrationServiceClientConfig) = const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DatabaseMigrationServiceClientConfig) = defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-databrew/src/DataBrewClient.ts b/clients/client-databrew/src/DataBrewClient.ts index eff22004a580..5a81c337e948 100644 --- a/clients/client-databrew/src/DataBrewClient.ts +++ b/clients/client-databrew/src/DataBrewClient.ts @@ -318,6 +318,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-databrew/src/runtimeConfig.ts b/clients/client-databrew/src/runtimeConfig.ts index a6cd6d1305d2..da45749bb9cc 100644 --- a/clients/client-databrew/src/runtimeConfig.ts +++ b/clients/client-databrew/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DataBrewClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DataBrewClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-dataexchange/src/DataExchangeClient.ts b/clients/client-dataexchange/src/DataExchangeClient.ts index c4f1437b1bac..9e6771df6257 100644 --- a/clients/client-dataexchange/src/DataExchangeClient.ts +++ b/clients/client-dataexchange/src/DataExchangeClient.ts @@ -291,6 +291,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-dataexchange/src/runtimeConfig.ts b/clients/client-dataexchange/src/runtimeConfig.ts index d1bed1fa7c1c..c47e3d620859 100644 --- a/clients/client-dataexchange/src/runtimeConfig.ts +++ b/clients/client-dataexchange/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DataExchangeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DataExchangeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-datasync/src/DataSyncClient.ts b/clients/client-datasync/src/DataSyncClient.ts index a7993aad2af0..3b071172f314 100644 --- a/clients/client-datasync/src/DataSyncClient.ts +++ b/clients/client-datasync/src/DataSyncClient.ts @@ -432,6 +432,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-datasync/src/runtimeConfig.ts b/clients/client-datasync/src/runtimeConfig.ts index e093ea998c61..f7010e93f922 100644 --- a/clients/client-datasync/src/runtimeConfig.ts +++ b/clients/client-datasync/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DataSyncClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DataSyncClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-datazone/src/DataZoneClient.ts b/clients/client-datazone/src/DataZoneClient.ts index 7d2d36cf5e40..1ec8197f279f 100644 --- a/clients/client-datazone/src/DataZoneClient.ts +++ b/clients/client-datazone/src/DataZoneClient.ts @@ -822,6 +822,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-datazone/src/runtimeConfig.ts b/clients/client-datazone/src/runtimeConfig.ts index c699e3e3de00..5479c7065e86 100644 --- a/clients/client-datazone/src/runtimeConfig.ts +++ b/clients/client-datazone/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DataZoneClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DataZoneClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-dax/src/DAXClient.ts b/clients/client-dax/src/DAXClient.ts index 0feeec828e6b..da6b01809b40 100644 --- a/clients/client-dax/src/DAXClient.ts +++ b/clients/client-dax/src/DAXClient.ts @@ -252,6 +252,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-dax/src/runtimeConfig.ts b/clients/client-dax/src/runtimeConfig.ts index 702a98b51b03..ffa322fe8cc0 100644 --- a/clients/client-dax/src/runtimeConfig.ts +++ b/clients/client-dax/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DAXClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DAXClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-deadline/src/DeadlineClient.ts b/clients/client-deadline/src/DeadlineClient.ts index c425fd4550ab..9366553bcdf4 100644 --- a/clients/client-deadline/src/DeadlineClient.ts +++ b/clients/client-deadline/src/DeadlineClient.ts @@ -600,6 +600,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-deadline/src/runtimeConfig.ts b/clients/client-deadline/src/runtimeConfig.ts index cd55f82c4f7d..c07a7e537bec 100644 --- a/clients/client-deadline/src/runtimeConfig.ts +++ b/clients/client-deadline/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DeadlineClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DeadlineClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-detective/src/DetectiveClient.ts b/clients/client-detective/src/DetectiveClient.ts index 88e532ed942e..bdd1598b6750 100644 --- a/clients/client-detective/src/DetectiveClient.ts +++ b/clients/client-detective/src/DetectiveClient.ts @@ -291,6 +291,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-detective/src/runtimeConfig.ts b/clients/client-detective/src/runtimeConfig.ts index d230dd5b4ac1..7029f0501ed5 100644 --- a/clients/client-detective/src/runtimeConfig.ts +++ b/clients/client-detective/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DetectiveClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DetectiveClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-device-farm/src/DeviceFarmClient.ts b/clients/client-device-farm/src/DeviceFarmClient.ts index 4c8b7e9077eb..fd9800b9ad17 100644 --- a/clients/client-device-farm/src/DeviceFarmClient.ts +++ b/clients/client-device-farm/src/DeviceFarmClient.ts @@ -492,6 +492,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-device-farm/src/runtimeConfig.ts b/clients/client-device-farm/src/runtimeConfig.ts index 92b73f0c5298..6eb34d8dd966 100644 --- a/clients/client-device-farm/src/runtimeConfig.ts +++ b/clients/client-device-farm/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DeviceFarmClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DeviceFarmClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-devops-guru/src/DevOpsGuruClient.ts b/clients/client-devops-guru/src/DevOpsGuruClient.ts index 97f7e029ace4..81284700bdf0 100644 --- a/clients/client-devops-guru/src/DevOpsGuruClient.ts +++ b/clients/client-devops-guru/src/DevOpsGuruClient.ts @@ -324,6 +324,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-devops-guru/src/runtimeConfig.ts b/clients/client-devops-guru/src/runtimeConfig.ts index d5706e1d0230..b89e220c905d 100644 --- a/clients/client-devops-guru/src/runtimeConfig.ts +++ b/clients/client-devops-guru/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DevOpsGuruClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DevOpsGuruClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-direct-connect/src/DirectConnectClient.ts b/clients/client-direct-connect/src/DirectConnectClient.ts index 4aa657a70ffb..fee8997bafae 100644 --- a/clients/client-direct-connect/src/DirectConnectClient.ts +++ b/clients/client-direct-connect/src/DirectConnectClient.ts @@ -489,6 +489,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-direct-connect/src/runtimeConfig.ts b/clients/client-direct-connect/src/runtimeConfig.ts index e39f788ced76..e1e3a6162a6d 100644 --- a/clients/client-direct-connect/src/runtimeConfig.ts +++ b/clients/client-direct-connect/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DirectConnectClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DirectConnectClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-directory-service-data/src/DirectoryServiceDataClient.ts b/clients/client-directory-service-data/src/DirectoryServiceDataClient.ts index be745c5fe08e..c40be0e99181 100644 --- a/clients/client-directory-service-data/src/DirectoryServiceDataClient.ts +++ b/clients/client-directory-service-data/src/DirectoryServiceDataClient.ts @@ -219,6 +219,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-directory-service-data/src/runtimeConfig.ts b/clients/client-directory-service-data/src/runtimeConfig.ts index 4d9a54ae3769..f17b75524a07 100644 --- a/clients/client-directory-service-data/src/runtimeConfig.ts +++ b/clients/client-directory-service-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DirectoryServiceDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DirectoryServiceDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-directory-service/src/DirectoryServiceClient.ts b/clients/client-directory-service/src/DirectoryServiceClient.ts index 70d461267dce..a84d5e497f58 100644 --- a/clients/client-directory-service/src/DirectoryServiceClient.ts +++ b/clients/client-directory-service/src/DirectoryServiceClient.ts @@ -474,6 +474,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-directory-service/src/runtimeConfig.ts b/clients/client-directory-service/src/runtimeConfig.ts index ec97c76b90bf..b7f349248c42 100644 --- a/clients/client-directory-service/src/runtimeConfig.ts +++ b/clients/client-directory-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DirectoryServiceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DirectoryServiceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-dlm/src/DLMClient.ts b/clients/client-dlm/src/DLMClient.ts index dde6010f177f..32a5b16cbe13 100644 --- a/clients/client-dlm/src/DLMClient.ts +++ b/clients/client-dlm/src/DLMClient.ts @@ -204,6 +204,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-dlm/src/runtimeConfig.ts b/clients/client-dlm/src/runtimeConfig.ts index f04c9d204828..1e004b8c5913 100644 --- a/clients/client-dlm/src/runtimeConfig.ts +++ b/clients/client-dlm/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DLMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DLMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-docdb-elastic/src/DocDBElasticClient.ts b/clients/client-docdb-elastic/src/DocDBElasticClient.ts index 472cbf5e3367..323fa44e84b3 100644 --- a/clients/client-docdb-elastic/src/DocDBElasticClient.ts +++ b/clients/client-docdb-elastic/src/DocDBElasticClient.ts @@ -249,6 +249,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-docdb-elastic/src/runtimeConfig.ts b/clients/client-docdb-elastic/src/runtimeConfig.ts index 4ef96b9da204..4aa2656c2a87 100644 --- a/clients/client-docdb-elastic/src/runtimeConfig.ts +++ b/clients/client-docdb-elastic/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DocDBElasticClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DocDBElasticClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-docdb/src/DocDBClient.ts b/clients/client-docdb/src/DocDBClient.ts index 3162ec99e484..90e8ddf31aaf 100644 --- a/clients/client-docdb/src/DocDBClient.ts +++ b/clients/client-docdb/src/DocDBClient.ts @@ -456,6 +456,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-docdb/src/runtimeConfig.ts b/clients/client-docdb/src/runtimeConfig.ts index a8385e6d41cc..518d4fd82925 100644 --- a/clients/client-docdb/src/runtimeConfig.ts +++ b/clients/client-docdb/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DocDBClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DocDBClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-drs/src/DrsClient.ts b/clients/client-drs/src/DrsClient.ts index f3cbe3ab43e3..8683621af5ed 100644 --- a/clients/client-drs/src/DrsClient.ts +++ b/clients/client-drs/src/DrsClient.ts @@ -423,6 +423,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-drs/src/runtimeConfig.ts b/clients/client-drs/src/runtimeConfig.ts index 5be0f80a2e9e..97ffd0122953 100644 --- a/clients/client-drs/src/runtimeConfig.ts +++ b/clients/client-drs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DrsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DrsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-dsql/src/DSQLClient.ts b/clients/client-dsql/src/DSQLClient.ts index b10b4ab82b92..f4652640ce8e 100644 --- a/clients/client-dsql/src/DSQLClient.ts +++ b/clients/client-dsql/src/DSQLClient.ts @@ -204,6 +204,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-dsql/src/commands/CreateMultiRegionClustersCommand.ts b/clients/client-dsql/src/commands/CreateMultiRegionClustersCommand.ts index 483bf42fa960..dd4bf3d866d0 100644 --- a/clients/client-dsql/src/commands/CreateMultiRegionClustersCommand.ts +++ b/clients/client-dsql/src/commands/CreateMultiRegionClustersCommand.ts @@ -107,8 +107,8 @@ export interface CreateMultiRegionClustersCommandOutput extends CreateMultiRegio * /* response == * { * "linkedClusterArns": [ - * "arn:aws:xanadu:us-east-1:111122223333:cluster/abcdefghijklmnopqrst12345", - * "arn:aws:xanadu:us-east-2:111122223333:cluster/klmnopqrstuvwxyzabcd54321" + * "arn:aws:dsql:us-east-1:111122223333:cluster/abcdefghijklmnopqrst12345", + * "arn:aws:dsql:us-east-2:111122223333:cluster/klmnopqrstuvwxyzabcd54321" * ] * } * *\/ diff --git a/clients/client-dsql/src/commands/DeleteMultiRegionClustersCommand.ts b/clients/client-dsql/src/commands/DeleteMultiRegionClustersCommand.ts index 7b1c47283167..9dfc684d0fed 100644 --- a/clients/client-dsql/src/commands/DeleteMultiRegionClustersCommand.ts +++ b/clients/client-dsql/src/commands/DeleteMultiRegionClustersCommand.ts @@ -81,8 +81,8 @@ export interface DeleteMultiRegionClustersCommandOutput extends __MetadataBearer * // * const input = { * "linkedClusterArns": [ - * "arn:aws:xanadu:us-east-1:111122223333:cluster/abcdefghijklmnopqrst12345", - * "arn:aws:xanadu:us-east-2:111122223333:cluster/klmnopqrstuvwxyzabcd54321" + * "arn:aws:dsql:us-east-1:111122223333:cluster/abcdefghijklmnopqrst12345", + * "arn:aws:dsql:us-east-2:111122223333:cluster/klmnopqrstuvwxyzabcd54321" * ] * }; * const command = new DeleteMultiRegionClustersCommand(input); diff --git a/clients/client-dsql/src/runtimeConfig.ts b/clients/client-dsql/src/runtimeConfig.ts index 108a98962ab1..b77ebc6ff4d6 100644 --- a/clients/client-dsql/src/runtimeConfig.ts +++ b/clients/client-dsql/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DSQLClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DSQLClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-dynamodb-streams/src/DynamoDBStreamsClient.ts b/clients/client-dynamodb-streams/src/DynamoDBStreamsClient.ts index e732b81d7a87..305c5b77b447 100644 --- a/clients/client-dynamodb-streams/src/DynamoDBStreamsClient.ts +++ b/clients/client-dynamodb-streams/src/DynamoDBStreamsClient.ts @@ -177,6 +177,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-dynamodb-streams/src/runtimeConfig.ts b/clients/client-dynamodb-streams/src/runtimeConfig.ts index fa8419bb113c..f1660b138417 100644 --- a/clients/client-dynamodb-streams/src/runtimeConfig.ts +++ b/clients/client-dynamodb-streams/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: DynamoDBStreamsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: DynamoDBStreamsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-dynamodb/src/DynamoDBClient.ts b/clients/client-dynamodb/src/DynamoDBClient.ts index 1671eacbcf9a..76261aa6da78 100644 --- a/clients/client-dynamodb/src/DynamoDBClient.ts +++ b/clients/client-dynamodb/src/DynamoDBClient.ts @@ -408,6 +408,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Defines if the AWS AccountId will be used for endpoint routing. */ diff --git a/clients/client-dynamodb/src/runtimeConfig.ts b/clients/client-dynamodb/src/runtimeConfig.ts index eff66914c20a..3d69132dbe47 100644 --- a/clients/client-dynamodb/src/runtimeConfig.ts +++ b/clients/client-dynamodb/src/runtimeConfig.ts @@ -34,33 +34,40 @@ export const getRuntimeConfig = (config: DynamoDBClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, runtime: "node", defaultsMode, accountIdEndpointMode: - config?.accountIdEndpointMode ?? loadNodeConfig(NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS), + config?.accountIdEndpointMode ?? loadNodeConfig(NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS, profileConfig), bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), endpointDiscoveryEnabledProvider: - config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS, profileConfig), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ebs/src/EBSClient.ts b/clients/client-ebs/src/EBSClient.ts index d058f15b1223..e433397be2a7 100644 --- a/clients/client-ebs/src/EBSClient.ts +++ b/clients/client-ebs/src/EBSClient.ts @@ -184,6 +184,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ebs/src/runtimeConfig.ts b/clients/client-ebs/src/runtimeConfig.ts index 7d3cbadc229c..46d7bba075ac 100644 --- a/clients/client-ebs/src/runtimeConfig.ts +++ b/clients/client-ebs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EBSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EBSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ec2-instance-connect/src/EC2InstanceConnectClient.ts b/clients/client-ec2-instance-connect/src/EC2InstanceConnectClient.ts index f9583f1b2e3b..a99d7adb9fec 100644 --- a/clients/client-ec2-instance-connect/src/EC2InstanceConnectClient.ts +++ b/clients/client-ec2-instance-connect/src/EC2InstanceConnectClient.ts @@ -170,6 +170,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ec2-instance-connect/src/runtimeConfig.ts b/clients/client-ec2-instance-connect/src/runtimeConfig.ts index c320439a6c58..ac88c58f16a0 100644 --- a/clients/client-ec2-instance-connect/src/runtimeConfig.ts +++ b/clients/client-ec2-instance-connect/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EC2InstanceConnectClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EC2InstanceConnectClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ec2/src/EC2Client.ts b/clients/client-ec2/src/EC2Client.ts index eb3738f75e45..1493e8ec904a 100644 --- a/clients/client-ec2/src/EC2Client.ts +++ b/clients/client-ec2/src/EC2Client.ts @@ -3729,6 +3729,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ec2/src/runtimeConfig.ts b/clients/client-ec2/src/runtimeConfig.ts index d6a3275594de..77cfd988cc10 100644 --- a/clients/client-ec2/src/runtimeConfig.ts +++ b/clients/client-ec2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EC2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EC2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ecr-public/src/ECRPUBLICClient.ts b/clients/client-ecr-public/src/ECRPUBLICClient.ts index f6d28c40665c..f3edaea959e2 100644 --- a/clients/client-ecr-public/src/ECRPUBLICClient.ts +++ b/clients/client-ecr-public/src/ECRPUBLICClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ecr-public/src/runtimeConfig.ts b/clients/client-ecr-public/src/runtimeConfig.ts index b1f3c845d2ad..315d41aab4e9 100644 --- a/clients/client-ecr-public/src/runtimeConfig.ts +++ b/clients/client-ecr-public/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ECRPUBLICClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ECRPUBLICClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ecr/src/ECRClient.ts b/clients/client-ecr/src/ECRClient.ts index 59f736941ece..efddda1eba58 100644 --- a/clients/client-ecr/src/ECRClient.ts +++ b/clients/client-ecr/src/ECRClient.ts @@ -405,6 +405,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ecr/src/runtimeConfig.ts b/clients/client-ecr/src/runtimeConfig.ts index be53ff97289f..2929fe7c3a0c 100644 --- a/clients/client-ecr/src/runtimeConfig.ts +++ b/clients/client-ecr/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ECRClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ECRClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ecs/src/ECSClient.ts b/clients/client-ecs/src/ECSClient.ts index 909ce62972bc..6c0b786310d8 100644 --- a/clients/client-ecs/src/ECSClient.ts +++ b/clients/client-ecs/src/ECSClient.ts @@ -438,6 +438,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ecs/src/runtimeConfig.ts b/clients/client-ecs/src/runtimeConfig.ts index db22e35d81ea..687ef6f74891 100644 --- a/clients/client-ecs/src/runtimeConfig.ts +++ b/clients/client-ecs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ECSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ECSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-efs/src/EFSClient.ts b/clients/client-efs/src/EFSClient.ts index 288cfd58e774..283ecc21ef5a 100644 --- a/clients/client-efs/src/EFSClient.ts +++ b/clients/client-efs/src/EFSClient.ts @@ -312,6 +312,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-efs/src/runtimeConfig.ts b/clients/client-efs/src/runtimeConfig.ts index d3cf5565f4af..8a01196ede98 100644 --- a/clients/client-efs/src/runtimeConfig.ts +++ b/clients/client-efs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EFSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EFSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-eks-auth/src/EKSAuthClient.ts b/clients/client-eks-auth/src/EKSAuthClient.ts index 5e2666dbf562..57bc2599560b 100644 --- a/clients/client-eks-auth/src/EKSAuthClient.ts +++ b/clients/client-eks-auth/src/EKSAuthClient.ts @@ -169,6 +169,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-eks-auth/src/runtimeConfig.ts b/clients/client-eks-auth/src/runtimeConfig.ts index e96cf13b53bd..5a340fdcd688 100644 --- a/clients/client-eks-auth/src/runtimeConfig.ts +++ b/clients/client-eks-auth/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EKSAuthClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EKSAuthClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-eks/src/EKSClient.ts b/clients/client-eks/src/EKSClient.ts index 906ae41b506f..bb4b62df62e6 100644 --- a/clients/client-eks/src/EKSClient.ts +++ b/clients/client-eks/src/EKSClient.ts @@ -423,6 +423,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-eks/src/runtimeConfig.ts b/clients/client-eks/src/runtimeConfig.ts index 3c320cd59861..995f035cb267 100644 --- a/clients/client-eks/src/runtimeConfig.ts +++ b/clients/client-eks/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EKSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EKSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elastic-beanstalk/src/ElasticBeanstalkClient.ts b/clients/client-elastic-beanstalk/src/ElasticBeanstalkClient.ts index a7fb6f297e49..a330c0e41eef 100644 --- a/clients/client-elastic-beanstalk/src/ElasticBeanstalkClient.ts +++ b/clients/client-elastic-beanstalk/src/ElasticBeanstalkClient.ts @@ -423,6 +423,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elastic-beanstalk/src/runtimeConfig.ts b/clients/client-elastic-beanstalk/src/runtimeConfig.ts index 5dde618bb615..1de41774ded4 100644 --- a/clients/client-elastic-beanstalk/src/runtimeConfig.ts +++ b/clients/client-elastic-beanstalk/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElasticBeanstalkClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElasticBeanstalkClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elastic-inference/src/ElasticInferenceClient.ts b/clients/client-elastic-inference/src/ElasticInferenceClient.ts index c21f32acfc78..87a76d5ac935 100644 --- a/clients/client-elastic-inference/src/ElasticInferenceClient.ts +++ b/clients/client-elastic-inference/src/ElasticInferenceClient.ts @@ -195,6 +195,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elastic-inference/src/runtimeConfig.ts b/clients/client-elastic-inference/src/runtimeConfig.ts index b0ca5c47f2cb..cd4101b411db 100644 --- a/clients/client-elastic-inference/src/runtimeConfig.ts +++ b/clients/client-elastic-inference/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElasticInferenceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElasticInferenceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts index 8779e8799a9f..1a0f3b174100 100644 --- a/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts +++ b/clients/client-elastic-load-balancing-v2/src/ElasticLoadBalancingV2Client.ts @@ -387,6 +387,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts index 0f02d277e40b..bb0eff652faa 100644 --- a/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing-v2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElasticLoadBalancingV2ClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElasticLoadBalancingV2ClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elastic-load-balancing/src/ElasticLoadBalancingClient.ts b/clients/client-elastic-load-balancing/src/ElasticLoadBalancingClient.ts index 4773eb8b4866..b70138247d0e 100644 --- a/clients/client-elastic-load-balancing/src/ElasticLoadBalancingClient.ts +++ b/clients/client-elastic-load-balancing/src/ElasticLoadBalancingClient.ts @@ -324,6 +324,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elastic-load-balancing/src/runtimeConfig.ts b/clients/client-elastic-load-balancing/src/runtimeConfig.ts index 9be9aee05ffc..b47ee6838acb 100644 --- a/clients/client-elastic-load-balancing/src/runtimeConfig.ts +++ b/clients/client-elastic-load-balancing/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElasticLoadBalancingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElasticLoadBalancingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elastic-transcoder/src/ElasticTranscoderClient.ts b/clients/client-elastic-transcoder/src/ElasticTranscoderClient.ts index 09d4a52a8b28..3dcd625f9362 100644 --- a/clients/client-elastic-transcoder/src/ElasticTranscoderClient.ts +++ b/clients/client-elastic-transcoder/src/ElasticTranscoderClient.ts @@ -222,6 +222,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elastic-transcoder/src/runtimeConfig.ts b/clients/client-elastic-transcoder/src/runtimeConfig.ts index 8e98a1ff9777..d2515fd8d38e 100644 --- a/clients/client-elastic-transcoder/src/runtimeConfig.ts +++ b/clients/client-elastic-transcoder/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElasticTranscoderClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElasticTranscoderClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elasticache/src/ElastiCacheClient.ts b/clients/client-elasticache/src/ElastiCacheClient.ts index acfa5c747d98..9134e008199d 100644 --- a/clients/client-elasticache/src/ElastiCacheClient.ts +++ b/clients/client-elasticache/src/ElastiCacheClient.ts @@ -549,6 +549,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elasticache/src/runtimeConfig.ts b/clients/client-elasticache/src/runtimeConfig.ts index 214fda332f58..1f7c2d18695c 100644 --- a/clients/client-elasticache/src/runtimeConfig.ts +++ b/clients/client-elasticache/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElastiCacheClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElastiCacheClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-elasticsearch-service/src/ElasticsearchServiceClient.ts b/clients/client-elasticsearch-service/src/ElasticsearchServiceClient.ts index 8534fe16739e..6814d17612bf 100644 --- a/clients/client-elasticsearch-service/src/ElasticsearchServiceClient.ts +++ b/clients/client-elasticsearch-service/src/ElasticsearchServiceClient.ts @@ -423,6 +423,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-elasticsearch-service/src/runtimeConfig.ts b/clients/client-elasticsearch-service/src/runtimeConfig.ts index 142d430cf1f4..49715f1c4591 100644 --- a/clients/client-elasticsearch-service/src/runtimeConfig.ts +++ b/clients/client-elasticsearch-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ElasticsearchServiceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ElasticsearchServiceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-emr-containers/src/EMRContainersClient.ts b/clients/client-emr-containers/src/EMRContainersClient.ts index 7cac441b2c1a..9a8442fd4849 100644 --- a/clients/client-emr-containers/src/EMRContainersClient.ts +++ b/clients/client-emr-containers/src/EMRContainersClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-emr-containers/src/runtimeConfig.ts b/clients/client-emr-containers/src/runtimeConfig.ts index b9f5ab246a5d..570a46a698a7 100644 --- a/clients/client-emr-containers/src/runtimeConfig.ts +++ b/clients/client-emr-containers/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EMRContainersClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EMRContainersClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-emr-serverless/src/EMRServerlessClient.ts b/clients/client-emr-serverless/src/EMRServerlessClient.ts index 5a718e5184b8..e86e974f7dc3 100644 --- a/clients/client-emr-serverless/src/EMRServerlessClient.ts +++ b/clients/client-emr-serverless/src/EMRServerlessClient.ts @@ -219,6 +219,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-emr-serverless/src/runtimeConfig.ts b/clients/client-emr-serverless/src/runtimeConfig.ts index cd3b180054f8..f0a140813cd4 100644 --- a/clients/client-emr-serverless/src/runtimeConfig.ts +++ b/clients/client-emr-serverless/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EMRServerlessClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EMRServerlessClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-emr/src/EMRClient.ts b/clients/client-emr/src/EMRClient.ts index 5d9aefbc42a4..54c664912718 100644 --- a/clients/client-emr/src/EMRClient.ts +++ b/clients/client-emr/src/EMRClient.ts @@ -432,6 +432,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-emr/src/runtimeConfig.ts b/clients/client-emr/src/runtimeConfig.ts index eb91ac0de20a..f42dcc6e1bda 100644 --- a/clients/client-emr/src/runtimeConfig.ts +++ b/clients/client-emr/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EMRClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EMRClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-entityresolution/src/EntityResolutionClient.ts b/clients/client-entityresolution/src/EntityResolutionClient.ts index 1d2c6b88d371..b2f06ce3d726 100644 --- a/clients/client-entityresolution/src/EntityResolutionClient.ts +++ b/clients/client-entityresolution/src/EntityResolutionClient.ts @@ -327,6 +327,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-entityresolution/src/runtimeConfig.ts b/clients/client-entityresolution/src/runtimeConfig.ts index edb8271a0d94..e82240003be1 100644 --- a/clients/client-entityresolution/src/runtimeConfig.ts +++ b/clients/client-entityresolution/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EntityResolutionClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EntityResolutionClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-eventbridge/src/EventBridgeClient.ts b/clients/client-eventbridge/src/EventBridgeClient.ts index 02dc2dc62e2a..bd9d9ca38cbf 100644 --- a/clients/client-eventbridge/src/EventBridgeClient.ts +++ b/clients/client-eventbridge/src/EventBridgeClient.ts @@ -384,6 +384,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-eventbridge/src/runtimeConfig.ts b/clients/client-eventbridge/src/runtimeConfig.ts index 2a5784138e21..c77d3580908b 100644 --- a/clients/client-eventbridge/src/runtimeConfig.ts +++ b/clients/client-eventbridge/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EventBridgeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,20 +43,26 @@ export const getRuntimeConfig = (config: EventBridgeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS), + sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, profileConfig), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-evidently/src/EvidentlyClient.ts b/clients/client-evidently/src/EvidentlyClient.ts index 58042c4cd715..b1f5abc9b95c 100644 --- a/clients/client-evidently/src/EvidentlyClient.ts +++ b/clients/client-evidently/src/EvidentlyClient.ts @@ -294,6 +294,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-evidently/src/runtimeConfig.ts b/clients/client-evidently/src/runtimeConfig.ts index 6b50ed47d718..cd62b12a7fe0 100644 --- a/clients/client-evidently/src/runtimeConfig.ts +++ b/clients/client-evidently/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: EvidentlyClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: EvidentlyClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-finspace-data/src/FinspaceDataClient.ts b/clients/client-finspace-data/src/FinspaceDataClient.ts index 8c501a5bc953..b219926000ec 100644 --- a/clients/client-finspace-data/src/FinspaceDataClient.ts +++ b/clients/client-finspace-data/src/FinspaceDataClient.ts @@ -288,6 +288,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-finspace-data/src/runtimeConfig.ts b/clients/client-finspace-data/src/runtimeConfig.ts index 3e853c792550..c98aaf19fb90 100644 --- a/clients/client-finspace-data/src/runtimeConfig.ts +++ b/clients/client-finspace-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FinspaceDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FinspaceDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-finspace/src/FinspaceClient.ts b/clients/client-finspace/src/FinspaceClient.ts index 31430b26f5b3..44a63e1115eb 100644 --- a/clients/client-finspace/src/FinspaceClient.ts +++ b/clients/client-finspace/src/FinspaceClient.ts @@ -351,6 +351,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-finspace/src/runtimeConfig.ts b/clients/client-finspace/src/runtimeConfig.ts index 3c93bafc85ad..e59001e68ace 100644 --- a/clients/client-finspace/src/runtimeConfig.ts +++ b/clients/client-finspace/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FinspaceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FinspaceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-firehose/src/FirehoseClient.ts b/clients/client-firehose/src/FirehoseClient.ts index 1c33dd42d709..c1b1cf5e05ff 100644 --- a/clients/client-firehose/src/FirehoseClient.ts +++ b/clients/client-firehose/src/FirehoseClient.ts @@ -225,6 +225,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-firehose/src/runtimeConfig.ts b/clients/client-firehose/src/runtimeConfig.ts index 01b4dd661cff..7110e54811e3 100644 --- a/clients/client-firehose/src/runtimeConfig.ts +++ b/clients/client-firehose/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FirehoseClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FirehoseClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-fis/src/FisClient.ts b/clients/client-fis/src/FisClient.ts index ec24a4fad569..ef03b0da82a2 100644 --- a/clients/client-fis/src/FisClient.ts +++ b/clients/client-fis/src/FisClient.ts @@ -294,6 +294,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-fis/src/runtimeConfig.ts b/clients/client-fis/src/runtimeConfig.ts index 552092ef2669..1221964b9a1f 100644 --- a/clients/client-fis/src/runtimeConfig.ts +++ b/clients/client-fis/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FisClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FisClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-fms/src/FMSClient.ts b/clients/client-fms/src/FMSClient.ts index 4c4da4c5f21e..91e85f08fb01 100644 --- a/clients/client-fms/src/FMSClient.ts +++ b/clients/client-fms/src/FMSClient.ts @@ -354,6 +354,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-fms/src/runtimeConfig.ts b/clients/client-fms/src/runtimeConfig.ts index ca7ff502ecf0..81e357e4e95c 100644 --- a/clients/client-fms/src/runtimeConfig.ts +++ b/clients/client-fms/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FMSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FMSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-forecast/src/ForecastClient.ts b/clients/client-forecast/src/ForecastClient.ts index baa5a99dddde..45807bb2cbe8 100644 --- a/clients/client-forecast/src/ForecastClient.ts +++ b/clients/client-forecast/src/ForecastClient.ts @@ -462,6 +462,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-forecast/src/runtimeConfig.ts b/clients/client-forecast/src/runtimeConfig.ts index 63cf39ce584a..dcc781fa0a41 100644 --- a/clients/client-forecast/src/runtimeConfig.ts +++ b/clients/client-forecast/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ForecastClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ForecastClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-forecastquery/src/ForecastqueryClient.ts b/clients/client-forecastquery/src/ForecastqueryClient.ts index 2c91b1ce6e1b..bfcf79fc620d 100644 --- a/clients/client-forecastquery/src/ForecastqueryClient.ts +++ b/clients/client-forecastquery/src/ForecastqueryClient.ts @@ -170,6 +170,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-forecastquery/src/runtimeConfig.ts b/clients/client-forecastquery/src/runtimeConfig.ts index 208474dde087..0f0f8a715db5 100644 --- a/clients/client-forecastquery/src/runtimeConfig.ts +++ b/clients/client-forecastquery/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ForecastqueryClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ForecastqueryClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-frauddetector/src/FraudDetectorClient.ts b/clients/client-frauddetector/src/FraudDetectorClient.ts index 25a290e835af..5379c11dc5bb 100644 --- a/clients/client-frauddetector/src/FraudDetectorClient.ts +++ b/clients/client-frauddetector/src/FraudDetectorClient.ts @@ -453,6 +453,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-frauddetector/src/runtimeConfig.ts b/clients/client-frauddetector/src/runtimeConfig.ts index 75bde757a41a..9657edb1bf48 100644 --- a/clients/client-frauddetector/src/runtimeConfig.ts +++ b/clients/client-frauddetector/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FraudDetectorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FraudDetectorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-freetier/src/FreeTierClient.ts b/clients/client-freetier/src/FreeTierClient.ts index a54d6fabc3ed..b8bbced9d3f9 100644 --- a/clients/client-freetier/src/FreeTierClient.ts +++ b/clients/client-freetier/src/FreeTierClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-freetier/src/runtimeConfig.ts b/clients/client-freetier/src/runtimeConfig.ts index 8237b18337e4..a8b1017d5578 100644 --- a/clients/client-freetier/src/runtimeConfig.ts +++ b/clients/client-freetier/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FreeTierClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FreeTierClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-fsx/src/FSxClient.ts b/clients/client-fsx/src/FSxClient.ts index d29b96eaf1ab..4148b84351b4 100644 --- a/clients/client-fsx/src/FSxClient.ts +++ b/clients/client-fsx/src/FSxClient.ts @@ -372,6 +372,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-fsx/src/runtimeConfig.ts b/clients/client-fsx/src/runtimeConfig.ts index 12f4d606b0ee..f5d5b18950ea 100644 --- a/clients/client-fsx/src/runtimeConfig.ts +++ b/clients/client-fsx/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: FSxClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: FSxClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-gamelift/src/GameLiftClient.ts b/clients/client-gamelift/src/GameLiftClient.ts index 8917e7099faf..6ddb485654b9 100644 --- a/clients/client-gamelift/src/GameLiftClient.ts +++ b/clients/client-gamelift/src/GameLiftClient.ts @@ -729,6 +729,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-gamelift/src/runtimeConfig.ts b/clients/client-gamelift/src/runtimeConfig.ts index 70e5c3be6dc8..1243063a12d2 100644 --- a/clients/client-gamelift/src/runtimeConfig.ts +++ b/clients/client-gamelift/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GameLiftClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GameLiftClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-geo-maps/src/GeoMapsClient.ts b/clients/client-geo-maps/src/GeoMapsClient.ts index c9be01f922ba..3966d8e456f8 100644 --- a/clients/client-geo-maps/src/GeoMapsClient.ts +++ b/clients/client-geo-maps/src/GeoMapsClient.ts @@ -180,6 +180,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-geo-maps/src/runtimeConfig.ts b/clients/client-geo-maps/src/runtimeConfig.ts index add2135134e7..b723984d4b68 100644 --- a/clients/client-geo-maps/src/runtimeConfig.ts +++ b/clients/client-geo-maps/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GeoMapsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GeoMapsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-geo-places/src/GeoPlacesClient.ts b/clients/client-geo-places/src/GeoPlacesClient.ts index d0ae15feca75..0938a044fc73 100644 --- a/clients/client-geo-places/src/GeoPlacesClient.ts +++ b/clients/client-geo-places/src/GeoPlacesClient.ts @@ -186,6 +186,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-geo-places/src/runtimeConfig.ts b/clients/client-geo-places/src/runtimeConfig.ts index ae9397a90fb3..babccaae352e 100644 --- a/clients/client-geo-places/src/runtimeConfig.ts +++ b/clients/client-geo-places/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GeoPlacesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GeoPlacesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-geo-routes/src/GeoRoutesClient.ts b/clients/client-geo-routes/src/GeoRoutesClient.ts index 3144e509d212..a23cb69a33e2 100644 --- a/clients/client-geo-routes/src/GeoRoutesClient.ts +++ b/clients/client-geo-routes/src/GeoRoutesClient.ts @@ -183,6 +183,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-geo-routes/src/runtimeConfig.ts b/clients/client-geo-routes/src/runtimeConfig.ts index c68e24291040..4f9868fab081 100644 --- a/clients/client-geo-routes/src/runtimeConfig.ts +++ b/clients/client-geo-routes/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GeoRoutesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GeoRoutesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-glacier/src/GlacierClient.ts b/clients/client-glacier/src/GlacierClient.ts index 2d654227403c..910468c9a7cd 100644 --- a/clients/client-glacier/src/GlacierClient.ts +++ b/clients/client-glacier/src/GlacierClient.ts @@ -315,6 +315,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Function that returns body checksums. * @internal diff --git a/clients/client-glacier/src/runtimeConfig.ts b/clients/client-glacier/src/runtimeConfig.ts index 3a4a12051744..084d022b65bf 100644 --- a/clients/client-glacier/src/runtimeConfig.ts +++ b/clients/client-glacier/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: GlacierClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: GlacierClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-global-accelerator/src/GlobalAcceleratorClient.ts b/clients/client-global-accelerator/src/GlobalAcceleratorClient.ts index 65b34a117140..4a6c9911f658 100644 --- a/clients/client-global-accelerator/src/GlobalAcceleratorClient.ts +++ b/clients/client-global-accelerator/src/GlobalAcceleratorClient.ts @@ -447,6 +447,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-global-accelerator/src/runtimeConfig.ts b/clients/client-global-accelerator/src/runtimeConfig.ts index 6093c5cd9278..6ac1105fc30b 100644 --- a/clients/client-global-accelerator/src/runtimeConfig.ts +++ b/clients/client-global-accelerator/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GlobalAcceleratorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GlobalAcceleratorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-glue/src/GlueClient.ts b/clients/client-glue/src/GlueClient.ts index 88abab89313a..efdfbf4280e2 100644 --- a/clients/client-glue/src/GlueClient.ts +++ b/clients/client-glue/src/GlueClient.ts @@ -1242,6 +1242,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-glue/src/runtimeConfig.ts b/clients/client-glue/src/runtimeConfig.ts index b9a08a29435e..4ec531e59dcd 100644 --- a/clients/client-glue/src/runtimeConfig.ts +++ b/clients/client-glue/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GlueClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GlueClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-grafana/src/GrafanaClient.ts b/clients/client-grafana/src/GrafanaClient.ts index 41f81dd11138..311d3bb0eee1 100644 --- a/clients/client-grafana/src/GrafanaClient.ts +++ b/clients/client-grafana/src/GrafanaClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-grafana/src/runtimeConfig.ts b/clients/client-grafana/src/runtimeConfig.ts index 4cdefec05dbd..2a9f1a6cbadb 100644 --- a/clients/client-grafana/src/runtimeConfig.ts +++ b/clients/client-grafana/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GrafanaClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GrafanaClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-greengrass/src/GreengrassClient.ts b/clients/client-greengrass/src/GreengrassClient.ts index 5440a5f2d345..8482581cca51 100644 --- a/clients/client-greengrass/src/GreengrassClient.ts +++ b/clients/client-greengrass/src/GreengrassClient.ts @@ -669,6 +669,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-greengrass/src/runtimeConfig.ts b/clients/client-greengrass/src/runtimeConfig.ts index b3eeecbc1b03..bc73e96e3cbf 100644 --- a/clients/client-greengrass/src/runtimeConfig.ts +++ b/clients/client-greengrass/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GreengrassClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GreengrassClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-greengrassv2/src/GreengrassV2Client.ts b/clients/client-greengrassv2/src/GreengrassV2Client.ts index cfbbcfa8304c..b1c205b3c1ca 100644 --- a/clients/client-greengrassv2/src/GreengrassV2Client.ts +++ b/clients/client-greengrassv2/src/GreengrassV2Client.ts @@ -297,6 +297,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-greengrassv2/src/runtimeConfig.ts b/clients/client-greengrassv2/src/runtimeConfig.ts index 14f4472e7fd2..c05826c858a5 100644 --- a/clients/client-greengrassv2/src/runtimeConfig.ts +++ b/clients/client-greengrassv2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GreengrassV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GreengrassV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-groundstation/src/GroundStationClient.ts b/clients/client-groundstation/src/GroundStationClient.ts index f2da35669d96..efeb901448ef 100644 --- a/clients/client-groundstation/src/GroundStationClient.ts +++ b/clients/client-groundstation/src/GroundStationClient.ts @@ -294,6 +294,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-groundstation/src/runtimeConfig.ts b/clients/client-groundstation/src/runtimeConfig.ts index 131941ee184c..42ec53d0ff2e 100644 --- a/clients/client-groundstation/src/runtimeConfig.ts +++ b/clients/client-groundstation/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GroundStationClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GroundStationClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-guardduty/src/GuardDutyClient.ts b/clients/client-guardduty/src/GuardDutyClient.ts index 1699bfd5637c..82dcf2103758 100644 --- a/clients/client-guardduty/src/GuardDutyClient.ts +++ b/clients/client-guardduty/src/GuardDutyClient.ts @@ -501,6 +501,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-guardduty/src/runtimeConfig.ts b/clients/client-guardduty/src/runtimeConfig.ts index e656682929ea..d3af6b4ea038 100644 --- a/clients/client-guardduty/src/runtimeConfig.ts +++ b/clients/client-guardduty/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: GuardDutyClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: GuardDutyClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-health/src/HealthClient.ts b/clients/client-health/src/HealthClient.ts index ad0032c2355e..0c04c11ad0ad 100644 --- a/clients/client-health/src/HealthClient.ts +++ b/clients/client-health/src/HealthClient.ts @@ -243,6 +243,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-health/src/runtimeConfig.ts b/clients/client-health/src/runtimeConfig.ts index 0166cee88e6a..3d1afe8cbe7f 100644 --- a/clients/client-health/src/runtimeConfig.ts +++ b/clients/client-health/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: HealthClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: HealthClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-healthlake/src/HealthLakeClient.ts b/clients/client-healthlake/src/HealthLakeClient.ts index 2ad534337494..3bf3ebbaf923 100644 --- a/clients/client-healthlake/src/HealthLakeClient.ts +++ b/clients/client-healthlake/src/HealthLakeClient.ts @@ -222,6 +222,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-healthlake/src/runtimeConfig.ts b/clients/client-healthlake/src/runtimeConfig.ts index 867711b0db71..0727db9b0546 100644 --- a/clients/client-healthlake/src/runtimeConfig.ts +++ b/clients/client-healthlake/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: HealthLakeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: HealthLakeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iam/src/IAMClient.ts b/clients/client-iam/src/IAMClient.ts index eaa3a6343018..332c49ce21eb 100644 --- a/clients/client-iam/src/IAMClient.ts +++ b/clients/client-iam/src/IAMClient.ts @@ -897,6 +897,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iam/src/runtimeConfig.ts b/clients/client-iam/src/runtimeConfig.ts index c591597c0168..82d17cfd675b 100644 --- a/clients/client-iam/src/runtimeConfig.ts +++ b/clients/client-iam/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IAMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IAMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-identitystore/src/IdentitystoreClient.ts b/clients/client-identitystore/src/IdentitystoreClient.ts index 708d346c6a0b..0564658efcb7 100644 --- a/clients/client-identitystore/src/IdentitystoreClient.ts +++ b/clients/client-identitystore/src/IdentitystoreClient.ts @@ -240,6 +240,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-identitystore/src/runtimeConfig.ts b/clients/client-identitystore/src/runtimeConfig.ts index 87bc7b7b424c..a110f63312fb 100644 --- a/clients/client-identitystore/src/runtimeConfig.ts +++ b/clients/client-identitystore/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IdentitystoreClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IdentitystoreClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-imagebuilder/src/ImagebuilderClient.ts b/clients/client-imagebuilder/src/ImagebuilderClient.ts index c8db077c116f..d44c50f4089d 100644 --- a/clients/client-imagebuilder/src/ImagebuilderClient.ts +++ b/clients/client-imagebuilder/src/ImagebuilderClient.ts @@ -522,6 +522,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-imagebuilder/src/runtimeConfig.ts b/clients/client-imagebuilder/src/runtimeConfig.ts index 6f2017f02260..c861d10f4287 100644 --- a/clients/client-imagebuilder/src/runtimeConfig.ts +++ b/clients/client-imagebuilder/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ImagebuilderClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ImagebuilderClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-inspector-scan/src/InspectorScanClient.ts b/clients/client-inspector-scan/src/InspectorScanClient.ts index ad873387e4f1..7744518b5c20 100644 --- a/clients/client-inspector-scan/src/InspectorScanClient.ts +++ b/clients/client-inspector-scan/src/InspectorScanClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-inspector-scan/src/runtimeConfig.ts b/clients/client-inspector-scan/src/runtimeConfig.ts index ffec5736dea8..fff0a3b46977 100644 --- a/clients/client-inspector-scan/src/runtimeConfig.ts +++ b/clients/client-inspector-scan/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: InspectorScanClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: InspectorScanClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-inspector/src/InspectorClient.ts b/clients/client-inspector/src/InspectorClient.ts index f0118b70d880..6c32c5ea3659 100644 --- a/clients/client-inspector/src/InspectorClient.ts +++ b/clients/client-inspector/src/InspectorClient.ts @@ -354,6 +354,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-inspector/src/runtimeConfig.ts b/clients/client-inspector/src/runtimeConfig.ts index 0bd659af65e5..5545a09dc9ce 100644 --- a/clients/client-inspector/src/runtimeConfig.ts +++ b/clients/client-inspector/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: InspectorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: InspectorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-inspector2/src/Inspector2Client.ts b/clients/client-inspector2/src/Inspector2Client.ts index 13bc07de87d0..95877f494bed 100644 --- a/clients/client-inspector2/src/Inspector2Client.ts +++ b/clients/client-inspector2/src/Inspector2Client.ts @@ -444,6 +444,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-inspector2/src/runtimeConfig.ts b/clients/client-inspector2/src/runtimeConfig.ts index f99b6eaa46a4..8ab524d31665 100644 --- a/clients/client-inspector2/src/runtimeConfig.ts +++ b/clients/client-inspector2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Inspector2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Inspector2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-internetmonitor/src/InternetMonitorClient.ts b/clients/client-internetmonitor/src/InternetMonitorClient.ts index ea0cfde92157..3491dc699178 100644 --- a/clients/client-internetmonitor/src/InternetMonitorClient.ts +++ b/clients/client-internetmonitor/src/InternetMonitorClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-internetmonitor/src/runtimeConfig.ts b/clients/client-internetmonitor/src/runtimeConfig.ts index d7db442d0b7d..34b926aa931c 100644 --- a/clients/client-internetmonitor/src/runtimeConfig.ts +++ b/clients/client-internetmonitor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: InternetMonitorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: InternetMonitorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-invoicing/src/InvoicingClient.ts b/clients/client-invoicing/src/InvoicingClient.ts index 282b882ef8fc..4042feb84b5d 100644 --- a/clients/client-invoicing/src/InvoicingClient.ts +++ b/clients/client-invoicing/src/InvoicingClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-invoicing/src/runtimeConfig.ts b/clients/client-invoicing/src/runtimeConfig.ts index 3b33a35f392a..3958258aad73 100644 --- a/clients/client-invoicing/src/runtimeConfig.ts +++ b/clients/client-invoicing/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: InvoicingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: InvoicingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-1click-devices-service/src/IoT1ClickDevicesServiceClient.ts b/clients/client-iot-1click-devices-service/src/IoT1ClickDevicesServiceClient.ts index 8785c60ed7e4..bef1ba46d274 100644 --- a/clients/client-iot-1click-devices-service/src/IoT1ClickDevicesServiceClient.ts +++ b/clients/client-iot-1click-devices-service/src/IoT1ClickDevicesServiceClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-1click-devices-service/src/runtimeConfig.ts b/clients/client-iot-1click-devices-service/src/runtimeConfig.ts index 99bdf801aca2..ddfee0482b18 100644 --- a/clients/client-iot-1click-devices-service/src/runtimeConfig.ts +++ b/clients/client-iot-1click-devices-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoT1ClickDevicesServiceClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoT1ClickDevicesServiceClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-1click-projects/src/IoT1ClickProjectsClient.ts b/clients/client-iot-1click-projects/src/IoT1ClickProjectsClient.ts index f900a6962089..c444a798f93e 100644 --- a/clients/client-iot-1click-projects/src/IoT1ClickProjectsClient.ts +++ b/clients/client-iot-1click-projects/src/IoT1ClickProjectsClient.ts @@ -225,6 +225,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-1click-projects/src/runtimeConfig.ts b/clients/client-iot-1click-projects/src/runtimeConfig.ts index a77f8db8a23c..3f7aed76b1e8 100644 --- a/clients/client-iot-1click-projects/src/runtimeConfig.ts +++ b/clients/client-iot-1click-projects/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoT1ClickProjectsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoT1ClickProjectsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-data-plane/src/IoTDataPlaneClient.ts b/clients/client-iot-data-plane/src/IoTDataPlaneClient.ts index 8ec056119d72..3cffd7bdbfe1 100644 --- a/clients/client-iot-data-plane/src/IoTDataPlaneClient.ts +++ b/clients/client-iot-data-plane/src/IoTDataPlaneClient.ts @@ -192,6 +192,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-data-plane/src/runtimeConfig.ts b/clients/client-iot-data-plane/src/runtimeConfig.ts index 2b8b5404bd64..8c079bb976d1 100644 --- a/clients/client-iot-data-plane/src/runtimeConfig.ts +++ b/clients/client-iot-data-plane/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTDataPlaneClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTDataPlaneClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-events-data/src/IoTEventsDataClient.ts b/clients/client-iot-events-data/src/IoTEventsDataClient.ts index 061601372f84..dc86034fa3b5 100644 --- a/clients/client-iot-events-data/src/IoTEventsDataClient.ts +++ b/clients/client-iot-events-data/src/IoTEventsDataClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-events-data/src/runtimeConfig.ts b/clients/client-iot-events-data/src/runtimeConfig.ts index aa15c640612b..806993987360 100644 --- a/clients/client-iot-events-data/src/runtimeConfig.ts +++ b/clients/client-iot-events-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTEventsDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTEventsDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-events/src/IoTEventsClient.ts b/clients/client-iot-events/src/IoTEventsClient.ts index 79c3951a6610..5b63f585a956 100644 --- a/clients/client-iot-events/src/IoTEventsClient.ts +++ b/clients/client-iot-events/src/IoTEventsClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-events/src/runtimeConfig.ts b/clients/client-iot-events/src/runtimeConfig.ts index 14a927766eef..432483c6fc04 100644 --- a/clients/client-iot-events/src/runtimeConfig.ts +++ b/clients/client-iot-events/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTEventsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTEventsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts b/clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts index 423622559179..55c57c98a0b3 100644 --- a/clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts +++ b/clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts @@ -192,6 +192,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts b/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts index f8346db38463..65100edb24ef 100644 --- a/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts +++ b/clients/client-iot-jobs-data-plane/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTJobsDataPlaneClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTJobsDataPlaneClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot-wireless/src/IoTWirelessClient.ts b/clients/client-iot-wireless/src/IoTWirelessClient.ts index 08865c2244b2..82e35e9466c1 100644 --- a/clients/client-iot-wireless/src/IoTWirelessClient.ts +++ b/clients/client-iot-wireless/src/IoTWirelessClient.ts @@ -759,6 +759,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot-wireless/src/runtimeConfig.ts b/clients/client-iot-wireless/src/runtimeConfig.ts index ba49dbe1e9e8..10709af7062b 100644 --- a/clients/client-iot-wireless/src/runtimeConfig.ts +++ b/clients/client-iot-wireless/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTWirelessClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTWirelessClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iot/src/IoTClient.ts b/clients/client-iot/src/IoTClient.ts index c71c6dd951ee..80e1bae507bd 100644 --- a/clients/client-iot/src/IoTClient.ts +++ b/clients/client-iot/src/IoTClient.ts @@ -1446,6 +1446,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iot/src/runtimeConfig.ts b/clients/client-iot/src/runtimeConfig.ts index a5101fd267f5..b3bea08f404c 100644 --- a/clients/client-iot/src/runtimeConfig.ts +++ b/clients/client-iot/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotanalytics/src/IoTAnalyticsClient.ts b/clients/client-iotanalytics/src/IoTAnalyticsClient.ts index 6e0e64ea3b15..757eba897e54 100644 --- a/clients/client-iotanalytics/src/IoTAnalyticsClient.ts +++ b/clients/client-iotanalytics/src/IoTAnalyticsClient.ts @@ -291,6 +291,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotanalytics/src/runtimeConfig.ts b/clients/client-iotanalytics/src/runtimeConfig.ts index 42be3002e858..bb1af77e4010 100644 --- a/clients/client-iotanalytics/src/runtimeConfig.ts +++ b/clients/client-iotanalytics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTAnalyticsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTAnalyticsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotdeviceadvisor/src/IotDeviceAdvisorClient.ts b/clients/client-iotdeviceadvisor/src/IotDeviceAdvisorClient.ts index 59fe56ec2f3f..9305fa5d6120 100644 --- a/clients/client-iotdeviceadvisor/src/IotDeviceAdvisorClient.ts +++ b/clients/client-iotdeviceadvisor/src/IotDeviceAdvisorClient.ts @@ -222,6 +222,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotdeviceadvisor/src/runtimeConfig.ts b/clients/client-iotdeviceadvisor/src/runtimeConfig.ts index 8f0711f4f9ff..6a609b4b6f71 100644 --- a/clients/client-iotdeviceadvisor/src/runtimeConfig.ts +++ b/clients/client-iotdeviceadvisor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IotDeviceAdvisorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IotDeviceAdvisorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotfleethub/src/IoTFleetHubClient.ts b/clients/client-iotfleethub/src/IoTFleetHubClient.ts index c629506b7940..80a2a218f87c 100644 --- a/clients/client-iotfleethub/src/IoTFleetHubClient.ts +++ b/clients/client-iotfleethub/src/IoTFleetHubClient.ts @@ -195,6 +195,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotfleethub/src/runtimeConfig.ts b/clients/client-iotfleethub/src/runtimeConfig.ts index 542a5c98889a..df4291a0f010 100644 --- a/clients/client-iotfleethub/src/runtimeConfig.ts +++ b/clients/client-iotfleethub/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTFleetHubClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTFleetHubClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotfleetwise/src/IoTFleetWiseClient.ts b/clients/client-iotfleetwise/src/IoTFleetWiseClient.ts index 042ec8f1d74d..155920287af9 100644 --- a/clients/client-iotfleetwise/src/IoTFleetWiseClient.ts +++ b/clients/client-iotfleetwise/src/IoTFleetWiseClient.ts @@ -417,6 +417,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotfleetwise/src/runtimeConfig.ts b/clients/client-iotfleetwise/src/runtimeConfig.ts index 288bca1f960f..507629feac99 100644 --- a/clients/client-iotfleetwise/src/runtimeConfig.ts +++ b/clients/client-iotfleetwise/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTFleetWiseClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTFleetWiseClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotsecuretunneling/src/IoTSecureTunnelingClient.ts b/clients/client-iotsecuretunneling/src/IoTSecureTunnelingClient.ts index e76963453d6d..7508166b151b 100644 --- a/clients/client-iotsecuretunneling/src/IoTSecureTunnelingClient.ts +++ b/clients/client-iotsecuretunneling/src/IoTSecureTunnelingClient.ts @@ -195,6 +195,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotsecuretunneling/src/runtimeConfig.ts b/clients/client-iotsecuretunneling/src/runtimeConfig.ts index d3f5b7ad0c5a..5a8ec0911993 100644 --- a/clients/client-iotsecuretunneling/src/runtimeConfig.ts +++ b/clients/client-iotsecuretunneling/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTSecureTunnelingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTSecureTunnelingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotsitewise/src/IoTSiteWiseClient.ts b/clients/client-iotsitewise/src/IoTSiteWiseClient.ts index ad7c890415c5..01eae83ce3bc 100644 --- a/clients/client-iotsitewise/src/IoTSiteWiseClient.ts +++ b/clients/client-iotsitewise/src/IoTSiteWiseClient.ts @@ -549,6 +549,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotsitewise/src/runtimeConfig.ts b/clients/client-iotsitewise/src/runtimeConfig.ts index 9a0e788f02e0..8af17a269af5 100644 --- a/clients/client-iotsitewise/src/runtimeConfig.ts +++ b/clients/client-iotsitewise/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: IoTSiteWiseClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: IoTSiteWiseClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iotthingsgraph/src/IoTThingsGraphClient.ts b/clients/client-iotthingsgraph/src/IoTThingsGraphClient.ts index cc106fb5d6ba..c0359c5c2b43 100644 --- a/clients/client-iotthingsgraph/src/IoTThingsGraphClient.ts +++ b/clients/client-iotthingsgraph/src/IoTThingsGraphClient.ts @@ -333,6 +333,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iotthingsgraph/src/runtimeConfig.ts b/clients/client-iotthingsgraph/src/runtimeConfig.ts index 5071e7ce301c..143477d04697 100644 --- a/clients/client-iotthingsgraph/src/runtimeConfig.ts +++ b/clients/client-iotthingsgraph/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTThingsGraphClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTThingsGraphClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-iottwinmaker/src/IoTTwinMakerClient.ts b/clients/client-iottwinmaker/src/IoTTwinMakerClient.ts index 8a086754c4da..5778f8d7cdc7 100644 --- a/clients/client-iottwinmaker/src/IoTTwinMakerClient.ts +++ b/clients/client-iottwinmaker/src/IoTTwinMakerClient.ts @@ -315,6 +315,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-iottwinmaker/src/runtimeConfig.ts b/clients/client-iottwinmaker/src/runtimeConfig.ts index ea9c38ec5dcb..ebbea0897cb1 100644 --- a/clients/client-iottwinmaker/src/runtimeConfig.ts +++ b/clients/client-iottwinmaker/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IoTTwinMakerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IoTTwinMakerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ivs-realtime/src/IVSRealTimeClient.ts b/clients/client-ivs-realtime/src/IVSRealTimeClient.ts index d314333bb3db..b96ff2761e1c 100644 --- a/clients/client-ivs-realtime/src/IVSRealTimeClient.ts +++ b/clients/client-ivs-realtime/src/IVSRealTimeClient.ts @@ -324,6 +324,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ivs-realtime/src/runtimeConfig.ts b/clients/client-ivs-realtime/src/runtimeConfig.ts index bcbe9ef54969..fe6a7bfde447 100644 --- a/clients/client-ivs-realtime/src/runtimeConfig.ts +++ b/clients/client-ivs-realtime/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IVSRealTimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IVSRealTimeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ivs/src/IvsClient.ts b/clients/client-ivs/src/IvsClient.ts index 0303de5b8567..95ebeb75dccd 100644 --- a/clients/client-ivs/src/IvsClient.ts +++ b/clients/client-ivs/src/IvsClient.ts @@ -315,6 +315,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ivs/src/runtimeConfig.ts b/clients/client-ivs/src/runtimeConfig.ts index a9833187fda3..dfb8d606c349 100644 --- a/clients/client-ivs/src/runtimeConfig.ts +++ b/clients/client-ivs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IvsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IvsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ivschat/src/IvschatClient.ts b/clients/client-ivschat/src/IvschatClient.ts index 0b142d784b1a..ae367df63e31 100644 --- a/clients/client-ivschat/src/IvschatClient.ts +++ b/clients/client-ivschat/src/IvschatClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ivschat/src/runtimeConfig.ts b/clients/client-ivschat/src/runtimeConfig.ts index 3812e6b9e10a..a7fdc11ada9f 100644 --- a/clients/client-ivschat/src/runtimeConfig.ts +++ b/clients/client-ivschat/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: IvschatClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: IvschatClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kafka/src/KafkaClient.ts b/clients/client-kafka/src/KafkaClient.ts index dda287b635e6..cbc06cc3a023 100644 --- a/clients/client-kafka/src/KafkaClient.ts +++ b/clients/client-kafka/src/KafkaClient.ts @@ -396,6 +396,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kafka/src/runtimeConfig.ts b/clients/client-kafka/src/runtimeConfig.ts index aa7c0808f79f..35b68ab2113e 100644 --- a/clients/client-kafka/src/runtimeConfig.ts +++ b/clients/client-kafka/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KafkaClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KafkaClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kafkaconnect/src/KafkaConnectClient.ts b/clients/client-kafkaconnect/src/KafkaConnectClient.ts index daa972379182..c938a83b8c7c 100644 --- a/clients/client-kafkaconnect/src/KafkaConnectClient.ts +++ b/clients/client-kafkaconnect/src/KafkaConnectClient.ts @@ -231,6 +231,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kafkaconnect/src/runtimeConfig.ts b/clients/client-kafkaconnect/src/runtimeConfig.ts index 9304b9d78757..45c66e53397d 100644 --- a/clients/client-kafkaconnect/src/runtimeConfig.ts +++ b/clients/client-kafkaconnect/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KafkaConnectClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KafkaConnectClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kendra-ranking/src/KendraRankingClient.ts b/clients/client-kendra-ranking/src/KendraRankingClient.ts index 9f1bcbd93e51..5e868aec6b1d 100644 --- a/clients/client-kendra-ranking/src/KendraRankingClient.ts +++ b/clients/client-kendra-ranking/src/KendraRankingClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kendra-ranking/src/runtimeConfig.ts b/clients/client-kendra-ranking/src/runtimeConfig.ts index a07e5cbb3e7e..d04a53083271 100644 --- a/clients/client-kendra-ranking/src/runtimeConfig.ts +++ b/clients/client-kendra-ranking/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KendraRankingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KendraRankingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kendra/src/KendraClient.ts b/clients/client-kendra/src/KendraClient.ts index 7113b24aa411..e877c1437d14 100644 --- a/clients/client-kendra/src/KendraClient.ts +++ b/clients/client-kendra/src/KendraClient.ts @@ -465,6 +465,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kendra/src/runtimeConfig.ts b/clients/client-kendra/src/runtimeConfig.ts index 0a3196a18375..1e25b9a1bd9c 100644 --- a/clients/client-kendra/src/runtimeConfig.ts +++ b/clients/client-kendra/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KendraClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KendraClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-keyspaces/src/KeyspacesClient.ts b/clients/client-keyspaces/src/KeyspacesClient.ts index a88a02ebff3c..e0ceaf8f3f1d 100644 --- a/clients/client-keyspaces/src/KeyspacesClient.ts +++ b/clients/client-keyspaces/src/KeyspacesClient.ts @@ -228,6 +228,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-keyspaces/src/runtimeConfig.ts b/clients/client-keyspaces/src/runtimeConfig.ts index 352e1a9aa1c8..8edf4ecc9792 100644 --- a/clients/client-keyspaces/src/runtimeConfig.ts +++ b/clients/client-keyspaces/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KeyspacesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KeyspacesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2Client.ts b/clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2Client.ts index 5f52de5b5f75..cd33fcb1f9dc 100644 --- a/clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2Client.ts +++ b/clients/client-kinesis-analytics-v2/src/KinesisAnalyticsV2Client.ts @@ -339,6 +339,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts b/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts index e81fcfe31019..f3b9207356e6 100644 --- a/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts +++ b/clients/client-kinesis-analytics-v2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisAnalyticsV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisAnalyticsV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-analytics/src/KinesisAnalyticsClient.ts b/clients/client-kinesis-analytics/src/KinesisAnalyticsClient.ts index 6e2c9a2ba57a..84ccf431e942 100644 --- a/clients/client-kinesis-analytics/src/KinesisAnalyticsClient.ts +++ b/clients/client-kinesis-analytics/src/KinesisAnalyticsClient.ts @@ -261,6 +261,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-analytics/src/runtimeConfig.ts b/clients/client-kinesis-analytics/src/runtimeConfig.ts index 6395a5577dc7..d9a19b48aeb8 100644 --- a/clients/client-kinesis-analytics/src/runtimeConfig.ts +++ b/clients/client-kinesis-analytics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisAnalyticsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisAnalyticsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMediaClient.ts b/clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMediaClient.ts index 51259eebd0a5..aeef0067a2a7 100644 --- a/clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMediaClient.ts +++ b/clients/client-kinesis-video-archived-media/src/KinesisVideoArchivedMediaClient.ts @@ -193,6 +193,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts b/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts index 44bac3be2f4a..c485852b90cc 100644 --- a/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts +++ b/clients/client-kinesis-video-archived-media/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisVideoArchivedMediaClientConfig) const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisVideoArchivedMediaClientConfig) defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-video-media/src/KinesisVideoMediaClient.ts b/clients/client-kinesis-video-media/src/KinesisVideoMediaClient.ts index cec958e60818..8681f3944454 100644 --- a/clients/client-kinesis-video-media/src/KinesisVideoMediaClient.ts +++ b/clients/client-kinesis-video-media/src/KinesisVideoMediaClient.ts @@ -167,6 +167,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-video-media/src/runtimeConfig.ts b/clients/client-kinesis-video-media/src/runtimeConfig.ts index 247717fc8479..ee53171c5f56 100644 --- a/clients/client-kinesis-video-media/src/runtimeConfig.ts +++ b/clients/client-kinesis-video-media/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisVideoMediaClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisVideoMediaClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-video-signaling/src/KinesisVideoSignalingClient.ts b/clients/client-kinesis-video-signaling/src/KinesisVideoSignalingClient.ts index 1982b7fefc9f..171edc60e0a4 100644 --- a/clients/client-kinesis-video-signaling/src/KinesisVideoSignalingClient.ts +++ b/clients/client-kinesis-video-signaling/src/KinesisVideoSignalingClient.ts @@ -176,6 +176,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-video-signaling/src/runtimeConfig.ts b/clients/client-kinesis-video-signaling/src/runtimeConfig.ts index 26bce5c430ae..e4152cbb704d 100644 --- a/clients/client-kinesis-video-signaling/src/runtimeConfig.ts +++ b/clients/client-kinesis-video-signaling/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisVideoSignalingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisVideoSignalingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-video-webrtc-storage/src/KinesisVideoWebRTCStorageClient.ts b/clients/client-kinesis-video-webrtc-storage/src/KinesisVideoWebRTCStorageClient.ts index ce61233bb766..99b371f64c8e 100644 --- a/clients/client-kinesis-video-webrtc-storage/src/KinesisVideoWebRTCStorageClient.ts +++ b/clients/client-kinesis-video-webrtc-storage/src/KinesisVideoWebRTCStorageClient.ts @@ -170,6 +170,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-video-webrtc-storage/src/runtimeConfig.ts b/clients/client-kinesis-video-webrtc-storage/src/runtimeConfig.ts index 5639fdff323d..2a1103ae501f 100644 --- a/clients/client-kinesis-video-webrtc-storage/src/runtimeConfig.ts +++ b/clients/client-kinesis-video-webrtc-storage/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisVideoWebRTCStorageClientConfig) const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisVideoWebRTCStorageClientConfig) defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis-video/src/KinesisVideoClient.ts b/clients/client-kinesis-video/src/KinesisVideoClient.ts index 43947ec1e3e3..40e046e4e410 100644 --- a/clients/client-kinesis-video/src/KinesisVideoClient.ts +++ b/clients/client-kinesis-video/src/KinesisVideoClient.ts @@ -312,6 +312,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis-video/src/runtimeConfig.ts b/clients/client-kinesis-video/src/runtimeConfig.ts index b21490ff5286..cc08f9b8c83e 100644 --- a/clients/client-kinesis-video/src/runtimeConfig.ts +++ b/clients/client-kinesis-video/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KinesisVideoClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KinesisVideoClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kinesis/src/KinesisClient.ts b/clients/client-kinesis/src/KinesisClient.ts index a20694675cdd..a22829a36278 100644 --- a/clients/client-kinesis/src/KinesisClient.ts +++ b/clients/client-kinesis/src/KinesisClient.ts @@ -306,6 +306,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kinesis/src/runtimeConfig.ts b/clients/client-kinesis/src/runtimeConfig.ts index baa7af12aa46..fbec80f4eab0 100644 --- a/clients/client-kinesis/src/runtimeConfig.ts +++ b/clients/client-kinesis/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: KinesisClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,21 +45,27 @@ export const getRuntimeConfig = (config: KinesisClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create( config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true })) ), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-kms/src/KMSClient.ts b/clients/client-kms/src/KMSClient.ts index 6a813000ef01..7045cb8af331 100644 --- a/clients/client-kms/src/KMSClient.ts +++ b/clients/client-kms/src/KMSClient.ts @@ -372,6 +372,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-kms/src/runtimeConfig.ts b/clients/client-kms/src/runtimeConfig.ts index 89b6169233f9..6a2bacb6faa5 100644 --- a/clients/client-kms/src/runtimeConfig.ts +++ b/clients/client-kms/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: KMSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: KMSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lakeformation/src/LakeFormationClient.ts b/clients/client-lakeformation/src/LakeFormationClient.ts index 0e9b8a60f2cc..77595a302f27 100644 --- a/clients/client-lakeformation/src/LakeFormationClient.ts +++ b/clients/client-lakeformation/src/LakeFormationClient.ts @@ -442,6 +442,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lakeformation/src/runtimeConfig.ts b/clients/client-lakeformation/src/runtimeConfig.ts index 613af448a485..d02f913d7711 100644 --- a/clients/client-lakeformation/src/runtimeConfig.ts +++ b/clients/client-lakeformation/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LakeFormationClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LakeFormationClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lambda/src/LambdaClient.ts b/clients/client-lambda/src/LambdaClient.ts index fd58a8a1d3b6..4c5ab2fe8f03 100644 --- a/clients/client-lambda/src/LambdaClient.ts +++ b/clients/client-lambda/src/LambdaClient.ts @@ -507,6 +507,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lambda/src/runtimeConfig.ts b/clients/client-lambda/src/runtimeConfig.ts index 9fb79d9fa0bc..76397778c88b 100644 --- a/clients/client-lambda/src/runtimeConfig.ts +++ b/clients/client-lambda/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: LambdaClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: LambdaClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-launch-wizard/src/LaunchWizardClient.ts b/clients/client-launch-wizard/src/LaunchWizardClient.ts index e8388c1dd54b..06fd7c2bcf8b 100644 --- a/clients/client-launch-wizard/src/LaunchWizardClient.ts +++ b/clients/client-launch-wizard/src/LaunchWizardClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-launch-wizard/src/runtimeConfig.ts b/clients/client-launch-wizard/src/runtimeConfig.ts index 4ff0b0846e62..a598b51b9852 100644 --- a/clients/client-launch-wizard/src/runtimeConfig.ts +++ b/clients/client-launch-wizard/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LaunchWizardClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LaunchWizardClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lex-model-building-service/src/LexModelBuildingServiceClient.ts b/clients/client-lex-model-building-service/src/LexModelBuildingServiceClient.ts index 268713e01e40..6c965096111d 100644 --- a/clients/client-lex-model-building-service/src/LexModelBuildingServiceClient.ts +++ b/clients/client-lex-model-building-service/src/LexModelBuildingServiceClient.ts @@ -321,6 +321,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lex-model-building-service/src/runtimeConfig.ts b/clients/client-lex-model-building-service/src/runtimeConfig.ts index ca07fa1446bf..39938b0397e0 100644 --- a/clients/client-lex-model-building-service/src/runtimeConfig.ts +++ b/clients/client-lex-model-building-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LexModelBuildingServiceClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LexModelBuildingServiceClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lex-models-v2/src/LexModelsV2Client.ts b/clients/client-lex-models-v2/src/LexModelsV2Client.ts index 21c844a7d10a..269bf96acfa7 100644 --- a/clients/client-lex-models-v2/src/LexModelsV2Client.ts +++ b/clients/client-lex-models-v2/src/LexModelsV2Client.ts @@ -585,6 +585,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lex-models-v2/src/runtimeConfig.ts b/clients/client-lex-models-v2/src/runtimeConfig.ts index ad6a73e63173..dfc1f2321a01 100644 --- a/clients/client-lex-models-v2/src/runtimeConfig.ts +++ b/clients/client-lex-models-v2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LexModelsV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LexModelsV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lex-runtime-service/src/LexRuntimeServiceClient.ts b/clients/client-lex-runtime-service/src/LexRuntimeServiceClient.ts index 624862212f86..37054e73aa45 100644 --- a/clients/client-lex-runtime-service/src/LexRuntimeServiceClient.ts +++ b/clients/client-lex-runtime-service/src/LexRuntimeServiceClient.ts @@ -181,6 +181,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lex-runtime-service/src/runtimeConfig.ts b/clients/client-lex-runtime-service/src/runtimeConfig.ts index f664e8ab663e..3b6e14018b30 100644 --- a/clients/client-lex-runtime-service/src/runtimeConfig.ts +++ b/clients/client-lex-runtime-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LexRuntimeServiceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LexRuntimeServiceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lex-runtime-v2/src/LexRuntimeV2Client.ts b/clients/client-lex-runtime-v2/src/LexRuntimeV2Client.ts index 561f8467100a..6c09bc8fbe91 100644 --- a/clients/client-lex-runtime-v2/src/LexRuntimeV2Client.ts +++ b/clients/client-lex-runtime-v2/src/LexRuntimeV2Client.ts @@ -196,6 +196,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lex-runtime-v2/src/runtimeConfig.ts b/clients/client-lex-runtime-v2/src/runtimeConfig.ts index 315d551aa25a..0bf95afffb95 100644 --- a/clients/client-lex-runtime-v2/src/runtimeConfig.ts +++ b/clients/client-lex-runtime-v2/src/runtimeConfig.ts @@ -34,6 +34,7 @@ export const getRuntimeConfig = (config: LexRuntimeV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -46,21 +47,27 @@ export const getRuntimeConfig = (config: LexRuntimeV2ClientConfig) => { createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create( config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true })) ), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-license-manager-linux-subscriptions/src/LicenseManagerLinuxSubscriptionsClient.ts b/clients/client-license-manager-linux-subscriptions/src/LicenseManagerLinuxSubscriptionsClient.ts index 03279358e461..cfde6029bb75 100644 --- a/clients/client-license-manager-linux-subscriptions/src/LicenseManagerLinuxSubscriptionsClient.ts +++ b/clients/client-license-manager-linux-subscriptions/src/LicenseManagerLinuxSubscriptionsClient.ts @@ -222,6 +222,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-license-manager-linux-subscriptions/src/runtimeConfig.ts b/clients/client-license-manager-linux-subscriptions/src/runtimeConfig.ts index 74ab8a408902..f4c2ed32a78a 100644 --- a/clients/client-license-manager-linux-subscriptions/src/runtimeConfig.ts +++ b/clients/client-license-manager-linux-subscriptions/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LicenseManagerLinuxSubscriptionsClientC const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LicenseManagerLinuxSubscriptionsClientC defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-license-manager-user-subscriptions/src/LicenseManagerUserSubscriptionsClient.ts b/clients/client-license-manager-user-subscriptions/src/LicenseManagerUserSubscriptionsClient.ts index 2be7806cac88..4c4b52ab8e41 100644 --- a/clients/client-license-manager-user-subscriptions/src/LicenseManagerUserSubscriptionsClient.ts +++ b/clients/client-license-manager-user-subscriptions/src/LicenseManagerUserSubscriptionsClient.ts @@ -252,6 +252,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-license-manager-user-subscriptions/src/runtimeConfig.ts b/clients/client-license-manager-user-subscriptions/src/runtimeConfig.ts index a1a626c4d26e..ca5b71092e95 100644 --- a/clients/client-license-manager-user-subscriptions/src/runtimeConfig.ts +++ b/clients/client-license-manager-user-subscriptions/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LicenseManagerUserSubscriptionsClientCo const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LicenseManagerUserSubscriptionsClientCo defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-license-manager/src/LicenseManagerClient.ts b/clients/client-license-manager/src/LicenseManagerClient.ts index 4980314d9c4d..44d72c492dff 100644 --- a/clients/client-license-manager/src/LicenseManagerClient.ts +++ b/clients/client-license-manager/src/LicenseManagerClient.ts @@ -402,6 +402,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-license-manager/src/runtimeConfig.ts b/clients/client-license-manager/src/runtimeConfig.ts index faf79fa49bac..3464edca65d2 100644 --- a/clients/client-license-manager/src/runtimeConfig.ts +++ b/clients/client-license-manager/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LicenseManagerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LicenseManagerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lightsail/src/LightsailClient.ts b/clients/client-lightsail/src/LightsailClient.ts index 86e61424a86d..30330d0d8ad6 100644 --- a/clients/client-lightsail/src/LightsailClient.ts +++ b/clients/client-lightsail/src/LightsailClient.ts @@ -882,6 +882,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lightsail/src/runtimeConfig.ts b/clients/client-lightsail/src/runtimeConfig.ts index 836354923527..f3e55e6d1482 100644 --- a/clients/client-lightsail/src/runtimeConfig.ts +++ b/clients/client-lightsail/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LightsailClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LightsailClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-location/src/LocationClient.ts b/clients/client-location/src/LocationClient.ts index 3bce56c8137c..06ad4d6f6fb8 100644 --- a/clients/client-location/src/LocationClient.ts +++ b/clients/client-location/src/LocationClient.ts @@ -429,6 +429,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-location/src/runtimeConfig.ts b/clients/client-location/src/runtimeConfig.ts index f5981cafe376..3dfa74906eac 100644 --- a/clients/client-location/src/runtimeConfig.ts +++ b/clients/client-location/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LocationClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LocationClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lookoutequipment/src/LookoutEquipmentClient.ts b/clients/client-lookoutequipment/src/LookoutEquipmentClient.ts index 81466c2718fa..993c0f963e6c 100644 --- a/clients/client-lookoutequipment/src/LookoutEquipmentClient.ts +++ b/clients/client-lookoutequipment/src/LookoutEquipmentClient.ts @@ -387,6 +387,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lookoutequipment/src/runtimeConfig.ts b/clients/client-lookoutequipment/src/runtimeConfig.ts index 1a30ef8428d7..de130a066268 100644 --- a/clients/client-lookoutequipment/src/runtimeConfig.ts +++ b/clients/client-lookoutequipment/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LookoutEquipmentClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LookoutEquipmentClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lookoutmetrics/src/LookoutMetricsClient.ts b/clients/client-lookoutmetrics/src/LookoutMetricsClient.ts index 64934ba70930..07dd64e95c59 100644 --- a/clients/client-lookoutmetrics/src/LookoutMetricsClient.ts +++ b/clients/client-lookoutmetrics/src/LookoutMetricsClient.ts @@ -300,6 +300,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lookoutmetrics/src/runtimeConfig.ts b/clients/client-lookoutmetrics/src/runtimeConfig.ts index 7688f2174f5d..a0374ec38fb7 100644 --- a/clients/client-lookoutmetrics/src/runtimeConfig.ts +++ b/clients/client-lookoutmetrics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LookoutMetricsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LookoutMetricsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-lookoutvision/src/LookoutVisionClient.ts b/clients/client-lookoutvision/src/LookoutVisionClient.ts index b721b0e8b3e1..078b79147f5c 100644 --- a/clients/client-lookoutvision/src/LookoutVisionClient.ts +++ b/clients/client-lookoutvision/src/LookoutVisionClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-lookoutvision/src/runtimeConfig.ts b/clients/client-lookoutvision/src/runtimeConfig.ts index 608c8a44e371..3a5d0abd4f66 100644 --- a/clients/client-lookoutvision/src/runtimeConfig.ts +++ b/clients/client-lookoutvision/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: LookoutVisionClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: LookoutVisionClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-m2/src/M2Client.ts b/clients/client-m2/src/M2Client.ts index 337e63441a7a..62da0ed5affd 100644 --- a/clients/client-m2/src/M2Client.ts +++ b/clients/client-m2/src/M2Client.ts @@ -306,6 +306,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-m2/src/runtimeConfig.ts b/clients/client-m2/src/runtimeConfig.ts index b2b9686cd190..1bb646cf60f9 100644 --- a/clients/client-m2/src/runtimeConfig.ts +++ b/clients/client-m2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: M2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: M2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-machine-learning/src/MachineLearningClient.ts b/clients/client-machine-learning/src/MachineLearningClient.ts index 9470ec485e4e..8519b4dd35aa 100644 --- a/clients/client-machine-learning/src/MachineLearningClient.ts +++ b/clients/client-machine-learning/src/MachineLearningClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-machine-learning/src/runtimeConfig.ts b/clients/client-machine-learning/src/runtimeConfig.ts index fe4ade50486b..faa80f3834e0 100644 --- a/clients/client-machine-learning/src/runtimeConfig.ts +++ b/clients/client-machine-learning/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MachineLearningClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MachineLearningClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-macie2/src/Macie2Client.ts b/clients/client-macie2/src/Macie2Client.ts index 79055e6150fb..646d8da0ad83 100644 --- a/clients/client-macie2/src/Macie2Client.ts +++ b/clients/client-macie2/src/Macie2Client.ts @@ -561,6 +561,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-macie2/src/runtimeConfig.ts b/clients/client-macie2/src/runtimeConfig.ts index b8755d97f8f5..a2295fb0fd90 100644 --- a/clients/client-macie2/src/runtimeConfig.ts +++ b/clients/client-macie2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Macie2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Macie2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mailmanager/src/MailManagerClient.ts b/clients/client-mailmanager/src/MailManagerClient.ts index 0e54bc919936..38aabc85529c 100644 --- a/clients/client-mailmanager/src/MailManagerClient.ts +++ b/clients/client-mailmanager/src/MailManagerClient.ts @@ -348,6 +348,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mailmanager/src/runtimeConfig.ts b/clients/client-mailmanager/src/runtimeConfig.ts index d1552d155d7a..8307ee9574c9 100644 --- a/clients/client-mailmanager/src/runtimeConfig.ts +++ b/clients/client-mailmanager/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MailManagerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MailManagerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts b/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts index bc3df349eb91..2a21a9196393 100644 --- a/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts +++ b/clients/client-managedblockchain-query/src/ManagedBlockchainQueryClient.ts @@ -201,6 +201,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-managedblockchain-query/src/runtimeConfig.ts b/clients/client-managedblockchain-query/src/runtimeConfig.ts index 42670233b58c..3583ed318362 100644 --- a/clients/client-managedblockchain-query/src/runtimeConfig.ts +++ b/clients/client-managedblockchain-query/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ManagedBlockchainQueryClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ManagedBlockchainQueryClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-managedblockchain/src/ManagedBlockchainClient.ts b/clients/client-managedblockchain/src/ManagedBlockchainClient.ts index a7f1243aa36b..718b400d2e76 100644 --- a/clients/client-managedblockchain/src/ManagedBlockchainClient.ts +++ b/clients/client-managedblockchain/src/ManagedBlockchainClient.ts @@ -249,6 +249,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-managedblockchain/src/runtimeConfig.ts b/clients/client-managedblockchain/src/runtimeConfig.ts index d5eb8a820de8..b4fef33391f5 100644 --- a/clients/client-managedblockchain/src/runtimeConfig.ts +++ b/clients/client-managedblockchain/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ManagedBlockchainClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ManagedBlockchainClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-agreement/src/MarketplaceAgreementClient.ts b/clients/client-marketplace-agreement/src/MarketplaceAgreementClient.ts index 245ff04c5381..0dec3b4bca34 100644 --- a/clients/client-marketplace-agreement/src/MarketplaceAgreementClient.ts +++ b/clients/client-marketplace-agreement/src/MarketplaceAgreementClient.ts @@ -174,6 +174,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-agreement/src/runtimeConfig.ts b/clients/client-marketplace-agreement/src/runtimeConfig.ts index 3889b989388b..3717c0ae667b 100644 --- a/clients/client-marketplace-agreement/src/runtimeConfig.ts +++ b/clients/client-marketplace-agreement/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceAgreementClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceAgreementClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-catalog/src/MarketplaceCatalogClient.ts b/clients/client-marketplace-catalog/src/MarketplaceCatalogClient.ts index 75dd43a16985..6b34814ca793 100644 --- a/clients/client-marketplace-catalog/src/MarketplaceCatalogClient.ts +++ b/clients/client-marketplace-catalog/src/MarketplaceCatalogClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-catalog/src/runtimeConfig.ts b/clients/client-marketplace-catalog/src/runtimeConfig.ts index c5d602022d62..6cbaf059418c 100644 --- a/clients/client-marketplace-catalog/src/runtimeConfig.ts +++ b/clients/client-marketplace-catalog/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceCatalogClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceCatalogClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalyticsClient.ts b/clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalyticsClient.ts index d5cc8e2ae5df..6f92dbd06b7e 100644 --- a/clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalyticsClient.ts +++ b/clients/client-marketplace-commerce-analytics/src/MarketplaceCommerceAnalyticsClient.ts @@ -170,6 +170,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts index 2bef1e2b0e77..fb4be57485bc 100644 --- a/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts +++ b/clients/client-marketplace-commerce-analytics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceCommerceAnalyticsClientConfi const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceCommerceAnalyticsClientConfi defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-deployment/src/MarketplaceDeploymentClient.ts b/clients/client-marketplace-deployment/src/MarketplaceDeploymentClient.ts index a9d868e44859..adf07bb41c63 100644 --- a/clients/client-marketplace-deployment/src/MarketplaceDeploymentClient.ts +++ b/clients/client-marketplace-deployment/src/MarketplaceDeploymentClient.ts @@ -183,6 +183,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-deployment/src/runtimeConfig.ts b/clients/client-marketplace-deployment/src/runtimeConfig.ts index 9df75cad7b1c..36403d5f635e 100644 --- a/clients/client-marketplace-deployment/src/runtimeConfig.ts +++ b/clients/client-marketplace-deployment/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceDeploymentClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceDeploymentClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementServiceClient.ts b/clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementServiceClient.ts index 0febc1c2fc32..d679a9f06a66 100644 --- a/clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementServiceClient.ts +++ b/clients/client-marketplace-entitlement-service/src/MarketplaceEntitlementServiceClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts b/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts index b15447717ede..f7199f8d9265 100644 --- a/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts +++ b/clients/client-marketplace-entitlement-service/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceEntitlementServiceClientConf const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceEntitlementServiceClientConf defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-metering/src/MarketplaceMeteringClient.ts b/clients/client-marketplace-metering/src/MarketplaceMeteringClient.ts index 1398f1468ec7..c51e12d6a163 100644 --- a/clients/client-marketplace-metering/src/MarketplaceMeteringClient.ts +++ b/clients/client-marketplace-metering/src/MarketplaceMeteringClient.ts @@ -177,6 +177,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-metering/src/runtimeConfig.ts b/clients/client-marketplace-metering/src/runtimeConfig.ts index d3cf73fb52b0..cc0b31f0ae95 100644 --- a/clients/client-marketplace-metering/src/runtimeConfig.ts +++ b/clients/client-marketplace-metering/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceMeteringClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceMeteringClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-marketplace-reporting/src/MarketplaceReportingClient.ts b/clients/client-marketplace-reporting/src/MarketplaceReportingClient.ts index a101d2d50ecb..b049083dc6f6 100644 --- a/clients/client-marketplace-reporting/src/MarketplaceReportingClient.ts +++ b/clients/client-marketplace-reporting/src/MarketplaceReportingClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-marketplace-reporting/src/runtimeConfig.ts b/clients/client-marketplace-reporting/src/runtimeConfig.ts index 0a4d4d8a7cb3..d865d82fb00f 100644 --- a/clients/client-marketplace-reporting/src/runtimeConfig.ts +++ b/clients/client-marketplace-reporting/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MarketplaceReportingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MarketplaceReportingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediaconnect/src/MediaConnectClient.ts b/clients/client-mediaconnect/src/MediaConnectClient.ts index 936d515faff4..af65f73d974e 100644 --- a/clients/client-mediaconnect/src/MediaConnectClient.ts +++ b/clients/client-mediaconnect/src/MediaConnectClient.ts @@ -369,6 +369,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediaconnect/src/runtimeConfig.ts b/clients/client-mediaconnect/src/runtimeConfig.ts index 7cfbdde5b8b3..8ce4dc0dee49 100644 --- a/clients/client-mediaconnect/src/runtimeConfig.ts +++ b/clients/client-mediaconnect/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaConnectClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaConnectClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediaconvert/src/MediaConvertClient.ts b/clients/client-mediaconvert/src/MediaConvertClient.ts index 6764cb9f3f7e..95a7f194944f 100644 --- a/clients/client-mediaconvert/src/MediaConvertClient.ts +++ b/clients/client-mediaconvert/src/MediaConvertClient.ts @@ -264,6 +264,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediaconvert/src/runtimeConfig.ts b/clients/client-mediaconvert/src/runtimeConfig.ts index 1860f417805c..db0c9b2bfd95 100644 --- a/clients/client-mediaconvert/src/runtimeConfig.ts +++ b/clients/client-mediaconvert/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaConvertClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaConvertClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-medialive/src/MediaLiveClient.ts b/clients/client-medialive/src/MediaLiveClient.ts index 4a23b9f41cb9..69a4bc8ad203 100644 --- a/clients/client-medialive/src/MediaLiveClient.ts +++ b/clients/client-medialive/src/MediaLiveClient.ts @@ -667,6 +667,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-medialive/src/runtimeConfig.ts b/clients/client-medialive/src/runtimeConfig.ts index ddba63083c39..a110b65f9dc9 100644 --- a/clients/client-medialive/src/runtimeConfig.ts +++ b/clients/client-medialive/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaLiveClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaLiveClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediapackage-vod/src/MediaPackageVodClient.ts b/clients/client-mediapackage-vod/src/MediaPackageVodClient.ts index 11d8116e8b62..53d7b27f628f 100644 --- a/clients/client-mediapackage-vod/src/MediaPackageVodClient.ts +++ b/clients/client-mediapackage-vod/src/MediaPackageVodClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediapackage-vod/src/runtimeConfig.ts b/clients/client-mediapackage-vod/src/runtimeConfig.ts index 59087e6f0b53..9610356354c2 100644 --- a/clients/client-mediapackage-vod/src/runtimeConfig.ts +++ b/clients/client-mediapackage-vod/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaPackageVodClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaPackageVodClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediapackage/src/MediaPackageClient.ts b/clients/client-mediapackage/src/MediaPackageClient.ts index 6e19aa3c47e8..44946094e76e 100644 --- a/clients/client-mediapackage/src/MediaPackageClient.ts +++ b/clients/client-mediapackage/src/MediaPackageClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediapackage/src/runtimeConfig.ts b/clients/client-mediapackage/src/runtimeConfig.ts index bac51c125131..e9bd01bb6774 100644 --- a/clients/client-mediapackage/src/runtimeConfig.ts +++ b/clients/client-mediapackage/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaPackageClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaPackageClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediapackagev2/src/MediaPackageV2Client.ts b/clients/client-mediapackagev2/src/MediaPackageV2Client.ts index 5678831a7e8c..d6210ab47c52 100644 --- a/clients/client-mediapackagev2/src/MediaPackageV2Client.ts +++ b/clients/client-mediapackagev2/src/MediaPackageV2Client.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediapackagev2/src/runtimeConfig.ts b/clients/client-mediapackagev2/src/runtimeConfig.ts index 6f49ba9d62d9..542c4753a224 100644 --- a/clients/client-mediapackagev2/src/runtimeConfig.ts +++ b/clients/client-mediapackagev2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaPackageV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaPackageV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediastore-data/src/MediaStoreDataClient.ts b/clients/client-mediastore-data/src/MediaStoreDataClient.ts index 591a85cf0be6..f4c38dd13de2 100644 --- a/clients/client-mediastore-data/src/MediaStoreDataClient.ts +++ b/clients/client-mediastore-data/src/MediaStoreDataClient.ts @@ -181,6 +181,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediastore-data/src/runtimeConfig.ts b/clients/client-mediastore-data/src/runtimeConfig.ts index 895e66fa28f9..4e310fcb456e 100644 --- a/clients/client-mediastore-data/src/runtimeConfig.ts +++ b/clients/client-mediastore-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaStoreDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaStoreDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediastore/src/MediaStoreClient.ts b/clients/client-mediastore/src/MediaStoreClient.ts index 2ed01444c5f0..e1c95caafdc3 100644 --- a/clients/client-mediastore/src/MediaStoreClient.ts +++ b/clients/client-mediastore/src/MediaStoreClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediastore/src/runtimeConfig.ts b/clients/client-mediastore/src/runtimeConfig.ts index 642aa4e8ff41..39afcde0f834 100644 --- a/clients/client-mediastore/src/runtimeConfig.ts +++ b/clients/client-mediastore/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaStoreClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaStoreClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mediatailor/src/MediaTailorClient.ts b/clients/client-mediatailor/src/MediaTailorClient.ts index a044209a43de..bb6881a726d8 100644 --- a/clients/client-mediatailor/src/MediaTailorClient.ts +++ b/clients/client-mediatailor/src/MediaTailorClient.ts @@ -348,6 +348,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mediatailor/src/runtimeConfig.ts b/clients/client-mediatailor/src/runtimeConfig.ts index 1a6468ed1fa6..0eead527cffd 100644 --- a/clients/client-mediatailor/src/runtimeConfig.ts +++ b/clients/client-mediatailor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MediaTailorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MediaTailorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-medical-imaging/src/MedicalImagingClient.ts b/clients/client-medical-imaging/src/MedicalImagingClient.ts index 35b3f7560197..ed475bc31dda 100644 --- a/clients/client-medical-imaging/src/MedicalImagingClient.ts +++ b/clients/client-medical-imaging/src/MedicalImagingClient.ts @@ -238,6 +238,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-medical-imaging/src/runtimeConfig.ts b/clients/client-medical-imaging/src/runtimeConfig.ts index 0f383d471a52..706b028d9888 100644 --- a/clients/client-medical-imaging/src/runtimeConfig.ts +++ b/clients/client-medical-imaging/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MedicalImagingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MedicalImagingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-memorydb/src/MemoryDBClient.ts b/clients/client-memorydb/src/MemoryDBClient.ts index e2620a31c8a3..fd47f7029218 100644 --- a/clients/client-memorydb/src/MemoryDBClient.ts +++ b/clients/client-memorydb/src/MemoryDBClient.ts @@ -345,6 +345,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-memorydb/src/runtimeConfig.ts b/clients/client-memorydb/src/runtimeConfig.ts index 5f9db2d847a9..20b129b6667e 100644 --- a/clients/client-memorydb/src/runtimeConfig.ts +++ b/clients/client-memorydb/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MemoryDBClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MemoryDBClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mgn/src/MgnClient.ts b/clients/client-mgn/src/MgnClient.ts index cae38e881d0c..e20fa1000f6a 100644 --- a/clients/client-mgn/src/MgnClient.ts +++ b/clients/client-mgn/src/MgnClient.ts @@ -474,6 +474,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mgn/src/runtimeConfig.ts b/clients/client-mgn/src/runtimeConfig.ts index f7446d58f4a9..25eb48d1db3f 100644 --- a/clients/client-mgn/src/runtimeConfig.ts +++ b/clients/client-mgn/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MgnClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MgnClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-migration-hub-refactor-spaces/src/MigrationHubRefactorSpacesClient.ts b/clients/client-migration-hub-refactor-spaces/src/MigrationHubRefactorSpacesClient.ts index 69a2722fed19..aebb19795f2a 100644 --- a/clients/client-migration-hub-refactor-spaces/src/MigrationHubRefactorSpacesClient.ts +++ b/clients/client-migration-hub-refactor-spaces/src/MigrationHubRefactorSpacesClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-migration-hub-refactor-spaces/src/runtimeConfig.ts b/clients/client-migration-hub-refactor-spaces/src/runtimeConfig.ts index 36d91a08c7ee..c1cd3c83efea 100644 --- a/clients/client-migration-hub-refactor-spaces/src/runtimeConfig.ts +++ b/clients/client-migration-hub-refactor-spaces/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MigrationHubRefactorSpacesClientConfig) const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MigrationHubRefactorSpacesClientConfig) defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-migration-hub/src/MigrationHubClient.ts b/clients/client-migration-hub/src/MigrationHubClient.ts index 49f2dc8809ef..432f8074e311 100644 --- a/clients/client-migration-hub/src/MigrationHubClient.ts +++ b/clients/client-migration-hub/src/MigrationHubClient.ts @@ -288,6 +288,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-migration-hub/src/runtimeConfig.ts b/clients/client-migration-hub/src/runtimeConfig.ts index 39a11f02c03e..7afac643401f 100644 --- a/clients/client-migration-hub/src/runtimeConfig.ts +++ b/clients/client-migration-hub/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MigrationHubClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MigrationHubClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts b/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts index ab7e81527438..0e31ef71a0d0 100644 --- a/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts +++ b/clients/client-migrationhub-config/src/MigrationHubConfigClient.ts @@ -186,6 +186,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-migrationhub-config/src/runtimeConfig.ts b/clients/client-migrationhub-config/src/runtimeConfig.ts index 579fba8cd226..732c476e81e8 100644 --- a/clients/client-migrationhub-config/src/runtimeConfig.ts +++ b/clients/client-migrationhub-config/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-migrationhuborchestrator/src/MigrationHubOrchestratorClient.ts b/clients/client-migrationhuborchestrator/src/MigrationHubOrchestratorClient.ts index 0c7a0e6cbdae..a2b08b5c9f99 100644 --- a/clients/client-migrationhuborchestrator/src/MigrationHubOrchestratorClient.ts +++ b/clients/client-migrationhuborchestrator/src/MigrationHubOrchestratorClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-migrationhuborchestrator/src/runtimeConfig.ts b/clients/client-migrationhuborchestrator/src/runtimeConfig.ts index 3dd840f099fd..6ec50b2e128e 100644 --- a/clients/client-migrationhuborchestrator/src/runtimeConfig.ts +++ b/clients/client-migrationhuborchestrator/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MigrationHubOrchestratorClientConfig) = const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MigrationHubOrchestratorClientConfig) = defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-migrationhubstrategy/src/MigrationHubStrategyClient.ts b/clients/client-migrationhubstrategy/src/MigrationHubStrategyClient.ts index f0fb82c83a02..c19cb7b60271 100644 --- a/clients/client-migrationhubstrategy/src/MigrationHubStrategyClient.ts +++ b/clients/client-migrationhubstrategy/src/MigrationHubStrategyClient.ts @@ -270,6 +270,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-migrationhubstrategy/src/runtimeConfig.ts b/clients/client-migrationhubstrategy/src/runtimeConfig.ts index f821f0b1cdda..0be0271e3f4c 100644 --- a/clients/client-migrationhubstrategy/src/runtimeConfig.ts +++ b/clients/client-migrationhubstrategy/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MigrationHubStrategyClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MigrationHubStrategyClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mq/src/MqClient.ts b/clients/client-mq/src/MqClient.ts index cd207416da50..eb2ff492baf5 100644 --- a/clients/client-mq/src/MqClient.ts +++ b/clients/client-mq/src/MqClient.ts @@ -255,6 +255,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mq/src/runtimeConfig.ts b/clients/client-mq/src/runtimeConfig.ts index 46199adcc93f..b4b03eb73566 100644 --- a/clients/client-mq/src/runtimeConfig.ts +++ b/clients/client-mq/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MqClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MqClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mturk/src/MTurkClient.ts b/clients/client-mturk/src/MTurkClient.ts index aedaecab17a3..7c556331d853 100644 --- a/clients/client-mturk/src/MTurkClient.ts +++ b/clients/client-mturk/src/MTurkClient.ts @@ -345,6 +345,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mturk/src/runtimeConfig.ts b/clients/client-mturk/src/runtimeConfig.ts index 09d9be17dbad..7fb680abecb1 100644 --- a/clients/client-mturk/src/runtimeConfig.ts +++ b/clients/client-mturk/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MTurkClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MTurkClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-mwaa/src/MWAAClient.ts b/clients/client-mwaa/src/MWAAClient.ts index 3072c514f9ab..6992b1df5d73 100644 --- a/clients/client-mwaa/src/MWAAClient.ts +++ b/clients/client-mwaa/src/MWAAClient.ts @@ -207,6 +207,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-mwaa/src/runtimeConfig.ts b/clients/client-mwaa/src/runtimeConfig.ts index 8638cccebbc6..c76709f911f8 100644 --- a/clients/client-mwaa/src/runtimeConfig.ts +++ b/clients/client-mwaa/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MWAAClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MWAAClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-neptune-graph/src/NeptuneGraphClient.ts b/clients/client-neptune-graph/src/NeptuneGraphClient.ts index 8b7ee412b467..58f7a5af9f7e 100644 --- a/clients/client-neptune-graph/src/NeptuneGraphClient.ts +++ b/clients/client-neptune-graph/src/NeptuneGraphClient.ts @@ -289,6 +289,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-neptune-graph/src/runtimeConfig.ts b/clients/client-neptune-graph/src/runtimeConfig.ts index d374af1fd18c..0752cce04bdc 100644 --- a/clients/client-neptune-graph/src/runtimeConfig.ts +++ b/clients/client-neptune-graph/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NeptuneGraphClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NeptuneGraphClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-neptune/src/NeptuneClient.ts b/clients/client-neptune/src/NeptuneClient.ts index 17b5d9526b88..0637adf85ce8 100644 --- a/clients/client-neptune/src/NeptuneClient.ts +++ b/clients/client-neptune/src/NeptuneClient.ts @@ -537,6 +537,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-neptune/src/runtimeConfig.ts b/clients/client-neptune/src/runtimeConfig.ts index c827f517a2d6..1c9cf19a2da6 100644 --- a/clients/client-neptune/src/runtimeConfig.ts +++ b/clients/client-neptune/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NeptuneClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NeptuneClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-neptunedata/src/NeptunedataClient.ts b/clients/client-neptunedata/src/NeptunedataClient.ts index 9dfa08b857c1..4e149acc4850 100644 --- a/clients/client-neptunedata/src/NeptunedataClient.ts +++ b/clients/client-neptunedata/src/NeptunedataClient.ts @@ -381,6 +381,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-neptunedata/src/runtimeConfig.ts b/clients/client-neptunedata/src/runtimeConfig.ts index cbfa99609519..688592058e9a 100644 --- a/clients/client-neptunedata/src/runtimeConfig.ts +++ b/clients/client-neptunedata/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NeptunedataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NeptunedataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-network-firewall/src/NetworkFirewallClient.ts b/clients/client-network-firewall/src/NetworkFirewallClient.ts index fd2b9a8e73f2..8fb39df22993 100644 --- a/clients/client-network-firewall/src/NetworkFirewallClient.ts +++ b/clients/client-network-firewall/src/NetworkFirewallClient.ts @@ -342,6 +342,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-network-firewall/src/runtimeConfig.ts b/clients/client-network-firewall/src/runtimeConfig.ts index 14cfbe977734..20fb5a99876f 100644 --- a/clients/client-network-firewall/src/runtimeConfig.ts +++ b/clients/client-network-firewall/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NetworkFirewallClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NetworkFirewallClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-networkflowmonitor/src/NetworkFlowMonitorClient.ts b/clients/client-networkflowmonitor/src/NetworkFlowMonitorClient.ts index c052d3766649..cba9342e3584 100644 --- a/clients/client-networkflowmonitor/src/NetworkFlowMonitorClient.ts +++ b/clients/client-networkflowmonitor/src/NetworkFlowMonitorClient.ts @@ -279,6 +279,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-networkflowmonitor/src/runtimeConfig.ts b/clients/client-networkflowmonitor/src/runtimeConfig.ts index 493d580564d3..7b20fa614314 100644 --- a/clients/client-networkflowmonitor/src/runtimeConfig.ts +++ b/clients/client-networkflowmonitor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NetworkFlowMonitorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NetworkFlowMonitorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-networkmanager/src/NetworkManagerClient.ts b/clients/client-networkmanager/src/NetworkManagerClient.ts index 71edc30a9d74..d2f859864948 100644 --- a/clients/client-networkmanager/src/NetworkManagerClient.ts +++ b/clients/client-networkmanager/src/NetworkManagerClient.ts @@ -570,6 +570,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-networkmanager/src/runtimeConfig.ts b/clients/client-networkmanager/src/runtimeConfig.ts index 26cc65d42b35..c202840ad5af 100644 --- a/clients/client-networkmanager/src/runtimeConfig.ts +++ b/clients/client-networkmanager/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NetworkManagerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NetworkManagerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-networkmonitor/src/NetworkMonitorClient.ts b/clients/client-networkmonitor/src/NetworkMonitorClient.ts index e38872d1cd00..1d6c29a27d57 100644 --- a/clients/client-networkmonitor/src/NetworkMonitorClient.ts +++ b/clients/client-networkmonitor/src/NetworkMonitorClient.ts @@ -204,6 +204,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-networkmonitor/src/runtimeConfig.ts b/clients/client-networkmonitor/src/runtimeConfig.ts index 297f9f4f9b24..02f651d2c2da 100644 --- a/clients/client-networkmonitor/src/runtimeConfig.ts +++ b/clients/client-networkmonitor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NetworkMonitorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NetworkMonitorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-notifications/src/NotificationsClient.ts b/clients/client-notifications/src/NotificationsClient.ts index f416bf3f0fa9..6faf94936f09 100644 --- a/clients/client-notifications/src/NotificationsClient.ts +++ b/clients/client-notifications/src/NotificationsClient.ts @@ -264,6 +264,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-notifications/src/runtimeConfig.ts b/clients/client-notifications/src/runtimeConfig.ts index 57918561e0f1..d8cc222c36ca 100644 --- a/clients/client-notifications/src/runtimeConfig.ts +++ b/clients/client-notifications/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NotificationsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NotificationsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-notificationscontacts/src/NotificationsContactsClient.ts b/clients/client-notificationscontacts/src/NotificationsContactsClient.ts index 3e7b1a405406..0c90d2fb1fe4 100644 --- a/clients/client-notificationscontacts/src/NotificationsContactsClient.ts +++ b/clients/client-notificationscontacts/src/NotificationsContactsClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-notificationscontacts/src/runtimeConfig.ts b/clients/client-notificationscontacts/src/runtimeConfig.ts index f4d7316b96b6..4121bbadf745 100644 --- a/clients/client-notificationscontacts/src/runtimeConfig.ts +++ b/clients/client-notificationscontacts/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: NotificationsContactsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: NotificationsContactsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-oam/src/OAMClient.ts b/clients/client-oam/src/OAMClient.ts index 4e0eaee92beb..335a8219b083 100644 --- a/clients/client-oam/src/OAMClient.ts +++ b/clients/client-oam/src/OAMClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-oam/src/runtimeConfig.ts b/clients/client-oam/src/runtimeConfig.ts index cae08d967901..58129ddfd2ec 100644 --- a/clients/client-oam/src/runtimeConfig.ts +++ b/clients/client-oam/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OAMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OAMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-observabilityadmin/src/ObservabilityAdminClient.ts b/clients/client-observabilityadmin/src/ObservabilityAdminClient.ts index 3e40062cae8e..196bc08e07f3 100644 --- a/clients/client-observabilityadmin/src/ObservabilityAdminClient.ts +++ b/clients/client-observabilityadmin/src/ObservabilityAdminClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-observabilityadmin/src/runtimeConfig.ts b/clients/client-observabilityadmin/src/runtimeConfig.ts index bb6654114999..2c1eb32114bf 100644 --- a/clients/client-observabilityadmin/src/runtimeConfig.ts +++ b/clients/client-observabilityadmin/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ObservabilityAdminClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ObservabilityAdminClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-omics/src/OmicsClient.ts b/clients/client-omics/src/OmicsClient.ts index 56fc10f30a32..bbd85d6e691b 100644 --- a/clients/client-omics/src/OmicsClient.ts +++ b/clients/client-omics/src/OmicsClient.ts @@ -568,6 +568,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-omics/src/runtimeConfig.ts b/clients/client-omics/src/runtimeConfig.ts index 43f4d2cebac7..4e525faae233 100644 --- a/clients/client-omics/src/runtimeConfig.ts +++ b/clients/client-omics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OmicsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OmicsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-opensearch/src/OpenSearchClient.ts b/clients/client-opensearch/src/OpenSearchClient.ts index 58cdefdd4534..fe20160cd569 100644 --- a/clients/client-opensearch/src/OpenSearchClient.ts +++ b/clients/client-opensearch/src/OpenSearchClient.ts @@ -513,6 +513,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-opensearch/src/runtimeConfig.ts b/clients/client-opensearch/src/runtimeConfig.ts index d011f91427f3..368653902055 100644 --- a/clients/client-opensearch/src/runtimeConfig.ts +++ b/clients/client-opensearch/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OpenSearchClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OpenSearchClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts b/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts index 1daf07441599..684662cc4646 100644 --- a/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts +++ b/clients/client-opensearchserverless/src/OpenSearchServerlessClient.ts @@ -327,6 +327,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-opensearchserverless/src/runtimeConfig.ts b/clients/client-opensearchserverless/src/runtimeConfig.ts index 93b5fcafc87d..f40695067778 100644 --- a/clients/client-opensearchserverless/src/runtimeConfig.ts +++ b/clients/client-opensearchserverless/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OpenSearchServerlessClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OpenSearchServerlessClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-opsworks/src/OpsWorksClient.ts b/clients/client-opsworks/src/OpsWorksClient.ts index 8c1bec775a1a..6df484a797a8 100644 --- a/clients/client-opsworks/src/OpsWorksClient.ts +++ b/clients/client-opsworks/src/OpsWorksClient.ts @@ -465,6 +465,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-opsworks/src/runtimeConfig.ts b/clients/client-opsworks/src/runtimeConfig.ts index 48993d31f223..1e1e80740e4f 100644 --- a/clients/client-opsworks/src/runtimeConfig.ts +++ b/clients/client-opsworks/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OpsWorksClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OpsWorksClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-opsworkscm/src/OpsWorksCMClient.ts b/clients/client-opsworkscm/src/OpsWorksCMClient.ts index 0f0127a9fb39..68377b302138 100644 --- a/clients/client-opsworkscm/src/OpsWorksCMClient.ts +++ b/clients/client-opsworkscm/src/OpsWorksCMClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-opsworkscm/src/runtimeConfig.ts b/clients/client-opsworkscm/src/runtimeConfig.ts index 15e0806df022..6dd16dae2377 100644 --- a/clients/client-opsworkscm/src/runtimeConfig.ts +++ b/clients/client-opsworkscm/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OpsWorksCMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OpsWorksCMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-organizations/src/OrganizationsClient.ts b/clients/client-organizations/src/OrganizationsClient.ts index 48bec372b05f..7955a1ad6c8d 100644 --- a/clients/client-organizations/src/OrganizationsClient.ts +++ b/clients/client-organizations/src/OrganizationsClient.ts @@ -411,6 +411,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-organizations/src/runtimeConfig.ts b/clients/client-organizations/src/runtimeConfig.ts index 0493f57df719..2fa538eaaefe 100644 --- a/clients/client-organizations/src/runtimeConfig.ts +++ b/clients/client-organizations/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OrganizationsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OrganizationsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-osis/src/OSISClient.ts b/clients/client-osis/src/OSISClient.ts index adc89f912b34..dd5fe54982b5 100644 --- a/clients/client-osis/src/OSISClient.ts +++ b/clients/client-osis/src/OSISClient.ts @@ -219,6 +219,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-osis/src/runtimeConfig.ts b/clients/client-osis/src/runtimeConfig.ts index 6ed75c338971..60f04c443769 100644 --- a/clients/client-osis/src/runtimeConfig.ts +++ b/clients/client-osis/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OSISClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OSISClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-outposts/src/OutpostsClient.ts b/clients/client-outposts/src/OutpostsClient.ts index 84cf0faf42fd..0dad204b7ca2 100644 --- a/clients/client-outposts/src/OutpostsClient.ts +++ b/clients/client-outposts/src/OutpostsClient.ts @@ -279,6 +279,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-outposts/src/runtimeConfig.ts b/clients/client-outposts/src/runtimeConfig.ts index 44b3814e804c..ec67285d1220 100644 --- a/clients/client-outposts/src/runtimeConfig.ts +++ b/clients/client-outposts/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: OutpostsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: OutpostsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-panorama/src/PanoramaClient.ts b/clients/client-panorama/src/PanoramaClient.ts index c38b516c7b7f..94f5130a4deb 100644 --- a/clients/client-panorama/src/PanoramaClient.ts +++ b/clients/client-panorama/src/PanoramaClient.ts @@ -327,6 +327,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-panorama/src/runtimeConfig.ts b/clients/client-panorama/src/runtimeConfig.ts index 66cdb4aa0f6f..6389176ee41b 100644 --- a/clients/client-panorama/src/runtimeConfig.ts +++ b/clients/client-panorama/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PanoramaClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PanoramaClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-partnercentral-selling/src/PartnerCentralSellingClient.ts b/clients/client-partnercentral-selling/src/PartnerCentralSellingClient.ts index 3eb8c0bd088c..02b678e61855 100644 --- a/clients/client-partnercentral-selling/src/PartnerCentralSellingClient.ts +++ b/clients/client-partnercentral-selling/src/PartnerCentralSellingClient.ts @@ -345,6 +345,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-partnercentral-selling/src/runtimeConfig.ts b/clients/client-partnercentral-selling/src/runtimeConfig.ts index 27d02b1faab5..9f35d3a73592 100644 --- a/clients/client-partnercentral-selling/src/runtimeConfig.ts +++ b/clients/client-partnercentral-selling/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PartnerCentralSellingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PartnerCentralSellingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-payment-cryptography-data/src/PaymentCryptographyDataClient.ts b/clients/client-payment-cryptography-data/src/PaymentCryptographyDataClient.ts index 08bf7cb988d5..030a12eae22f 100644 --- a/clients/client-payment-cryptography-data/src/PaymentCryptographyDataClient.ts +++ b/clients/client-payment-cryptography-data/src/PaymentCryptographyDataClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-payment-cryptography-data/src/runtimeConfig.ts b/clients/client-payment-cryptography-data/src/runtimeConfig.ts index 5d6aa1fe0a36..ca0e838e93db 100644 --- a/clients/client-payment-cryptography-data/src/runtimeConfig.ts +++ b/clients/client-payment-cryptography-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PaymentCryptographyDataClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PaymentCryptographyDataClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts b/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts index 24cbea492590..c6b62c9964eb 100644 --- a/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts +++ b/clients/client-payment-cryptography/src/PaymentCryptographyClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-payment-cryptography/src/runtimeConfig.ts b/clients/client-payment-cryptography/src/runtimeConfig.ts index 8139816e9af5..3c9a45368ec1 100644 --- a/clients/client-payment-cryptography/src/runtimeConfig.ts +++ b/clients/client-payment-cryptography/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PaymentCryptographyClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PaymentCryptographyClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pca-connector-ad/src/PcaConnectorAdClient.ts b/clients/client-pca-connector-ad/src/PcaConnectorAdClient.ts index e80940e22efa..5b650e0909cf 100644 --- a/clients/client-pca-connector-ad/src/PcaConnectorAdClient.ts +++ b/clients/client-pca-connector-ad/src/PcaConnectorAdClient.ts @@ -282,6 +282,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pca-connector-ad/src/runtimeConfig.ts b/clients/client-pca-connector-ad/src/runtimeConfig.ts index dd7700a527aa..b5f0d86a040c 100644 --- a/clients/client-pca-connector-ad/src/runtimeConfig.ts +++ b/clients/client-pca-connector-ad/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PcaConnectorAdClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PcaConnectorAdClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pca-connector-scep/src/PcaConnectorScepClient.ts b/clients/client-pca-connector-scep/src/PcaConnectorScepClient.ts index 3612422621f7..15a684f46953 100644 --- a/clients/client-pca-connector-scep/src/PcaConnectorScepClient.ts +++ b/clients/client-pca-connector-scep/src/PcaConnectorScepClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pca-connector-scep/src/runtimeConfig.ts b/clients/client-pca-connector-scep/src/runtimeConfig.ts index 48f4e9b55701..8e81457fb8a9 100644 --- a/clients/client-pca-connector-scep/src/runtimeConfig.ts +++ b/clients/client-pca-connector-scep/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PcaConnectorScepClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PcaConnectorScepClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pcs/src/PCSClient.ts b/clients/client-pcs/src/PCSClient.ts index c05bc4f5aff1..cf3d8ab8fa02 100644 --- a/clients/client-pcs/src/PCSClient.ts +++ b/clients/client-pcs/src/PCSClient.ts @@ -240,6 +240,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pcs/src/runtimeConfig.ts b/clients/client-pcs/src/runtimeConfig.ts index c700a07d1c8f..50d1d6ddcb56 100644 --- a/clients/client-pcs/src/runtimeConfig.ts +++ b/clients/client-pcs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PCSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PCSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-personalize-events/src/PersonalizeEventsClient.ts b/clients/client-personalize-events/src/PersonalizeEventsClient.ts index 0a29131fe409..58156ba78e61 100644 --- a/clients/client-personalize-events/src/PersonalizeEventsClient.ts +++ b/clients/client-personalize-events/src/PersonalizeEventsClient.ts @@ -183,6 +183,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-personalize-events/src/runtimeConfig.ts b/clients/client-personalize-events/src/runtimeConfig.ts index bed437d5edc9..ddd6534a9330 100644 --- a/clients/client-personalize-events/src/runtimeConfig.ts +++ b/clients/client-personalize-events/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PersonalizeEventsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PersonalizeEventsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-personalize-runtime/src/PersonalizeRuntimeClient.ts b/clients/client-personalize-runtime/src/PersonalizeRuntimeClient.ts index 6136783bc1f6..9625ca3fbf38 100644 --- a/clients/client-personalize-runtime/src/PersonalizeRuntimeClient.ts +++ b/clients/client-personalize-runtime/src/PersonalizeRuntimeClient.ts @@ -180,6 +180,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-personalize-runtime/src/runtimeConfig.ts b/clients/client-personalize-runtime/src/runtimeConfig.ts index 2d281a93be8c..718b49aab559 100644 --- a/clients/client-personalize-runtime/src/runtimeConfig.ts +++ b/clients/client-personalize-runtime/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PersonalizeRuntimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PersonalizeRuntimeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-personalize/src/PersonalizeClient.ts b/clients/client-personalize/src/PersonalizeClient.ts index d3a84e616f79..474701c0318a 100644 --- a/clients/client-personalize/src/PersonalizeClient.ts +++ b/clients/client-personalize/src/PersonalizeClient.ts @@ -468,6 +468,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-personalize/src/runtimeConfig.ts b/clients/client-personalize/src/runtimeConfig.ts index d76ec3d698c8..04c418f874f6 100644 --- a/clients/client-personalize/src/runtimeConfig.ts +++ b/clients/client-personalize/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PersonalizeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PersonalizeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pi/src/PIClient.ts b/clients/client-pi/src/PIClient.ts index acad15c82f3a..0bcc06571f41 100644 --- a/clients/client-pi/src/PIClient.ts +++ b/clients/client-pi/src/PIClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pi/src/runtimeConfig.ts b/clients/client-pi/src/runtimeConfig.ts index fe276cfff970..95b1a95ec11f 100644 --- a/clients/client-pi/src/runtimeConfig.ts +++ b/clients/client-pi/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PIClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PIClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pinpoint-email/src/PinpointEmailClient.ts b/clients/client-pinpoint-email/src/PinpointEmailClient.ts index 9d918aba9294..77f620d2a6b0 100644 --- a/clients/client-pinpoint-email/src/PinpointEmailClient.ts +++ b/clients/client-pinpoint-email/src/PinpointEmailClient.ts @@ -396,6 +396,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pinpoint-email/src/runtimeConfig.ts b/clients/client-pinpoint-email/src/runtimeConfig.ts index c31fa29a2bbc..e81263dadc63 100644 --- a/clients/client-pinpoint-email/src/runtimeConfig.ts +++ b/clients/client-pinpoint-email/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PinpointEmailClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PinpointEmailClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts b/clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts index fda052c37fa7..275f92dd6a61 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts @@ -621,6 +621,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pinpoint-sms-voice-v2/src/runtimeConfig.ts b/clients/client-pinpoint-sms-voice-v2/src/runtimeConfig.ts index 0484d2e34cbd..bcc8b2a31da1 100644 --- a/clients/client-pinpoint-sms-voice-v2/src/runtimeConfig.ts +++ b/clients/client-pinpoint-sms-voice-v2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PinpointSMSVoiceV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PinpointSMSVoiceV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pinpoint-sms-voice/src/PinpointSMSVoiceClient.ts b/clients/client-pinpoint-sms-voice/src/PinpointSMSVoiceClient.ts index 88af91c10066..30f0f2a33b09 100644 --- a/clients/client-pinpoint-sms-voice/src/PinpointSMSVoiceClient.ts +++ b/clients/client-pinpoint-sms-voice/src/PinpointSMSVoiceClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts b/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts index f46ba80bc1f1..5e173e8c1124 100644 --- a/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts +++ b/clients/client-pinpoint-sms-voice/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PinpointSMSVoiceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PinpointSMSVoiceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pinpoint/src/PinpointClient.ts b/clients/client-pinpoint/src/PinpointClient.ts index 5c04feeb9e9a..2ee15ba37386 100644 --- a/clients/client-pinpoint/src/PinpointClient.ts +++ b/clients/client-pinpoint/src/PinpointClient.ts @@ -654,6 +654,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pinpoint/src/runtimeConfig.ts b/clients/client-pinpoint/src/runtimeConfig.ts index 6a6591597500..8419b899a76d 100644 --- a/clients/client-pinpoint/src/runtimeConfig.ts +++ b/clients/client-pinpoint/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PinpointClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PinpointClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pipes/src/PipesClient.ts b/clients/client-pipes/src/PipesClient.ts index af5829b6cbf4..598150de1492 100644 --- a/clients/client-pipes/src/PipesClient.ts +++ b/clients/client-pipes/src/PipesClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pipes/src/runtimeConfig.ts b/clients/client-pipes/src/runtimeConfig.ts index a9d72a986eba..d77d31f2b1be 100644 --- a/clients/client-pipes/src/runtimeConfig.ts +++ b/clients/client-pipes/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PipesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PipesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-polly/src/PollyClient.ts b/clients/client-polly/src/PollyClient.ts index afae47194f57..e62aba310734 100644 --- a/clients/client-polly/src/PollyClient.ts +++ b/clients/client-polly/src/PollyClient.ts @@ -202,6 +202,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-polly/src/runtimeConfig.ts b/clients/client-polly/src/runtimeConfig.ts index a68bbd7cbe8f..1e599c961079 100644 --- a/clients/client-polly/src/runtimeConfig.ts +++ b/clients/client-polly/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PollyClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PollyClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-pricing/src/PricingClient.ts b/clients/client-pricing/src/PricingClient.ts index 9d7239d57880..fec4e9b98bb3 100644 --- a/clients/client-pricing/src/PricingClient.ts +++ b/clients/client-pricing/src/PricingClient.ts @@ -183,6 +183,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-pricing/src/runtimeConfig.ts b/clients/client-pricing/src/runtimeConfig.ts index 34efa85d1395..40304e710fe5 100644 --- a/clients/client-pricing/src/runtimeConfig.ts +++ b/clients/client-pricing/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PricingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PricingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-privatenetworks/src/PrivateNetworksClient.ts b/clients/client-privatenetworks/src/PrivateNetworksClient.ts index ad52d38073d7..fba945d5be32 100644 --- a/clients/client-privatenetworks/src/PrivateNetworksClient.ts +++ b/clients/client-privatenetworks/src/PrivateNetworksClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-privatenetworks/src/runtimeConfig.ts b/clients/client-privatenetworks/src/runtimeConfig.ts index 1888db93e146..7dd616a8b729 100644 --- a/clients/client-privatenetworks/src/runtimeConfig.ts +++ b/clients/client-privatenetworks/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: PrivateNetworksClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: PrivateNetworksClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-proton/src/ProtonClient.ts b/clients/client-proton/src/ProtonClient.ts index c9f250bf6f94..ecceed02e933 100644 --- a/clients/client-proton/src/ProtonClient.ts +++ b/clients/client-proton/src/ProtonClient.ts @@ -606,6 +606,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-proton/src/runtimeConfig.ts b/clients/client-proton/src/runtimeConfig.ts index e6921dcbca57..2545c59f81fa 100644 --- a/clients/client-proton/src/runtimeConfig.ts +++ b/clients/client-proton/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ProtonClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ProtonClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-qapps/src/QAppsClient.ts b/clients/client-qapps/src/QAppsClient.ts index 19b09b6c2348..a961309c1d52 100644 --- a/clients/client-qapps/src/QAppsClient.ts +++ b/clients/client-qapps/src/QAppsClient.ts @@ -315,6 +315,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-qapps/src/runtimeConfig.ts b/clients/client-qapps/src/runtimeConfig.ts index 5f8ace44fc12..8125db251580 100644 --- a/clients/client-qapps/src/runtimeConfig.ts +++ b/clients/client-qapps/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: QAppsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: QAppsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-qbusiness/src/QBusinessClient.ts b/clients/client-qbusiness/src/QBusinessClient.ts index d08735bbc81b..883a508a811b 100644 --- a/clients/client-qbusiness/src/QBusinessClient.ts +++ b/clients/client-qbusiness/src/QBusinessClient.ts @@ -435,6 +435,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-qbusiness/src/runtimeConfig.ts b/clients/client-qbusiness/src/runtimeConfig.ts index b730527a1d60..b0173234ea57 100644 --- a/clients/client-qbusiness/src/runtimeConfig.ts +++ b/clients/client-qbusiness/src/runtimeConfig.ts @@ -34,6 +34,7 @@ export const getRuntimeConfig = (config: QBusinessClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -46,21 +47,27 @@ export const getRuntimeConfig = (config: QBusinessClientConfig) => { createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create( config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true })) ), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-qconnect/src/QConnectClient.ts b/clients/client-qconnect/src/QConnectClient.ts index 5f64fb8315b3..37df2657d158 100644 --- a/clients/client-qconnect/src/QConnectClient.ts +++ b/clients/client-qconnect/src/QConnectClient.ts @@ -564,6 +564,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-qconnect/src/runtimeConfig.ts b/clients/client-qconnect/src/runtimeConfig.ts index 560c8025957d..f85088a95af2 100644 --- a/clients/client-qconnect/src/runtimeConfig.ts +++ b/clients/client-qconnect/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: QConnectClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: QConnectClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-qldb-session/src/QLDBSessionClient.ts b/clients/client-qldb-session/src/QLDBSessionClient.ts index 332311fe8cd1..1780a6393bf9 100644 --- a/clients/client-qldb-session/src/QLDBSessionClient.ts +++ b/clients/client-qldb-session/src/QLDBSessionClient.ts @@ -166,6 +166,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-qldb-session/src/runtimeConfig.ts b/clients/client-qldb-session/src/runtimeConfig.ts index 69f0232f3f50..0993c08ddd26 100644 --- a/clients/client-qldb-session/src/runtimeConfig.ts +++ b/clients/client-qldb-session/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: QLDBSessionClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: QLDBSessionClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-qldb/src/QLDBClient.ts b/clients/client-qldb/src/QLDBClient.ts index 8c565d3e9555..5521c5d6a6a6 100644 --- a/clients/client-qldb/src/QLDBClient.ts +++ b/clients/client-qldb/src/QLDBClient.ts @@ -252,6 +252,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-qldb/src/runtimeConfig.ts b/clients/client-qldb/src/runtimeConfig.ts index 632ed6f6a053..2e13c1ee57cc 100644 --- a/clients/client-qldb/src/runtimeConfig.ts +++ b/clients/client-qldb/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: QLDBClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: QLDBClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-quicksight/src/QuickSightClient.ts b/clients/client-quicksight/src/QuickSightClient.ts index 10333d780237..745a7c282515 100644 --- a/clients/client-quicksight/src/QuickSightClient.ts +++ b/clients/client-quicksight/src/QuickSightClient.ts @@ -1167,6 +1167,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-quicksight/src/runtimeConfig.ts b/clients/client-quicksight/src/runtimeConfig.ts index 053bf1854cd0..fb5b192c6e00 100644 --- a/clients/client-quicksight/src/runtimeConfig.ts +++ b/clients/client-quicksight/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: QuickSightClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: QuickSightClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ram/src/RAMClient.ts b/clients/client-ram/src/RAMClient.ts index 1d1868459421..1140c15f6676 100644 --- a/clients/client-ram/src/RAMClient.ts +++ b/clients/client-ram/src/RAMClient.ts @@ -339,6 +339,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ram/src/runtimeConfig.ts b/clients/client-ram/src/runtimeConfig.ts index 7025eb11ae60..3cb70d0d9b67 100644 --- a/clients/client-ram/src/runtimeConfig.ts +++ b/clients/client-ram/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RAMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RAMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rbin/src/RbinClient.ts b/clients/client-rbin/src/RbinClient.ts index 52c2c65e3717..58fde1832be6 100644 --- a/clients/client-rbin/src/RbinClient.ts +++ b/clients/client-rbin/src/RbinClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rbin/src/runtimeConfig.ts b/clients/client-rbin/src/runtimeConfig.ts index defdcab5e75e..781906c10344 100644 --- a/clients/client-rbin/src/runtimeConfig.ts +++ b/clients/client-rbin/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RbinClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RbinClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rds-data/src/RDSDataClient.ts b/clients/client-rds-data/src/RDSDataClient.ts index 7017f805ffbf..ffa3422514ab 100644 --- a/clients/client-rds-data/src/RDSDataClient.ts +++ b/clients/client-rds-data/src/RDSDataClient.ts @@ -189,6 +189,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rds-data/src/runtimeConfig.ts b/clients/client-rds-data/src/runtimeConfig.ts index e6750e3e8db5..3f24edc92520 100644 --- a/clients/client-rds-data/src/runtimeConfig.ts +++ b/clients/client-rds-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RDSDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RDSDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rds/src/RDSClient.ts b/clients/client-rds/src/RDSClient.ts index 891d8a0c9b3b..9466e81749cd 100644 --- a/clients/client-rds/src/RDSClient.ts +++ b/clients/client-rds/src/RDSClient.ts @@ -1005,6 +1005,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rds/src/runtimeConfig.ts b/clients/client-rds/src/runtimeConfig.ts index 354580f86a86..526a75261bf7 100644 --- a/clients/client-rds/src/runtimeConfig.ts +++ b/clients/client-rds/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RDSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RDSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-redshift-data/src/RedshiftDataClient.ts b/clients/client-redshift-data/src/RedshiftDataClient.ts index 610faa6811bf..2d5b47ddb4f4 100644 --- a/clients/client-redshift-data/src/RedshiftDataClient.ts +++ b/clients/client-redshift-data/src/RedshiftDataClient.ts @@ -204,6 +204,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-redshift-data/src/runtimeConfig.ts b/clients/client-redshift-data/src/runtimeConfig.ts index 017b56607641..b0c70cae8c08 100644 --- a/clients/client-redshift-data/src/runtimeConfig.ts +++ b/clients/client-redshift-data/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RedshiftDataClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RedshiftDataClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-redshift-serverless/src/RedshiftServerlessClient.ts b/clients/client-redshift-serverless/src/RedshiftServerlessClient.ts index 0dbeb85c289b..82dbf5d20263 100644 --- a/clients/client-redshift-serverless/src/RedshiftServerlessClient.ts +++ b/clients/client-redshift-serverless/src/RedshiftServerlessClient.ts @@ -411,6 +411,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-redshift-serverless/src/runtimeConfig.ts b/clients/client-redshift-serverless/src/runtimeConfig.ts index ed24115ca5a1..002ae65be8eb 100644 --- a/clients/client-redshift-serverless/src/runtimeConfig.ts +++ b/clients/client-redshift-serverless/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RedshiftServerlessClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RedshiftServerlessClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-redshift/src/RedshiftClient.ts b/clients/client-redshift/src/RedshiftClient.ts index 2bc1e3140c0a..be9edb2e2d9c 100644 --- a/clients/client-redshift/src/RedshiftClient.ts +++ b/clients/client-redshift/src/RedshiftClient.ts @@ -900,6 +900,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-redshift/src/runtimeConfig.ts b/clients/client-redshift/src/runtimeConfig.ts index 75355f197e19..5f04f8c72c31 100644 --- a/clients/client-redshift/src/runtimeConfig.ts +++ b/clients/client-redshift/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RedshiftClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RedshiftClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rekognition/src/RekognitionClient.ts b/clients/client-rekognition/src/RekognitionClient.ts index aae8594b47c9..1f637f2d8d71 100644 --- a/clients/client-rekognition/src/RekognitionClient.ts +++ b/clients/client-rekognition/src/RekognitionClient.ts @@ -486,6 +486,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rekognition/src/runtimeConfig.ts b/clients/client-rekognition/src/runtimeConfig.ts index c4ee0fde4e46..81381b92de2c 100644 --- a/clients/client-rekognition/src/runtimeConfig.ts +++ b/clients/client-rekognition/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RekognitionClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RekognitionClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rekognitionstreaming/src/RekognitionStreamingClient.ts b/clients/client-rekognitionstreaming/src/RekognitionStreamingClient.ts index 6245cb0d917e..dd1a26fa994c 100644 --- a/clients/client-rekognitionstreaming/src/RekognitionStreamingClient.ts +++ b/clients/client-rekognitionstreaming/src/RekognitionStreamingClient.ts @@ -182,6 +182,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rekognitionstreaming/src/runtimeConfig.ts b/clients/client-rekognitionstreaming/src/runtimeConfig.ts index 5e5dc7001469..7d34ed02fa9e 100644 --- a/clients/client-rekognitionstreaming/src/runtimeConfig.ts +++ b/clients/client-rekognitionstreaming/src/runtimeConfig.ts @@ -34,6 +34,7 @@ export const getRuntimeConfig = (config: RekognitionStreamingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -46,19 +47,25 @@ export const getRuntimeConfig = (config: RekognitionStreamingClientConfig) => { createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-repostspace/src/RepostspaceClient.ts b/clients/client-repostspace/src/RepostspaceClient.ts index 88b444026357..4d4f67dcddeb 100644 --- a/clients/client-repostspace/src/RepostspaceClient.ts +++ b/clients/client-repostspace/src/RepostspaceClient.ts @@ -207,6 +207,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-repostspace/src/runtimeConfig.ts b/clients/client-repostspace/src/runtimeConfig.ts index 758c0069c3e2..d7c20b99376a 100644 --- a/clients/client-repostspace/src/runtimeConfig.ts +++ b/clients/client-repostspace/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RepostspaceClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RepostspaceClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-resiliencehub/src/ResiliencehubClient.ts b/clients/client-resiliencehub/src/ResiliencehubClient.ts index 08a87391e2b5..7e77fd5e4257 100644 --- a/clients/client-resiliencehub/src/ResiliencehubClient.ts +++ b/clients/client-resiliencehub/src/ResiliencehubClient.ts @@ -498,6 +498,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-resiliencehub/src/runtimeConfig.ts b/clients/client-resiliencehub/src/runtimeConfig.ts index a965fc22df61..a4fe9c1c2285 100644 --- a/clients/client-resiliencehub/src/runtimeConfig.ts +++ b/clients/client-resiliencehub/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ResiliencehubClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ResiliencehubClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-resource-explorer-2/src/ResourceExplorer2Client.ts b/clients/client-resource-explorer-2/src/ResourceExplorer2Client.ts index 00de49c292c8..2744d19343ba 100644 --- a/clients/client-resource-explorer-2/src/ResourceExplorer2Client.ts +++ b/clients/client-resource-explorer-2/src/ResourceExplorer2Client.ts @@ -255,6 +255,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-resource-explorer-2/src/runtimeConfig.ts b/clients/client-resource-explorer-2/src/runtimeConfig.ts index 4fe1e060e9f8..41b283c263af 100644 --- a/clients/client-resource-explorer-2/src/runtimeConfig.ts +++ b/clients/client-resource-explorer-2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ResourceExplorer2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ResourceExplorer2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPIClient.ts b/clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPIClient.ts index 7ef84a8f0425..d6737804c1f9 100644 --- a/clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPIClient.ts +++ b/clients/client-resource-groups-tagging-api/src/ResourceGroupsTaggingAPIClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts b/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts index b3623950e33b..44b923ec6855 100644 --- a/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts +++ b/clients/client-resource-groups-tagging-api/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ResourceGroupsTaggingAPIClientConfig) = const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ResourceGroupsTaggingAPIClientConfig) = defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-resource-groups/src/ResourceGroupsClient.ts b/clients/client-resource-groups/src/ResourceGroupsClient.ts index 8b585c14b696..d6ec0fb1bd09 100644 --- a/clients/client-resource-groups/src/ResourceGroupsClient.ts +++ b/clients/client-resource-groups/src/ResourceGroupsClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-resource-groups/src/runtimeConfig.ts b/clients/client-resource-groups/src/runtimeConfig.ts index 5798bb071b51..ef073de2069b 100644 --- a/clients/client-resource-groups/src/runtimeConfig.ts +++ b/clients/client-resource-groups/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ResourceGroupsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ResourceGroupsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-robomaker/src/RoboMakerClient.ts b/clients/client-robomaker/src/RoboMakerClient.ts index 725697058f6b..241f14f28481 100644 --- a/clients/client-robomaker/src/RoboMakerClient.ts +++ b/clients/client-robomaker/src/RoboMakerClient.ts @@ -450,6 +450,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-robomaker/src/runtimeConfig.ts b/clients/client-robomaker/src/runtimeConfig.ts index 3a2bc2fec96e..0ffe788605c7 100644 --- a/clients/client-robomaker/src/runtimeConfig.ts +++ b/clients/client-robomaker/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RoboMakerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RoboMakerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rolesanywhere/src/RolesAnywhereClient.ts b/clients/client-rolesanywhere/src/RolesAnywhereClient.ts index cedd82b70c62..9ea76ec0aeb0 100644 --- a/clients/client-rolesanywhere/src/RolesAnywhereClient.ts +++ b/clients/client-rolesanywhere/src/RolesAnywhereClient.ts @@ -270,6 +270,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rolesanywhere/src/runtimeConfig.ts b/clients/client-rolesanywhere/src/runtimeConfig.ts index f2cf2a5ec25a..0669252999b1 100644 --- a/clients/client-rolesanywhere/src/runtimeConfig.ts +++ b/clients/client-rolesanywhere/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RolesAnywhereClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RolesAnywhereClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route-53-domains/src/Route53DomainsClient.ts b/clients/client-route-53-domains/src/Route53DomainsClient.ts index 500b8a1dd09c..5bb40ee6219c 100644 --- a/clients/client-route-53-domains/src/Route53DomainsClient.ts +++ b/clients/client-route-53-domains/src/Route53DomainsClient.ts @@ -333,6 +333,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route-53-domains/src/runtimeConfig.ts b/clients/client-route-53-domains/src/runtimeConfig.ts index 24a81f05f4da..f3afb1d3454b 100644 --- a/clients/client-route-53-domains/src/runtimeConfig.ts +++ b/clients/client-route-53-domains/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53DomainsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53DomainsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route-53/src/Route53Client.ts b/clients/client-route-53/src/Route53Client.ts index c0e6b3289147..e7d410a2fb6a 100644 --- a/clients/client-route-53/src/Route53Client.ts +++ b/clients/client-route-53/src/Route53Client.ts @@ -522,6 +522,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route-53/src/runtimeConfig.ts b/clients/client-route-53/src/runtimeConfig.ts index 49f71fba9ded..a17bcda011be 100644 --- a/clients/client-route-53/src/runtimeConfig.ts +++ b/clients/client-route-53/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route53-recovery-cluster/src/Route53RecoveryClusterClient.ts b/clients/client-route53-recovery-cluster/src/Route53RecoveryClusterClient.ts index b7398b7bdcf3..de7d33ccf58c 100644 --- a/clients/client-route53-recovery-cluster/src/Route53RecoveryClusterClient.ts +++ b/clients/client-route53-recovery-cluster/src/Route53RecoveryClusterClient.ts @@ -189,6 +189,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route53-recovery-cluster/src/runtimeConfig.ts b/clients/client-route53-recovery-cluster/src/runtimeConfig.ts index c343a0b6989b..1a8a2c347f39 100644 --- a/clients/client-route53-recovery-cluster/src/runtimeConfig.ts +++ b/clients/client-route53-recovery-cluster/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53RecoveryClusterClientConfig) => const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53RecoveryClusterClientConfig) => defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfigClient.ts b/clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfigClient.ts index 0c21598e1934..f531368952e8 100644 --- a/clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfigClient.ts +++ b/clients/client-route53-recovery-control-config/src/Route53RecoveryControlConfigClient.ts @@ -261,6 +261,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route53-recovery-control-config/src/runtimeConfig.ts b/clients/client-route53-recovery-control-config/src/runtimeConfig.ts index 3f284bb03da9..b5dbaa1b2089 100644 --- a/clients/client-route53-recovery-control-config/src/runtimeConfig.ts +++ b/clients/client-route53-recovery-control-config/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53RecoveryControlConfigClientConfi const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53RecoveryControlConfigClientConfi defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route53-recovery-readiness/src/Route53RecoveryReadinessClient.ts b/clients/client-route53-recovery-readiness/src/Route53RecoveryReadinessClient.ts index 6f1f6f12f47d..b290eec766ff 100644 --- a/clients/client-route53-recovery-readiness/src/Route53RecoveryReadinessClient.ts +++ b/clients/client-route53-recovery-readiness/src/Route53RecoveryReadinessClient.ts @@ -309,6 +309,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route53-recovery-readiness/src/runtimeConfig.ts b/clients/client-route53-recovery-readiness/src/runtimeConfig.ts index 655d9b3d15cc..61143fd979c0 100644 --- a/clients/client-route53-recovery-readiness/src/runtimeConfig.ts +++ b/clients/client-route53-recovery-readiness/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53RecoveryReadinessClientConfig) = const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53RecoveryReadinessClientConfig) = defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route53profiles/src/Route53ProfilesClient.ts b/clients/client-route53profiles/src/Route53ProfilesClient.ts index 3ec1d59d4021..47145303f9ff 100644 --- a/clients/client-route53profiles/src/Route53ProfilesClient.ts +++ b/clients/client-route53profiles/src/Route53ProfilesClient.ts @@ -240,6 +240,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route53profiles/src/runtimeConfig.ts b/clients/client-route53profiles/src/runtimeConfig.ts index 781ff1efd12d..571e69d32987 100644 --- a/clients/client-route53profiles/src/runtimeConfig.ts +++ b/clients/client-route53profiles/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53ProfilesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53ProfilesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-route53resolver/src/Route53ResolverClient.ts b/clients/client-route53resolver/src/Route53ResolverClient.ts index 94e065f6102a..66efe5202442 100644 --- a/clients/client-route53resolver/src/Route53ResolverClient.ts +++ b/clients/client-route53resolver/src/Route53ResolverClient.ts @@ -531,6 +531,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-route53resolver/src/runtimeConfig.ts b/clients/client-route53resolver/src/runtimeConfig.ts index 16dddd5f08ae..152ff6fd055a 100644 --- a/clients/client-route53resolver/src/runtimeConfig.ts +++ b/clients/client-route53resolver/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: Route53ResolverClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: Route53ResolverClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-rum/src/RUMClient.ts b/clients/client-rum/src/RUMClient.ts index c348acefb78d..6ad74a95e055 100644 --- a/clients/client-rum/src/RUMClient.ts +++ b/clients/client-rum/src/RUMClient.ts @@ -240,6 +240,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-rum/src/runtimeConfig.ts b/clients/client-rum/src/runtimeConfig.ts index 56203a559b08..b93f8ec86e1a 100644 --- a/clients/client-rum/src/runtimeConfig.ts +++ b/clients/client-rum/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: RUMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: RUMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-s3-control/src/S3ControlClient.ts b/clients/client-s3-control/src/S3ControlClient.ts index 8dafd450d332..d59484e1fb0b 100644 --- a/clients/client-s3-control/src/S3ControlClient.ts +++ b/clients/client-s3-control/src/S3ControlClient.ts @@ -651,6 +651,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-s3-control/src/runtimeConfig.ts b/clients/client-s3-control/src/runtimeConfig.ts index bcc22e8df7d6..be2a34ed0007 100644 --- a/clients/client-s3-control/src/runtimeConfig.ts +++ b/clients/client-s3-control/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: S3ControlClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -43,21 +44,27 @@ export const getRuntimeConfig = (config: S3ControlClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, streamHasher: config?.streamHasher ?? streamHasher, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-s3/src/S3Client.ts b/clients/client-s3/src/S3Client.ts index 48562a08d79a..3874ccac881c 100644 --- a/clients/client-s3/src/S3Client.ts +++ b/clients/client-s3/src/S3Client.ts @@ -658,6 +658,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-s3/src/runtimeConfig.ts b/clients/client-s3/src/runtimeConfig.ts index dba642220c78..6798863166de 100644 --- a/clients/client-s3/src/runtimeConfig.ts +++ b/clients/client-s3/src/runtimeConfig.ts @@ -41,6 +41,7 @@ export const getRuntimeConfig = (config: S3ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -52,30 +53,39 @@ export const getRuntimeConfig = (config: S3ClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableS3ExpressSessionAuth: - config?.disableS3ExpressSessionAuth ?? loadNodeConfig(NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS), + config?.disableS3ExpressSessionAuth ?? + loadNodeConfig(NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS, profileConfig), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestChecksumCalculation: - config?.requestChecksumCalculation ?? loadNodeConfig(NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS), + config?.requestChecksumCalculation ?? + loadNodeConfig(NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS, profileConfig), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), responseChecksumValidation: - config?.responseChecksumValidation ?? loadNodeConfig(NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS), + config?.responseChecksumValidation ?? + loadNodeConfig(NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS, profileConfig), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha1: config?.sha1 ?? Hash.bind(null, "sha1"), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS), + sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, profileConfig), streamCollector: config?.streamCollector ?? streamCollector, streamHasher: config?.streamHasher ?? streamHasher, - useArnRegion: config?.useArnRegion ?? loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS), - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useArnRegion: config?.useArnRegion ?? loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS, profileConfig), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-s3outposts/src/S3OutpostsClient.ts b/clients/client-s3outposts/src/S3OutpostsClient.ts index 2dd17154f2b2..9d6f8e100a17 100644 --- a/clients/client-s3outposts/src/S3OutpostsClient.ts +++ b/clients/client-s3outposts/src/S3OutpostsClient.ts @@ -183,6 +183,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-s3outposts/src/runtimeConfig.ts b/clients/client-s3outposts/src/runtimeConfig.ts index 8996ad62c874..bbb88cb6f57b 100644 --- a/clients/client-s3outposts/src/runtimeConfig.ts +++ b/clients/client-s3outposts/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: S3OutpostsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: S3OutpostsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-s3tables/src/S3TablesClient.ts b/clients/client-s3tables/src/S3TablesClient.ts index a1d5adca4eed..9006214b237d 100644 --- a/clients/client-s3tables/src/S3TablesClient.ts +++ b/clients/client-s3tables/src/S3TablesClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-s3tables/src/runtimeConfig.ts b/clients/client-s3tables/src/runtimeConfig.ts index 10b2a54d268b..6054ef59039c 100644 --- a/clients/client-s3tables/src/runtimeConfig.ts +++ b/clients/client-s3tables/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: S3TablesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: S3TablesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntimeClient.ts b/clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntimeClient.ts index 4782167c88cc..5e82bda3cf44 100644 --- a/clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntimeClient.ts +++ b/clients/client-sagemaker-a2i-runtime/src/SageMakerA2IRuntimeClient.ts @@ -180,6 +180,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts index d73c947088ca..b24fab589ea8 100644 --- a/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts +++ b/clients/client-sagemaker-a2i-runtime/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SageMakerA2IRuntimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SageMakerA2IRuntimeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker-edge/src/SagemakerEdgeClient.ts b/clients/client-sagemaker-edge/src/SagemakerEdgeClient.ts index 2d394fb21583..9a5abc6f95d6 100644 --- a/clients/client-sagemaker-edge/src/SagemakerEdgeClient.ts +++ b/clients/client-sagemaker-edge/src/SagemakerEdgeClient.ts @@ -177,6 +177,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker-edge/src/runtimeConfig.ts b/clients/client-sagemaker-edge/src/runtimeConfig.ts index 186fba9d833b..a97539372234 100644 --- a/clients/client-sagemaker-edge/src/runtimeConfig.ts +++ b/clients/client-sagemaker-edge/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SagemakerEdgeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SagemakerEdgeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntimeClient.ts b/clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntimeClient.ts index 18cbbc656c50..d6e77b5ba2b6 100644 --- a/clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntimeClient.ts +++ b/clients/client-sagemaker-featurestore-runtime/src/SageMakerFeatureStoreRuntimeClient.ts @@ -177,6 +177,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts index e988e38a94d8..ba3f5ed9a591 100644 --- a/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts +++ b/clients/client-sagemaker-featurestore-runtime/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SageMakerFeatureStoreRuntimeClientConfi const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SageMakerFeatureStoreRuntimeClientConfi defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker-geospatial/src/SageMakerGeospatialClient.ts b/clients/client-sagemaker-geospatial/src/SageMakerGeospatialClient.ts index 9b0bcfc62c64..d6d7cc6ce091 100644 --- a/clients/client-sagemaker-geospatial/src/SageMakerGeospatialClient.ts +++ b/clients/client-sagemaker-geospatial/src/SageMakerGeospatialClient.ts @@ -271,6 +271,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker-geospatial/src/runtimeConfig.ts b/clients/client-sagemaker-geospatial/src/runtimeConfig.ts index f19e40dbd7e4..3eca5c025f09 100644 --- a/clients/client-sagemaker-geospatial/src/runtimeConfig.ts +++ b/clients/client-sagemaker-geospatial/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SageMakerGeospatialClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SageMakerGeospatialClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts b/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts index c08bfec16107..588feb932cf3 100644 --- a/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts +++ b/clients/client-sagemaker-metrics/src/SageMakerMetricsClient.ts @@ -167,6 +167,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker-metrics/src/runtimeConfig.ts b/clients/client-sagemaker-metrics/src/runtimeConfig.ts index b16afbc2e3da..844e63d12a34 100644 --- a/clients/client-sagemaker-metrics/src/runtimeConfig.ts +++ b/clients/client-sagemaker-metrics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SageMakerMetricsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SageMakerMetricsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker-runtime/src/SageMakerRuntimeClient.ts b/clients/client-sagemaker-runtime/src/SageMakerRuntimeClient.ts index 3b27accd6ab5..be077f1e7a0f 100644 --- a/clients/client-sagemaker-runtime/src/SageMakerRuntimeClient.ts +++ b/clients/client-sagemaker-runtime/src/SageMakerRuntimeClient.ts @@ -186,6 +186,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker-runtime/src/runtimeConfig.ts b/clients/client-sagemaker-runtime/src/runtimeConfig.ts index dba8c4e46008..fe827dffa2cd 100644 --- a/clients/client-sagemaker-runtime/src/runtimeConfig.ts +++ b/clients/client-sagemaker-runtime/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: SageMakerRuntimeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: SageMakerRuntimeClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sagemaker/src/SageMakerClient.ts b/clients/client-sagemaker/src/SageMakerClient.ts index 28eb6fda33a3..567b2c9f00e3 100644 --- a/clients/client-sagemaker/src/SageMakerClient.ts +++ b/clients/client-sagemaker/src/SageMakerClient.ts @@ -1800,6 +1800,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sagemaker/src/runtimeConfig.ts b/clients/client-sagemaker/src/runtimeConfig.ts index b9b0ae0dda8e..581e2219732f 100644 --- a/clients/client-sagemaker/src/runtimeConfig.ts +++ b/clients/client-sagemaker/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SageMakerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SageMakerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-savingsplans/src/SavingsplansClient.ts b/clients/client-savingsplans/src/SavingsplansClient.ts index 74eb0d91f916..1cba015a4bef 100644 --- a/clients/client-savingsplans/src/SavingsplansClient.ts +++ b/clients/client-savingsplans/src/SavingsplansClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-savingsplans/src/runtimeConfig.ts b/clients/client-savingsplans/src/runtimeConfig.ts index 78f4fd21d21f..58afea5d89c9 100644 --- a/clients/client-savingsplans/src/runtimeConfig.ts +++ b/clients/client-savingsplans/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SavingsplansClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SavingsplansClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-scheduler/src/SchedulerClient.ts b/clients/client-scheduler/src/SchedulerClient.ts index 07dae5c48103..6d07dc24a198 100644 --- a/clients/client-scheduler/src/SchedulerClient.ts +++ b/clients/client-scheduler/src/SchedulerClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-scheduler/src/runtimeConfig.ts b/clients/client-scheduler/src/runtimeConfig.ts index d907cf16b2de..568bdeb48763 100644 --- a/clients/client-scheduler/src/runtimeConfig.ts +++ b/clients/client-scheduler/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SchedulerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SchedulerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-schemas/src/SchemasClient.ts b/clients/client-schemas/src/SchemasClient.ts index 2bf3083ba68b..adcc809f2221 100644 --- a/clients/client-schemas/src/SchemasClient.ts +++ b/clients/client-schemas/src/SchemasClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-schemas/src/runtimeConfig.ts b/clients/client-schemas/src/runtimeConfig.ts index d2c510ee224f..8ad92b5ecfcb 100644 --- a/clients/client-schemas/src/runtimeConfig.ts +++ b/clients/client-schemas/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SchemasClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SchemasClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-secrets-manager/src/SecretsManagerClient.ts b/clients/client-secrets-manager/src/SecretsManagerClient.ts index bfd510d75554..2a497fb3de4c 100644 --- a/clients/client-secrets-manager/src/SecretsManagerClient.ts +++ b/clients/client-secrets-manager/src/SecretsManagerClient.ts @@ -258,6 +258,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-secrets-manager/src/runtimeConfig.ts b/clients/client-secrets-manager/src/runtimeConfig.ts index a00a41cf23b3..6d3c2e4ff57d 100644 --- a/clients/client-secrets-manager/src/runtimeConfig.ts +++ b/clients/client-secrets-manager/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SecretsManagerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SecretsManagerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-security-ir/src/SecurityIRClient.ts b/clients/client-security-ir/src/SecurityIRClient.ts index 5a87f8dd8c6a..6d161264c050 100644 --- a/clients/client-security-ir/src/SecurityIRClient.ts +++ b/clients/client-security-ir/src/SecurityIRClient.ts @@ -243,6 +243,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-security-ir/src/runtimeConfig.ts b/clients/client-security-ir/src/runtimeConfig.ts index 1809eff48cff..e947f0938ef7 100644 --- a/clients/client-security-ir/src/runtimeConfig.ts +++ b/clients/client-security-ir/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SecurityIRClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SecurityIRClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-securityhub/src/SecurityHubClient.ts b/clients/client-securityhub/src/SecurityHubClient.ts index 455b4881dde9..c8c4fe2b7661 100644 --- a/clients/client-securityhub/src/SecurityHubClient.ts +++ b/clients/client-securityhub/src/SecurityHubClient.ts @@ -555,6 +555,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-securityhub/src/runtimeConfig.ts b/clients/client-securityhub/src/runtimeConfig.ts index 9ad7d493d0b2..8868c8bfd5b0 100644 --- a/clients/client-securityhub/src/runtimeConfig.ts +++ b/clients/client-securityhub/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SecurityHubClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SecurityHubClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-securitylake/src/SecurityLakeClient.ts b/clients/client-securitylake/src/SecurityLakeClient.ts index 7c5d51e06ef2..f08eff55f53c 100644 --- a/clients/client-securitylake/src/SecurityLakeClient.ts +++ b/clients/client-securitylake/src/SecurityLakeClient.ts @@ -306,6 +306,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-securitylake/src/runtimeConfig.ts b/clients/client-securitylake/src/runtimeConfig.ts index 9dd54cce8ff6..137eb32134dc 100644 --- a/clients/client-securitylake/src/runtimeConfig.ts +++ b/clients/client-securitylake/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SecurityLakeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SecurityLakeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepositoryClient.ts b/clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepositoryClient.ts index a0abf4501712..fb6eb0a7cea9 100644 --- a/clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepositoryClient.ts +++ b/clients/client-serverlessapplicationrepository/src/ServerlessApplicationRepositoryClient.ts @@ -231,6 +231,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts b/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts index 5739fa5ae49f..1702388a02c2 100644 --- a/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts +++ b/clients/client-serverlessapplicationrepository/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ServerlessApplicationRepositoryClientCo const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ServerlessApplicationRepositoryClientCo defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistryClient.ts b/clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistryClient.ts index 621ce3285c09..c56120b661e2 100644 --- a/clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistryClient.ts +++ b/clients/client-service-catalog-appregistry/src/ServiceCatalogAppRegistryClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-service-catalog-appregistry/src/runtimeConfig.ts b/clients/client-service-catalog-appregistry/src/runtimeConfig.ts index 587fd676130d..2af2b2e456f0 100644 --- a/clients/client-service-catalog-appregistry/src/runtimeConfig.ts +++ b/clients/client-service-catalog-appregistry/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ServiceCatalogAppRegistryClientConfig) const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ServiceCatalogAppRegistryClientConfig) defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-service-catalog/src/ServiceCatalogClient.ts b/clients/client-service-catalog/src/ServiceCatalogClient.ts index 65a2288942ac..26ab7553df74 100644 --- a/clients/client-service-catalog/src/ServiceCatalogClient.ts +++ b/clients/client-service-catalog/src/ServiceCatalogClient.ts @@ -630,6 +630,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-service-catalog/src/runtimeConfig.ts b/clients/client-service-catalog/src/runtimeConfig.ts index b6be2f485a96..d13fab34c21e 100644 --- a/clients/client-service-catalog/src/runtimeConfig.ts +++ b/clients/client-service-catalog/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ServiceCatalogClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ServiceCatalogClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-service-quotas/src/ServiceQuotasClient.ts b/clients/client-service-quotas/src/ServiceQuotasClient.ts index bed2f6cab966..fcd5fa56bc35 100644 --- a/clients/client-service-quotas/src/ServiceQuotasClient.ts +++ b/clients/client-service-quotas/src/ServiceQuotasClient.ts @@ -264,6 +264,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-service-quotas/src/runtimeConfig.ts b/clients/client-service-quotas/src/runtimeConfig.ts index e003cfa0cacd..727d59473210 100644 --- a/clients/client-service-quotas/src/runtimeConfig.ts +++ b/clients/client-service-quotas/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ServiceQuotasClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ServiceQuotasClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-servicediscovery/src/ServiceDiscoveryClient.ts b/clients/client-servicediscovery/src/ServiceDiscoveryClient.ts index ea90dfcdd3ea..949b2479e247 100644 --- a/clients/client-servicediscovery/src/ServiceDiscoveryClient.ts +++ b/clients/client-servicediscovery/src/ServiceDiscoveryClient.ts @@ -294,6 +294,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-servicediscovery/src/commands/UpdatePrivateDnsNamespaceCommand.ts b/clients/client-servicediscovery/src/commands/UpdatePrivateDnsNamespaceCommand.ts index 8d92fd14d905..af5a3f9c940d 100644 --- a/clients/client-servicediscovery/src/commands/UpdatePrivateDnsNamespaceCommand.ts +++ b/clients/client-servicediscovery/src/commands/UpdatePrivateDnsNamespaceCommand.ts @@ -82,9 +82,9 @@ export interface UpdatePrivateDnsNamespaceCommandOutput extends UpdatePrivateDns *

Base exception class for all service exceptions from ServiceDiscovery service.

* * @public - * @example To update a private DNS namespace + * @example To update a public DNS namespace * ```javascript - * // The following example updates the description of a private DNS namespace. + * // The following example updates the description of a public DNS namespace. * const input = { * "Id": "ns-bk3aEXAMPLE", * "Namespace": { @@ -96,15 +96,15 @@ export interface UpdatePrivateDnsNamespaceCommandOutput extends UpdatePrivateDns * const response = await client.send(command); * /* response == * { - * "OperationId": "ft52xe2koxhoeormaceymagglsdjyvEXAMPLE" + * "OperationId": "ft52xe2koxhoeormaceymagglsdjEXAMPLE" * } * *\/ - * // example id: to-update-a-private-dns-namespace-1712868389604 + * // example id: to-update-a-public-dns-namespace-1712868389604 * ``` * - * @example To update a public DNS namespace + * @example To update a private DNS namespace * ```javascript - * // The following example updates the description of a public DNS namespace. + * // The following example updates the description of a private DNS namespace. * const input = { * "Id": "ns-bk3aEXAMPLE", * "Namespace": { @@ -116,10 +116,10 @@ export interface UpdatePrivateDnsNamespaceCommandOutput extends UpdatePrivateDns * const response = await client.send(command); * /* response == * { - * "OperationId": "ft52xe2koxhoeormaceymagglsdjEXAMPLE" + * "OperationId": "ft52xe2koxhoeormaceymagglsdjyvEXAMPLE" * } * *\/ - * // example id: to-update-a-public-dns-namespace-1712868389604 + * // example id: to-update-a-private-dns-namespace-1712868389604 * ``` * */ diff --git a/clients/client-servicediscovery/src/runtimeConfig.ts b/clients/client-servicediscovery/src/runtimeConfig.ts index 4a4d772f68b3..61e1ab0e141f 100644 --- a/clients/client-servicediscovery/src/runtimeConfig.ts +++ b/clients/client-servicediscovery/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ServiceDiscoveryClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ServiceDiscoveryClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ses/src/SESClient.ts b/clients/client-ses/src/SESClient.ts index 2cd225c75098..77750192db90 100644 --- a/clients/client-ses/src/SESClient.ts +++ b/clients/client-ses/src/SESClient.ts @@ -528,6 +528,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ses/src/runtimeConfig.ts b/clients/client-ses/src/runtimeConfig.ts index 2a8f7c6ccfb0..be902177c72b 100644 --- a/clients/client-ses/src/runtimeConfig.ts +++ b/clients/client-ses/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SESClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SESClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sesv2/src/SESv2Client.ts b/clients/client-sesv2/src/SESv2Client.ts index a0f521919804..dd7d053523d5 100644 --- a/clients/client-sesv2/src/SESv2Client.ts +++ b/clients/client-sesv2/src/SESv2Client.ts @@ -648,6 +648,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sesv2/src/runtimeConfig.ts b/clients/client-sesv2/src/runtimeConfig.ts index 196d53267f54..54283efcaacd 100644 --- a/clients/client-sesv2/src/runtimeConfig.ts +++ b/clients/client-sesv2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SESv2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,20 +43,26 @@ export const getRuntimeConfig = (config: SESv2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS), + sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, profileConfig), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sfn/src/SFNClient.ts b/clients/client-sfn/src/SFNClient.ts index 66c0bd2b747a..15409d908731 100644 --- a/clients/client-sfn/src/SFNClient.ts +++ b/clients/client-sfn/src/SFNClient.ts @@ -315,6 +315,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sfn/src/runtimeConfig.ts b/clients/client-sfn/src/runtimeConfig.ts index 0df1c8aba325..67982392db90 100644 --- a/clients/client-sfn/src/runtimeConfig.ts +++ b/clients/client-sfn/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SFNClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SFNClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-shield/src/ShieldClient.ts b/clients/client-shield/src/ShieldClient.ts index 763f73af52f9..7821ed0c1203 100644 --- a/clients/client-shield/src/ShieldClient.ts +++ b/clients/client-shield/src/ShieldClient.ts @@ -342,6 +342,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-shield/src/runtimeConfig.ts b/clients/client-shield/src/runtimeConfig.ts index 02ceb5ae5296..ab4b3f42f46d 100644 --- a/clients/client-shield/src/runtimeConfig.ts +++ b/clients/client-shield/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: ShieldClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: ShieldClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-signer/src/SignerClient.ts b/clients/client-signer/src/SignerClient.ts index b402563608c0..79bba92c605f 100644 --- a/clients/client-signer/src/SignerClient.ts +++ b/clients/client-signer/src/SignerClient.ts @@ -249,6 +249,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-signer/src/runtimeConfig.ts b/clients/client-signer/src/runtimeConfig.ts index 87b8efc32743..0b435df410b3 100644 --- a/clients/client-signer/src/runtimeConfig.ts +++ b/clients/client-signer/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SignerClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SignerClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-simspaceweaver/src/SimSpaceWeaverClient.ts b/clients/client-simspaceweaver/src/SimSpaceWeaverClient.ts index 1a760f631f53..64911d72f81f 100644 --- a/clients/client-simspaceweaver/src/SimSpaceWeaverClient.ts +++ b/clients/client-simspaceweaver/src/SimSpaceWeaverClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-simspaceweaver/src/runtimeConfig.ts b/clients/client-simspaceweaver/src/runtimeConfig.ts index 6c9601d33278..6d31a2f15ef2 100644 --- a/clients/client-simspaceweaver/src/runtimeConfig.ts +++ b/clients/client-simspaceweaver/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SimSpaceWeaverClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SimSpaceWeaverClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sms/src/SMSClient.ts b/clients/client-sms/src/SMSClient.ts index 972bfc70f3db..8319822a9ae4 100644 --- a/clients/client-sms/src/SMSClient.ts +++ b/clients/client-sms/src/SMSClient.ts @@ -330,6 +330,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sms/src/runtimeConfig.ts b/clients/client-sms/src/runtimeConfig.ts index e2447f5b79a2..bcef0835c3cf 100644 --- a/clients/client-sms/src/runtimeConfig.ts +++ b/clients/client-sms/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SMSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SMSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-snow-device-management/src/SnowDeviceManagementClient.ts b/clients/client-snow-device-management/src/SnowDeviceManagementClient.ts index f225900a9b5b..fd8c8d490217 100644 --- a/clients/client-snow-device-management/src/SnowDeviceManagementClient.ts +++ b/clients/client-snow-device-management/src/SnowDeviceManagementClient.ts @@ -213,6 +213,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-snow-device-management/src/runtimeConfig.ts b/clients/client-snow-device-management/src/runtimeConfig.ts index 4c5d3a69d0aa..d1ca304b80c9 100644 --- a/clients/client-snow-device-management/src/runtimeConfig.ts +++ b/clients/client-snow-device-management/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SnowDeviceManagementClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SnowDeviceManagementClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-snowball/src/SnowballClient.ts b/clients/client-snowball/src/SnowballClient.ts index 2b99bbef3a64..52c3a3ebb037 100644 --- a/clients/client-snowball/src/SnowballClient.ts +++ b/clients/client-snowball/src/SnowballClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-snowball/src/runtimeConfig.ts b/clients/client-snowball/src/runtimeConfig.ts index 524f2bcbc6fc..2ced6350ebe7 100644 --- a/clients/client-snowball/src/runtimeConfig.ts +++ b/clients/client-snowball/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SnowballClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SnowballClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sns/src/SNSClient.ts b/clients/client-sns/src/SNSClient.ts index c9fb423ed941..2ae088340745 100644 --- a/clients/client-sns/src/SNSClient.ts +++ b/clients/client-sns/src/SNSClient.ts @@ -363,6 +363,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sns/src/runtimeConfig.ts b/clients/client-sns/src/runtimeConfig.ts index 4779697be4ac..157dbefd4bed 100644 --- a/clients/client-sns/src/runtimeConfig.ts +++ b/clients/client-sns/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SNSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SNSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-socialmessaging/src/SocialMessagingClient.ts b/clients/client-socialmessaging/src/SocialMessagingClient.ts index e5d1b08be065..1118e749d5a3 100644 --- a/clients/client-socialmessaging/src/SocialMessagingClient.ts +++ b/clients/client-socialmessaging/src/SocialMessagingClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-socialmessaging/src/runtimeConfig.ts b/clients/client-socialmessaging/src/runtimeConfig.ts index 6047ba3d0c14..8ff042fdef3a 100644 --- a/clients/client-socialmessaging/src/runtimeConfig.ts +++ b/clients/client-socialmessaging/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SocialMessagingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SocialMessagingClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sqs/src/SQSClient.ts b/clients/client-sqs/src/SQSClient.ts index 8756c3901975..8a9db52b0b69 100644 --- a/clients/client-sqs/src/SQSClient.ts +++ b/clients/client-sqs/src/SQSClient.ts @@ -260,6 +260,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sqs/src/runtimeConfig.ts b/clients/client-sqs/src/runtimeConfig.ts index ffad5c5f6ca3..165e4c40ddaf 100644 --- a/clients/client-sqs/src/runtimeConfig.ts +++ b/clients/client-sqs/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: SQSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -43,20 +44,26 @@ export const getRuntimeConfig = (config: SQSClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ssm-contacts/src/SSMContactsClient.ts b/clients/client-ssm-contacts/src/SSMContactsClient.ts index 38cb49b8bda0..c30bd561d400 100644 --- a/clients/client-ssm-contacts/src/SSMContactsClient.ts +++ b/clients/client-ssm-contacts/src/SSMContactsClient.ts @@ -324,6 +324,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ssm-contacts/src/runtimeConfig.ts b/clients/client-ssm-contacts/src/runtimeConfig.ts index 6586ea4dfa35..49d7168e4b36 100644 --- a/clients/client-ssm-contacts/src/runtimeConfig.ts +++ b/clients/client-ssm-contacts/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SSMContactsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SSMContactsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ssm-incidents/src/SSMIncidentsClient.ts b/clients/client-ssm-incidents/src/SSMIncidentsClient.ts index b7de207cf1c1..ccd0d91e38f5 100644 --- a/clients/client-ssm-incidents/src/SSMIncidentsClient.ts +++ b/clients/client-ssm-incidents/src/SSMIncidentsClient.ts @@ -306,6 +306,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ssm-incidents/src/runtimeConfig.ts b/clients/client-ssm-incidents/src/runtimeConfig.ts index 20b0c3d8aa83..7efcc8d80114 100644 --- a/clients/client-ssm-incidents/src/runtimeConfig.ts +++ b/clients/client-ssm-incidents/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SSMIncidentsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SSMIncidentsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ssm-quicksetup/src/SSMQuickSetupClient.ts b/clients/client-ssm-quicksetup/src/SSMQuickSetupClient.ts index f3090461611c..80921e70c754 100644 --- a/clients/client-ssm-quicksetup/src/SSMQuickSetupClient.ts +++ b/clients/client-ssm-quicksetup/src/SSMQuickSetupClient.ts @@ -234,6 +234,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ssm-quicksetup/src/runtimeConfig.ts b/clients/client-ssm-quicksetup/src/runtimeConfig.ts index 5ce599356598..4e90b6e31f2b 100644 --- a/clients/client-ssm-quicksetup/src/runtimeConfig.ts +++ b/clients/client-ssm-quicksetup/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SSMQuickSetupClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SSMQuickSetupClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ssm-sap/src/SsmSapClient.ts b/clients/client-ssm-sap/src/SsmSapClient.ts index 049719384e3a..7c7e7fe130fd 100644 --- a/clients/client-ssm-sap/src/SsmSapClient.ts +++ b/clients/client-ssm-sap/src/SsmSapClient.ts @@ -255,6 +255,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ssm-sap/src/runtimeConfig.ts b/clients/client-ssm-sap/src/runtimeConfig.ts index ce1e7f9a06f9..6212128897de 100644 --- a/clients/client-ssm-sap/src/runtimeConfig.ts +++ b/clients/client-ssm-sap/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SsmSapClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SsmSapClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-ssm/src/SSMClient.ts b/clients/client-ssm/src/SSMClient.ts index 1720a3719e90..268c7c2f7d99 100644 --- a/clients/client-ssm/src/SSMClient.ts +++ b/clients/client-ssm/src/SSMClient.ts @@ -882,6 +882,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-ssm/src/runtimeConfig.ts b/clients/client-ssm/src/runtimeConfig.ts index af346039e69b..6e18dcdad039 100644 --- a/clients/client-ssm/src/runtimeConfig.ts +++ b/clients/client-ssm/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SSMClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SSMClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sso-admin/src/SSOAdminClient.ts b/clients/client-sso-admin/src/SSOAdminClient.ts index f9fbd4bfb573..7e8d7fa32492 100644 --- a/clients/client-sso-admin/src/SSOAdminClient.ts +++ b/clients/client-sso-admin/src/SSOAdminClient.ts @@ -567,6 +567,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sso-admin/src/runtimeConfig.ts b/clients/client-sso-admin/src/runtimeConfig.ts index 7da63adc626d..611eaed82f83 100644 --- a/clients/client-sso-admin/src/runtimeConfig.ts +++ b/clients/client-sso-admin/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SSOAdminClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SSOAdminClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sso-oidc/src/SSOOIDCClient.ts b/clients/client-sso-oidc/src/SSOOIDCClient.ts index 902d23f879f0..24f79509c0ec 100644 --- a/clients/client-sso-oidc/src/SSOOIDCClient.ts +++ b/clients/client-sso-oidc/src/SSOOIDCClient.ts @@ -180,6 +180,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sso-oidc/src/runtimeConfig.ts b/clients/client-sso-oidc/src/runtimeConfig.ts index 1182b791e4fa..30c9d5d16556 100644 --- a/clients/client-sso-oidc/src/runtimeConfig.ts +++ b/clients/client-sso-oidc/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SSOOIDCClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SSOOIDCClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sso/src/SSOClient.ts b/clients/client-sso/src/SSOClient.ts index 668d9ddfff46..c52816af4fb4 100644 --- a/clients/client-sso/src/SSOClient.ts +++ b/clients/client-sso/src/SSOClient.ts @@ -176,6 +176,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sso/src/runtimeConfig.ts b/clients/client-sso/src/runtimeConfig.ts index e993b3d5a505..e06676755a0e 100644 --- a/clients/client-sso/src/runtimeConfig.ts +++ b/clients/client-sso/src/runtimeConfig.ts @@ -31,6 +31,7 @@ export const getRuntimeConfig = (config: SSOClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -40,19 +41,25 @@ export const getRuntimeConfig = (config: SSOClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-storage-gateway/src/StorageGatewayClient.ts b/clients/client-storage-gateway/src/StorageGatewayClient.ts index e4d6b726970e..b7c038e7c6dd 100644 --- a/clients/client-storage-gateway/src/StorageGatewayClient.ts +++ b/clients/client-storage-gateway/src/StorageGatewayClient.ts @@ -588,6 +588,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-storage-gateway/src/runtimeConfig.ts b/clients/client-storage-gateway/src/runtimeConfig.ts index dff1cdbaa4a0..d98fac594ca2 100644 --- a/clients/client-storage-gateway/src/runtimeConfig.ts +++ b/clients/client-storage-gateway/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: StorageGatewayClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: StorageGatewayClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-sts/src/STSClient.ts b/clients/client-sts/src/STSClient.ts index 4fb5bfb439da..7aa6e66d5928 100644 --- a/clients/client-sts/src/STSClient.ts +++ b/clients/client-sts/src/STSClient.ts @@ -198,6 +198,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-sts/src/runtimeConfig.ts b/clients/client-sts/src/runtimeConfig.ts index 215609bb5d02..ac32e4bde481 100644 --- a/clients/client-sts/src/runtimeConfig.ts +++ b/clients/client-sts/src/runtimeConfig.ts @@ -34,6 +34,7 @@ export const getRuntimeConfig = (config: STSClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -59,19 +60,25 @@ export const getRuntimeConfig = (config: STSClientConfig) => { signer: new NoAuthSigner(), }, ], - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-supplychain/src/SupplyChainClient.ts b/clients/client-supplychain/src/SupplyChainClient.ts index fc0b0427869f..075f18bb29ff 100644 --- a/clients/client-supplychain/src/SupplyChainClient.ts +++ b/clients/client-supplychain/src/SupplyChainClient.ts @@ -267,6 +267,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-supplychain/src/runtimeConfig.ts b/clients/client-supplychain/src/runtimeConfig.ts index 00fc1457a1a9..a48f03653e57 100644 --- a/clients/client-supplychain/src/runtimeConfig.ts +++ b/clients/client-supplychain/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SupplyChainClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SupplyChainClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-support-app/src/SupportAppClient.ts b/clients/client-support-app/src/SupportAppClient.ts index 252d38427f99..0c4336f60e32 100644 --- a/clients/client-support-app/src/SupportAppClient.ts +++ b/clients/client-support-app/src/SupportAppClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-support-app/src/runtimeConfig.ts b/clients/client-support-app/src/runtimeConfig.ts index 316a5d5be56c..2b8bc214b62c 100644 --- a/clients/client-support-app/src/runtimeConfig.ts +++ b/clients/client-support-app/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SupportAppClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SupportAppClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-support/src/SupportClient.ts b/clients/client-support/src/SupportClient.ts index 81187b1878eb..08e8caeaa17c 100644 --- a/clients/client-support/src/SupportClient.ts +++ b/clients/client-support/src/SupportClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-support/src/runtimeConfig.ts b/clients/client-support/src/runtimeConfig.ts index b823cbfed4b1..24556b95f954 100644 --- a/clients/client-support/src/runtimeConfig.ts +++ b/clients/client-support/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SupportClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SupportClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-swf/src/SWFClient.ts b/clients/client-swf/src/SWFClient.ts index 612d39cace78..9cb9d14c8cea 100644 --- a/clients/client-swf/src/SWFClient.ts +++ b/clients/client-swf/src/SWFClient.ts @@ -366,6 +366,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-swf/src/runtimeConfig.ts b/clients/client-swf/src/runtimeConfig.ts index d6e3fdc19226..73f9c163611f 100644 --- a/clients/client-swf/src/runtimeConfig.ts +++ b/clients/client-swf/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SWFClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SWFClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-synthetics/src/SyntheticsClient.ts b/clients/client-synthetics/src/SyntheticsClient.ts index d376ff607f7e..b378d353c882 100644 --- a/clients/client-synthetics/src/SyntheticsClient.ts +++ b/clients/client-synthetics/src/SyntheticsClient.ts @@ -243,6 +243,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-synthetics/src/runtimeConfig.ts b/clients/client-synthetics/src/runtimeConfig.ts index 86ef13fafc3b..a84381ce214f 100644 --- a/clients/client-synthetics/src/runtimeConfig.ts +++ b/clients/client-synthetics/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: SyntheticsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: SyntheticsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-taxsettings/src/TaxSettingsClient.ts b/clients/client-taxsettings/src/TaxSettingsClient.ts index 8e29f1b12eed..2c94131a59e8 100644 --- a/clients/client-taxsettings/src/TaxSettingsClient.ts +++ b/clients/client-taxsettings/src/TaxSettingsClient.ts @@ -243,6 +243,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-taxsettings/src/runtimeConfig.ts b/clients/client-taxsettings/src/runtimeConfig.ts index db35ad44a3bc..d01d41c3f495 100644 --- a/clients/client-taxsettings/src/runtimeConfig.ts +++ b/clients/client-taxsettings/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TaxSettingsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TaxSettingsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-textract/src/TextractClient.ts b/clients/client-textract/src/TextractClient.ts index db05a14a0c8c..011de79bfee8 100644 --- a/clients/client-textract/src/TextractClient.ts +++ b/clients/client-textract/src/TextractClient.ts @@ -273,6 +273,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-textract/src/runtimeConfig.ts b/clients/client-textract/src/runtimeConfig.ts index ad1eadba249d..547d57a9fcca 100644 --- a/clients/client-textract/src/runtimeConfig.ts +++ b/clients/client-textract/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TextractClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TextractClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-timestream-influxdb/src/TimestreamInfluxDBClient.ts b/clients/client-timestream-influxdb/src/TimestreamInfluxDBClient.ts index 41b6fd1dcb14..792beb3fb625 100644 --- a/clients/client-timestream-influxdb/src/TimestreamInfluxDBClient.ts +++ b/clients/client-timestream-influxdb/src/TimestreamInfluxDBClient.ts @@ -210,6 +210,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-timestream-influxdb/src/runtimeConfig.ts b/clients/client-timestream-influxdb/src/runtimeConfig.ts index c294ede460e8..d4ccc14dfc0a 100644 --- a/clients/client-timestream-influxdb/src/runtimeConfig.ts +++ b/clients/client-timestream-influxdb/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TimestreamInfluxDBClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TimestreamInfluxDBClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-timestream-query/src/TimestreamQueryClient.ts b/clients/client-timestream-query/src/TimestreamQueryClient.ts index 34e332ad8a57..9b54daf2b887 100644 --- a/clients/client-timestream-query/src/TimestreamQueryClient.ts +++ b/clients/client-timestream-query/src/TimestreamQueryClient.ts @@ -246,6 +246,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-timestream-query/src/runtimeConfig.ts b/clients/client-timestream-query/src/runtimeConfig.ts index 968332b4769a..8dacaaf2478f 100644 --- a/clients/client-timestream-query/src/runtimeConfig.ts +++ b/clients/client-timestream-query/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: TimestreamQueryClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,20 +45,26 @@ export const getRuntimeConfig = (config: TimestreamQueryClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), endpointDiscoveryEnabledProvider: - config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS, profileConfig), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-timestream-write/src/TimestreamWriteClient.ts b/clients/client-timestream-write/src/TimestreamWriteClient.ts index 0cde75e2ce8d..25936415a48e 100644 --- a/clients/client-timestream-write/src/TimestreamWriteClient.ts +++ b/clients/client-timestream-write/src/TimestreamWriteClient.ts @@ -243,6 +243,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-timestream-write/src/runtimeConfig.ts b/clients/client-timestream-write/src/runtimeConfig.ts index 402c27d2e013..533642092ba9 100644 --- a/clients/client-timestream-write/src/runtimeConfig.ts +++ b/clients/client-timestream-write/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: TimestreamWriteClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,20 +45,26 @@ export const getRuntimeConfig = (config: TimestreamWriteClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), endpointDiscoveryEnabledProvider: - config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.endpointDiscoveryEnabledProvider ?? loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS, profileConfig), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-tnb/src/TnbClient.ts b/clients/client-tnb/src/TnbClient.ts index b91aef54aa1e..6c2e4ae22f61 100644 --- a/clients/client-tnb/src/TnbClient.ts +++ b/clients/client-tnb/src/TnbClient.ts @@ -357,6 +357,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-tnb/src/runtimeConfig.ts b/clients/client-tnb/src/runtimeConfig.ts index 89548207dbf6..ccf9eb318f1d 100644 --- a/clients/client-tnb/src/runtimeConfig.ts +++ b/clients/client-tnb/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TnbClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TnbClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-transcribe-streaming/src/TranscribeStreamingClient.ts b/clients/client-transcribe-streaming/src/TranscribeStreamingClient.ts index f72b683dafa9..112508f8e3f3 100644 --- a/clients/client-transcribe-streaming/src/TranscribeStreamingClient.ts +++ b/clients/client-transcribe-streaming/src/TranscribeStreamingClient.ts @@ -196,6 +196,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-transcribe-streaming/src/runtimeConfig.ts b/clients/client-transcribe-streaming/src/runtimeConfig.ts index 34f81b3edbc5..84590fd67ce8 100644 --- a/clients/client-transcribe-streaming/src/runtimeConfig.ts +++ b/clients/client-transcribe-streaming/src/runtimeConfig.ts @@ -34,6 +34,7 @@ export const getRuntimeConfig = (config: TranscribeStreamingClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -46,21 +47,27 @@ export const getRuntimeConfig = (config: TranscribeStreamingClientConfig) => { createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider, eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider, - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create( config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true })) ), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-transcribe/src/TranscribeClient.ts b/clients/client-transcribe/src/TranscribeClient.ts index df75d040f500..0827297474ff 100644 --- a/clients/client-transcribe/src/TranscribeClient.ts +++ b/clients/client-transcribe/src/TranscribeClient.ts @@ -399,6 +399,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-transcribe/src/runtimeConfig.ts b/clients/client-transcribe/src/runtimeConfig.ts index c832f0eed6c3..ccdd39f7a05b 100644 --- a/clients/client-transcribe/src/runtimeConfig.ts +++ b/clients/client-transcribe/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TranscribeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TranscribeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-transfer/src/TransferClient.ts b/clients/client-transfer/src/TransferClient.ts index 236de99174c2..6791999fe720 100644 --- a/clients/client-transfer/src/TransferClient.ts +++ b/clients/client-transfer/src/TransferClient.ts @@ -405,6 +405,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-transfer/src/runtimeConfig.ts b/clients/client-transfer/src/runtimeConfig.ts index fcdf80294fa3..1f55ce5e6219 100644 --- a/clients/client-transfer/src/runtimeConfig.ts +++ b/clients/client-transfer/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TransferClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TransferClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-translate/src/TranslateClient.ts b/clients/client-translate/src/TranslateClient.ts index be48f95ca38d..b243b91b405b 100644 --- a/clients/client-translate/src/TranslateClient.ts +++ b/clients/client-translate/src/TranslateClient.ts @@ -237,6 +237,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-translate/src/runtimeConfig.ts b/clients/client-translate/src/runtimeConfig.ts index 0b7b467706eb..fabf88b89a0a 100644 --- a/clients/client-translate/src/runtimeConfig.ts +++ b/clients/client-translate/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TranslateClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TranslateClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts b/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts index 1aa201faa49d..be9bd80fcd31 100644 --- a/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts +++ b/clients/client-trustedadvisor/src/TrustedAdvisorClient.ts @@ -225,6 +225,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-trustedadvisor/src/runtimeConfig.ts b/clients/client-trustedadvisor/src/runtimeConfig.ts index 0961a22b5555..cfae65e97f37 100644 --- a/clients/client-trustedadvisor/src/runtimeConfig.ts +++ b/clients/client-trustedadvisor/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: TrustedAdvisorClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: TrustedAdvisorClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-verifiedpermissions/src/VerifiedPermissionsClient.ts b/clients/client-verifiedpermissions/src/VerifiedPermissionsClient.ts index b3fac0646891..0dcd4b2fc64e 100644 --- a/clients/client-verifiedpermissions/src/VerifiedPermissionsClient.ts +++ b/clients/client-verifiedpermissions/src/VerifiedPermissionsClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-verifiedpermissions/src/runtimeConfig.ts b/clients/client-verifiedpermissions/src/runtimeConfig.ts index b523fbe2e696..7d89be182a8c 100644 --- a/clients/client-verifiedpermissions/src/runtimeConfig.ts +++ b/clients/client-verifiedpermissions/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: VerifiedPermissionsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: VerifiedPermissionsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-voice-id/src/VoiceIDClient.ts b/clients/client-voice-id/src/VoiceIDClient.ts index 756646b1d246..5d23ece0cbf5 100644 --- a/clients/client-voice-id/src/VoiceIDClient.ts +++ b/clients/client-voice-id/src/VoiceIDClient.ts @@ -276,6 +276,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-voice-id/src/runtimeConfig.ts b/clients/client-voice-id/src/runtimeConfig.ts index f45181156c66..8baad8495653 100644 --- a/clients/client-voice-id/src/runtimeConfig.ts +++ b/clients/client-voice-id/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: VoiceIDClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: VoiceIDClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-vpc-lattice/src/VPCLatticeClient.ts b/clients/client-vpc-lattice/src/VPCLatticeClient.ts index e104da92f25e..18efe18d73e9 100644 --- a/clients/client-vpc-lattice/src/VPCLatticeClient.ts +++ b/clients/client-vpc-lattice/src/VPCLatticeClient.ts @@ -480,6 +480,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-vpc-lattice/src/runtimeConfig.ts b/clients/client-vpc-lattice/src/runtimeConfig.ts index 86e4eb7206fa..fd63ef7a960d 100644 --- a/clients/client-vpc-lattice/src/runtimeConfig.ts +++ b/clients/client-vpc-lattice/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: VPCLatticeClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: VPCLatticeClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-waf-regional/src/WAFRegionalClient.ts b/clients/client-waf-regional/src/WAFRegionalClient.ts index 287fb64b5cbc..a55c30c9e226 100644 --- a/clients/client-waf-regional/src/WAFRegionalClient.ts +++ b/clients/client-waf-regional/src/WAFRegionalClient.ts @@ -513,6 +513,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-waf-regional/src/runtimeConfig.ts b/clients/client-waf-regional/src/runtimeConfig.ts index d8668a1cd8cd..b5cf54402bcb 100644 --- a/clients/client-waf-regional/src/runtimeConfig.ts +++ b/clients/client-waf-regional/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WAFRegionalClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WAFRegionalClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-waf/src/WAFClient.ts b/clients/client-waf/src/WAFClient.ts index a8b0c899aee5..5eede33a872c 100644 --- a/clients/client-waf/src/WAFClient.ts +++ b/clients/client-waf/src/WAFClient.ts @@ -495,6 +495,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-waf/src/runtimeConfig.ts b/clients/client-waf/src/runtimeConfig.ts index 17a8776dafa6..7b0bd3764240 100644 --- a/clients/client-waf/src/runtimeConfig.ts +++ b/clients/client-waf/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WAFClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WAFClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-wafv2/src/WAFV2Client.ts b/clients/client-wafv2/src/WAFV2Client.ts index f9d9b26fbf27..f612247e7fd8 100644 --- a/clients/client-wafv2/src/WAFV2Client.ts +++ b/clients/client-wafv2/src/WAFV2Client.ts @@ -408,6 +408,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-wafv2/src/runtimeConfig.ts b/clients/client-wafv2/src/runtimeConfig.ts index c3d924d08114..bed9e7b42efa 100644 --- a/clients/client-wafv2/src/runtimeConfig.ts +++ b/clients/client-wafv2/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WAFV2ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WAFV2ClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-wellarchitected/src/WellArchitectedClient.ts b/clients/client-wellarchitected/src/WellArchitectedClient.ts index 271ae7ac0d91..5e262897a998 100644 --- a/clients/client-wellarchitected/src/WellArchitectedClient.ts +++ b/clients/client-wellarchitected/src/WellArchitectedClient.ts @@ -459,6 +459,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-wellarchitected/src/runtimeConfig.ts b/clients/client-wellarchitected/src/runtimeConfig.ts index 5703869595d2..f132d6570b93 100644 --- a/clients/client-wellarchitected/src/runtimeConfig.ts +++ b/clients/client-wellarchitected/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WellArchitectedClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WellArchitectedClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-wisdom/src/WisdomClient.ts b/clients/client-wisdom/src/WisdomClient.ts index 742a8a86cf4f..01280363e775 100644 --- a/clients/client-wisdom/src/WisdomClient.ts +++ b/clients/client-wisdom/src/WisdomClient.ts @@ -330,6 +330,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-wisdom/src/runtimeConfig.ts b/clients/client-wisdom/src/runtimeConfig.ts index 6ce30df261f1..f1b3eb0cf0c6 100644 --- a/clients/client-wisdom/src/runtimeConfig.ts +++ b/clients/client-wisdom/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WisdomClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WisdomClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-workdocs/src/WorkDocsClient.ts b/clients/client-workdocs/src/WorkDocsClient.ts index cdf20a48b8be..c4cb34a12db0 100644 --- a/clients/client-workdocs/src/WorkDocsClient.ts +++ b/clients/client-workdocs/src/WorkDocsClient.ts @@ -351,6 +351,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-workdocs/src/runtimeConfig.ts b/clients/client-workdocs/src/runtimeConfig.ts index f05798465ebb..5c87f601c8c9 100644 --- a/clients/client-workdocs/src/runtimeConfig.ts +++ b/clients/client-workdocs/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WorkDocsClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WorkDocsClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-workmail/src/WorkMailClient.ts b/clients/client-workmail/src/WorkMailClient.ts index 6ecf9c7ef259..170ab42dd744 100644 --- a/clients/client-workmail/src/WorkMailClient.ts +++ b/clients/client-workmail/src/WorkMailClient.ts @@ -618,6 +618,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-workmail/src/runtimeConfig.ts b/clients/client-workmail/src/runtimeConfig.ts index c322c1706cbe..d58afe9b29f6 100644 --- a/clients/client-workmail/src/runtimeConfig.ts +++ b/clients/client-workmail/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WorkMailClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WorkMailClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-workmailmessageflow/src/WorkMailMessageFlowClient.ts b/clients/client-workmailmessageflow/src/WorkMailMessageFlowClient.ts index 962f724d8a1c..09f72fc5599a 100644 --- a/clients/client-workmailmessageflow/src/WorkMailMessageFlowClient.ts +++ b/clients/client-workmailmessageflow/src/WorkMailMessageFlowClient.ts @@ -174,6 +174,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-workmailmessageflow/src/runtimeConfig.ts b/clients/client-workmailmessageflow/src/runtimeConfig.ts index ae4a6e50faad..878a1f2051a5 100644 --- a/clients/client-workmailmessageflow/src/runtimeConfig.ts +++ b/clients/client-workmailmessageflow/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WorkMailMessageFlowClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-workspaces-thin-client/src/WorkSpacesThinClientClient.ts b/clients/client-workspaces-thin-client/src/WorkSpacesThinClientClient.ts index dd214b509a1e..6b50b5db1f44 100644 --- a/clients/client-workspaces-thin-client/src/WorkSpacesThinClientClient.ts +++ b/clients/client-workspaces-thin-client/src/WorkSpacesThinClientClient.ts @@ -216,6 +216,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-workspaces-thin-client/src/runtimeConfig.ts b/clients/client-workspaces-thin-client/src/runtimeConfig.ts index d29940522dd6..0c829df0cbc3 100644 --- a/clients/client-workspaces-thin-client/src/runtimeConfig.ts +++ b/clients/client-workspaces-thin-client/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WorkSpacesThinClientClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WorkSpacesThinClientClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-workspaces-web/src/WorkSpacesWebClient.ts b/clients/client-workspaces-web/src/WorkSpacesWebClient.ts index 3829915a01e2..662ac1f1e237 100644 --- a/clients/client-workspaces-web/src/WorkSpacesWebClient.ts +++ b/clients/client-workspaces-web/src/WorkSpacesWebClient.ts @@ -507,6 +507,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-workspaces-web/src/runtimeConfig.ts b/clients/client-workspaces-web/src/runtimeConfig.ts index 934aa88fe4cf..a2beb266e8a2 100644 --- a/clients/client-workspaces-web/src/runtimeConfig.ts +++ b/clients/client-workspaces-web/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WorkSpacesWebClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WorkSpacesWebClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-workspaces/src/WorkSpacesClient.ts b/clients/client-workspaces/src/WorkSpacesClient.ts index b62d6f3cc1c3..77af109ab2f5 100644 --- a/clients/client-workspaces/src/WorkSpacesClient.ts +++ b/clients/client-workspaces/src/WorkSpacesClient.ts @@ -624,6 +624,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-workspaces/src/runtimeConfig.ts b/clients/client-workspaces/src/runtimeConfig.ts index e011fe484d1d..1bbef8515c03 100644 --- a/clients/client-workspaces/src/runtimeConfig.ts +++ b/clients/client-workspaces/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: WorkSpacesClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: WorkSpacesClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/clients/client-xray/src/XRayClient.ts b/clients/client-xray/src/XRayClient.ts index e96eb63cf25e..9d4dc0b6691b 100644 --- a/clients/client-xray/src/XRayClient.ts +++ b/clients/client-xray/src/XRayClient.ts @@ -327,6 +327,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/clients/client-xray/src/runtimeConfig.ts b/clients/client-xray/src/runtimeConfig.ts index 671a4263fa28..8debf61f8f57 100644 --- a/clients/client-xray/src/runtimeConfig.ts +++ b/clients/client-xray/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: XRayClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: XRayClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAccountIdEndpointModeRuntimeConfig.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAccountIdEndpointModeRuntimeConfig.java index 7a1c9b95f96e..2836a291c1c1 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAccountIdEndpointModeRuntimeConfig.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAccountIdEndpointModeRuntimeConfig.java @@ -89,7 +89,7 @@ public Map> getRuntimeConfigWriters( null, AwsDependency.AWS_SDK_CORE, "/account-id-endpoint"); writer.write( - "loadNodeConfig(NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS)"); + "loadNodeConfig(NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS, profileConfig)"); }); break; default: diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsRuntimeConfig.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsRuntimeConfig.java index c514a2a94714..7b9131eae09b 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsRuntimeConfig.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddAwsRuntimeConfig.java @@ -100,6 +100,25 @@ public void addConfigInterfaceFields( : "The AWS region to use as signing region for AWS Auth") .write("region?: string | __Provider;\n"); } + + writer.writeDocs( + """ + Setting a client profile is similar to setting a value for the + AWS_PROFILE environment variable. Setting a profile on a client + in code only affects the single client instance, unlike AWS_PROFILE. + + When set, and only for environments where an AWS configuration + file exists, fields configurable by this file will be retrieved + from the specified profile within that file. + Conflicting code configuration and environment variables will + still have higher priority. + + For client credential resolution that involves checking the AWS + configuration file, the client's profile (this value) will be + used unless a different profile is set in the credential + provider options. + """) + .write("profile?: string;\n"); } @Override @@ -146,6 +165,9 @@ public void prepareCustomizations( writer.addImport("emitWarningIfUnsupportedVersion", "awsCheckVersion", AwsDependency.AWS_SDK_CORE); writer.write("awsCheckVersion(process.version);"); } + if (target.equals(LanguageTarget.NODE)) { + writer.write("const profileConfig = { profile: config?.profile };"); + } } private Map> getDefaultConfig( @@ -173,7 +195,13 @@ private Map> getDefaultConfig( writer.addImport("NODE_REGION_CONFIG_FILE_OPTIONS", "NODE_REGION_CONFIG_FILE_OPTIONS", TypeScriptDependency.CONFIG_RESOLVER); writer.write( - "loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS)"); + """ + loadNodeConfig( + NODE_REGION_CONFIG_OPTIONS, + {...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig} + ) + """ + ); }); default: return Collections.emptyMap(); @@ -216,7 +244,7 @@ private Map> getEndpointConfigWriters( writer.addImport("NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS", "NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS", TypeScriptDependency.CONFIG_RESOLVER); - writer.write("loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS)"); + writer.write("loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig)"); }, "useFipsEndpoint", writer -> { writer.addDependency(TypeScriptDependency.NODE_CONFIG_PROVIDER); @@ -226,7 +254,7 @@ private Map> getEndpointConfigWriters( writer.addImport("NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS", "NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS", TypeScriptDependency.CONFIG_RESOLVER); - writer.write("loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)"); + writer.write("loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig)"); } ); default: diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEndpointDiscoveryPlugin.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEndpointDiscoveryPlugin.java index e87bd321b2c2..648e0cf2c076 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEndpointDiscoveryPlugin.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEndpointDiscoveryPlugin.java @@ -126,7 +126,7 @@ public Map> getRuntimeConfigWriters( writer.addImport("NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS", "NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS", AwsDependency.MIDDLEWARE_ENDPOINT_DISCOVERY); - writer.write("loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS)"); + writer.write("loadNodeConfig(NODE_ENDPOINT_DISCOVERY_CONFIG_OPTIONS, profileConfig)"); } ); default: diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java index 34d248be0534..073f999cbab5 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddHttpChecksumDependency.java @@ -141,7 +141,7 @@ public Map> getRuntimeConfigWriters( TypeScriptDependency.NODE_CONFIG_PROVIDER); writer.addImport("NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS", null, AwsDependency.FLEXIBLE_CHECKSUMS_MIDDLEWARE); - writer.write("loadNodeConfig(NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS)"); + writer.write("loadNodeConfig(NODE_REQUEST_CHECKSUM_CALCULATION_CONFIG_OPTIONS, profileConfig)"); }, "responseChecksumValidation", writer -> { writer.addDependency(TypeScriptDependency.NODE_CONFIG_PROVIDER); @@ -149,7 +149,7 @@ public Map> getRuntimeConfigWriters( TypeScriptDependency.NODE_CONFIG_PROVIDER); writer.addImport("NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS", null, AwsDependency.FLEXIBLE_CHECKSUMS_MIDDLEWARE); - writer.write("loadNodeConfig(NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS)"); + writer.write("loadNodeConfig(NODE_RESPONSE_CHECKSUM_VALIDATION_CONFIG_OPTIONS, profileConfig)"); } ); case BROWSER: diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java index bf899d38dc3b..1dc06723f962 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddS3Config.java @@ -256,7 +256,7 @@ public Map> getRuntimeConfigWriters( .addDependency(AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE) .addImport("NODE_USE_ARN_REGION_CONFIG_OPTIONS", "NODE_USE_ARN_REGION_CONFIG_OPTIONS", AwsDependency.BUCKET_ENDPOINT_MIDDLEWARE) - .write("loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS)"); + .write("loadNodeConfig(NODE_USE_ARN_REGION_CONFIG_OPTIONS, profileConfig)"); }, "disableS3ExpressSessionAuth", writer -> { writer.addDependency(TypeScriptDependency.NODE_CONFIG_PROVIDER) @@ -268,7 +268,7 @@ public Map> getRuntimeConfigWriters( "NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS", AwsDependency.S3_MIDDLEWARE ) - .write("loadNodeConfig(NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS)"); + .write("loadNodeConfig(NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS, profileConfig)"); } ); default: diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java index b3be00673bbb..a479e3fff93f 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddUserAgentDependency.java @@ -84,7 +84,9 @@ public Map> getRuntimeConfigWriters( writer.addDependency(AwsDependency.AWS_SDK_UTIL_USER_AGENT_NODE); writer.addImport("NODE_APP_ID_CONFIG_OPTIONS", "NODE_APP_ID_CONFIG_OPTIONS", AwsDependency.AWS_SDK_UTIL_USER_AGENT_NODE); - writer.write("loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS)"); + writer.write( + "loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig)" + ); } ); case BROWSER: diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/auth/http/integration/AwsSdkCustomizeSigV4Auth.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/auth/http/integration/AwsSdkCustomizeSigV4Auth.java index 156853ea1839..70a33414509d 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/auth/http/integration/AwsSdkCustomizeSigV4Auth.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/auth/http/integration/AwsSdkCustomizeSigV4Auth.java @@ -133,7 +133,7 @@ public Map> getRuntimeConfigWriters( null, AwsDependency.AWS_SDK_CORE ); - writer.write("loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS)"); + writer.write("loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, profileConfig)"); } ); } diff --git a/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts b/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts index 13b75764b7d9..ddc82a9b7eaf 100644 --- a/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts +++ b/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts @@ -33,6 +33,11 @@ export function fromCognitoIdentity(parameters: FromCognitoIdentityParameters): parameters.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity"); const { GetCredentialsForIdentityCommand, CognitoIdentityClient } = await import("./loadCognitoIdentity"); + const fromConfigs = (property: "region" | "profile"): any => + parameters.clientConfig?.[property] ?? + parameters.parentClientConfig?.[property] ?? + awsIdentityProperties?.callerClientConfig?.[property]; + const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters.logger), @@ -44,10 +49,8 @@ export function fromCognitoIdentity(parameters: FromCognitoIdentityParameters): parameters.client ?? new CognitoIdentityClient( Object.assign({}, parameters.clientConfig ?? {}, { - region: - parameters.clientConfig?.region ?? - parameters.parentClientConfig?.region ?? - awsIdentityProperties?.callerClientConfig?.region, + region: fromConfigs("region"), + profile: fromConfigs("profile"), }) ) ).send( diff --git a/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts b/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts index 2cf4d5f12293..b1ff0dbba3da 100644 --- a/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts +++ b/packages/credential-provider-cognito-identity/src/fromCognitoIdentityPool.ts @@ -37,12 +37,18 @@ export function fromCognitoIdentityPool({ let provider: CognitoIdentityCredentialProvider = async (awsIdentityProperties?: AwsIdentityProperties) => { const { GetIdCommand, CognitoIdentityClient } = await import("./loadCognitoIdentity"); + + const fromConfigs = (property: "region" | "profile"): any => + clientConfig?.[property] ?? + parentClientConfig?.[property] ?? + awsIdentityProperties?.callerClientConfig?.[property]; + const _client = client ?? new CognitoIdentityClient( Object.assign({}, clientConfig ?? {}, { - region: - clientConfig?.region ?? parentClientConfig?.region ?? awsIdentityProperties?.callerClientConfig?.region, + region: fromConfigs("region"), + profile: fromConfigs("profile"), }) ); diff --git a/packages/credential-provider-ini/src/fromIni.spec.ts b/packages/credential-provider-ini/src/fromIni.spec.ts index d7651a18d82e..ee86f5ff548a 100644 --- a/packages/credential-provider-ini/src/fromIni.spec.ts +++ b/packages/credential-provider-ini/src/fromIni.spec.ts @@ -12,6 +12,7 @@ describe(fromIni.name, () => { const mockMasterProfileName = "mockMasterProfileName"; const mockProfileName = "mockProfileName"; const mockInit = { profile: mockProfileName }; + const mockInitWithParentClientConfig = { profile: mockProfileName, parentClientConfig: {} }; const mockProfiles = { [mockProfileName]: { key: "value" } }; beforeEach(() => { @@ -32,7 +33,7 @@ describe(fromIni.name, () => { } catch (error) { expect(error).toStrictEqual(expectedError); } - expect(parseKnownFiles).toHaveBeenCalledWith(mockInit); + expect(parseKnownFiles).toHaveBeenCalledWith(mockInitWithParentClientConfig); expect(getProfileName).not.toHaveBeenCalled(); expect(resolveProfileData).not.toHaveBeenCalled(); }); @@ -46,9 +47,13 @@ describe(fromIni.name, () => { } catch (error) { expect(error).toStrictEqual(expectedError); } - expect(parseKnownFiles).toHaveBeenCalledWith(mockInit); + expect(parseKnownFiles).toHaveBeenCalledWith(mockInitWithParentClientConfig); expect(getProfileName).toHaveBeenCalledWith(mockInit); - expect(resolveProfileData).toHaveBeenCalledWith(mockMasterProfileName, mockProfiles, mockInit); + expect(resolveProfileData).toHaveBeenCalledWith( + mockMasterProfileName, + mockProfiles, + mockInitWithParentClientConfig + ); }); it("returns resolved process creds", async () => { @@ -59,8 +64,12 @@ describe(fromIni.name, () => { vi.mocked(resolveProfileData).mockResolvedValue(expectedCreds); const receivedCreds = await fromIni(mockInit)(); expect(receivedCreds).toStrictEqual(expectedCreds); - expect(parseKnownFiles).toHaveBeenCalledWith(mockInit); + expect(parseKnownFiles).toHaveBeenCalledWith(mockInitWithParentClientConfig); expect(getProfileName).toHaveBeenCalledWith(mockInit); - expect(resolveProfileData).toHaveBeenCalledWith(mockMasterProfileName, mockProfiles, mockInit); + expect(resolveProfileData).toHaveBeenCalledWith( + mockMasterProfileName, + mockProfiles, + mockInitWithParentClientConfig + ); }); }); diff --git a/packages/credential-provider-ini/src/fromIni.ts b/packages/credential-provider-ini/src/fromIni.ts index d505746de1b6..31c245c9e890 100644 --- a/packages/credential-provider-ini/src/fromIni.ts +++ b/packages/credential-provider-ini/src/fromIni.ts @@ -60,14 +60,18 @@ export const fromIni = async ({ callerClientConfig } = {}) => { const init: FromIniInit = { ..._init, - }; - if (callerClientConfig?.region) { - init.parentClientConfig = { - region: callerClientConfig.region, + parentClientConfig: { + ...callerClientConfig, ..._init.parentClientConfig, - }; - } + }, + }; init.logger?.debug("@aws-sdk/credential-provider-ini - fromIni"); const profiles = await parseKnownFiles(init); - return resolveProfileData(getProfileName(init), profiles, init); + return resolveProfileData( + getProfileName({ + profile: _init.profile ?? callerClientConfig?.profile, + }), + profiles, + init + ); }; diff --git a/packages/credential-provider-node/src/credential-provider-node.integ.spec.ts b/packages/credential-provider-node/src/credential-provider-node.integ.spec.ts index b2ac2def6744..4d65fcb757cb 100644 --- a/packages/credential-provider-node/src/credential-provider-node.integ.spec.ts +++ b/packages/credential-provider-node/src/credential-provider-node.integ.spec.ts @@ -1,10 +1,10 @@ import { STS } from "@aws-sdk/client-sts"; import * as credentialProviderHttp from "@aws-sdk/credential-provider-http"; import { fromCognitoIdentity, fromCognitoIdentityPool, fromIni, fromWebToken } from "@aws-sdk/credential-providers"; -import { fromSso } from "@aws-sdk/token-providers"; import { HttpResponse } from "@smithy/protocol-http"; -import type { SourceProfileInit } from "@smithy/shared-ini-file-loader"; -import type { HttpRequest, NodeHttpHandlerOptions, ParsedIniData } from "@smithy/types"; +import type { SharedConfigInit, SourceProfileInit } from "@smithy/shared-ini-file-loader"; +import type { HttpRequest, NodeHttpHandlerOptions, ParsedIniData, SharedConfigFiles } from "@smithy/types"; +import { AdaptiveRetryStrategy, StandardRetryStrategy } from "@smithy/util-retry"; import { PassThrough } from "stream"; import { defaultProvider } from "./defaultProvider"; @@ -41,6 +41,12 @@ jest.mock("@smithy/shared-ini-file-loader", () => { async parseKnownFiles(init: SourceProfileInit): Promise { return iniProfileData; }, + async loadSharedConfigFiles(init: SharedConfigInit): Promise { + return { + configFile: iniProfileData, + credentialsFile: iniProfileData, + }; + }, async getSSOTokenFromFile() { return { accessToken: "mock_sso_token", @@ -69,7 +75,7 @@ jest.mock("@smithy/node-http-handler", () => { assumeRoleArns.push(request.body.match(/RoleArn=(.*?)&/)?.[1]); } - const region = (request.hostname.match(/(sts|cognito-identity)\.(.*?)\./) || [, , "unknown"])[2]; + const region = (request.hostname.match(/(sts|cognito-identity|portal\.sso)\.(.*?)\./) || [, , "unknown"])[2]; if (request.headers.Authorization === "container-authorization") { body.write( @@ -86,7 +92,7 @@ jest.mock("@smithy/node-http-handler", () => { roleCredentials: { accessKeyId: "SSO_ACCESS_KEY_ID", secretAccessKey: "SSO_SECRET_ACCESS_KEY", - sessionToken: "SSO_SESSION_TOKEN", + sessionToken: `SSO_SESSION_TOKEN_${region}`, expiration: "3000-01-01T00:00:00.000Z", }, }) @@ -353,7 +359,7 @@ describe("credential-provider-node integration test", () => { expect(credentials).toEqual({ accessKeyId: "SSO_ACCESS_KEY_ID", secretAccessKey: "SSO_SECRET_ACCESS_KEY", - sessionToken: "SSO_SESSION_TOKEN", + sessionToken: "SSO_SESSION_TOKEN_us-sso-region-1", expiration: new Date("3000-01-01T00:00:00.000Z"), $source: { CREDENTIALS_CODE: "e", @@ -547,7 +553,7 @@ describe("credential-provider-node integration test", () => { expect(credentials).toEqual({ accessKeyId: "SSO_ACCESS_KEY_ID", secretAccessKey: "SSO_SECRET_ACCESS_KEY", - sessionToken: "SSO_SESSION_TOKEN", + sessionToken: "SSO_SESSION_TOKEN_us-sso-region-1", expiration: new Date("3000-01-01T00:00:00.000Z"), $source: { CREDENTIALS_PROFILE_SSO: "r", @@ -843,18 +849,17 @@ describe("credential-provider-node integration test", () => { }); }); - it("fromIni assumeRole provider should use the caller client's region for STS", async () => { + it("fromIni assumeRole provider should use the caller client's region for STS if profile does not set region", async () => { sts = new STS({ region: "eu-west-1", - credentials: fromIni(), + credentials: fromIni({}), }); iniProfileData.assume = { - region: "eu-west-1", aws_access_key_id: "ASSUME_STATIC_ACCESS_KEY", aws_secret_access_key: "ASSUME_STATIC_SECRET_KEY", }; + delete iniProfileData.default.region; Object.assign(iniProfileData.default, { - region: "eu-west-1", role_arn: "ROLE_ARN", role_session_name: "ROLE_SESSION_NAME", external_id: "EXTERNAL_ID", @@ -875,6 +880,37 @@ describe("credential-provider-node integration test", () => { }); }); + it("fromIni assumeRole provider should prefer profile region for STS", async () => { + sts = new STS({ + region: "eu-west-1", + credentials: fromIni({}), + }); + iniProfileData.assume = { + aws_access_key_id: "ASSUME_STATIC_ACCESS_KEY", + aws_secret_access_key: "ASSUME_STATIC_SECRET_KEY", + }; + Object.assign(iniProfileData.default, { + region: "eu-west-2", + role_arn: "ROLE_ARN", + role_session_name: "ROLE_SESSION_NAME", + external_id: "EXTERNAL_ID", + source_profile: "assume", + }); + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "STS_AR_ACCESS_KEY_ID", + secretAccessKey: "STS_AR_SECRET_ACCESS_KEY", + sessionToken: "STS_AR_SESSION_TOKEN_eu-west-2", + expiration: new Date("3000-01-01T00:00:00.000Z"), + $source: { + CREDENTIALS_CODE: "e", + CREDENTIALS_PROFILE_SOURCE_PROFILE: "o", + CREDENTIALS_STS_ASSUME_ROLE: "i", + }, + }); + }); + it("fromWebToken provider should use caller client region", async () => { sts = new STS({ region: "ap-northeast-1", @@ -910,6 +946,327 @@ describe("credential-provider-node integration test", () => { ); }); + describe("client-scoped code configuration of AWS profile", () => { + it("should allow clients to resolve credentials from different profiles", async () => { + iniProfileData.aaa = { + aws_access_key_id: "aaa", + aws_secret_access_key: "aaa", + aws_session_token: "aaa", + region: "ap-northeast-1", + }; + iniProfileData.bbb = { + aws_access_key_id: "bbb", + aws_secret_access_key: "bbb", + aws_session_token: "bbb", + region: "us-east-1", + }; + + const clientA = new STS({ + profile: "aaa", + }); + const clientB = new STS({ + profile: "bbb", + }); + + await clientA.getCallerIdentity(); + await clientB.getCallerIdentity(); + + expect(await clientA.config.credentials()).toEqual({ + $source: { + CREDENTIALS_PROFILE: "n", + }, + accessKeyId: "aaa", + secretAccessKey: "aaa", + sessionToken: "aaa", + }); + expect(await clientB.config.credentials()).toEqual({ + $source: { + CREDENTIALS_PROFILE: "n", + }, + accessKeyId: "bbb", + secretAccessKey: "bbb", + sessionToken: "bbb", + }); + }); + it("should load various configuration properties from different profiles", async () => { + // set AWS_PROFILE to show that client code-level profile takes priority over env. + process.env.AWS_PROFILE = "default"; + iniProfileData.aaa = { + aws_access_key_id: "aaa", + aws_secret_access_key: "aaa", + aws_session_token: "aaa", + region: "ap-northeast-1", + retry_mode: "adaptive", + max_attempts: "33", + use_fips_endpoint: "true", + use_dualstack_endpoint: "true", + }; + iniProfileData.bbb = { + aws_access_key_id: "bbb", + aws_secret_access_key: "bbb", + aws_session_token: "bbb", + region: "us-east-1", + retry_mode: "standard", + max_attempts: "12", + use_fips_endpoint: "false", + use_dualstack_endpoint: "false", + }; + + const clientA = new STS({ + profile: "aaa", + }); + const clientB = new STS({ + profile: "bbb", + }); + + await clientA.getCallerIdentity(); + await clientB.getCallerIdentity(); + + expect(await clientA.config.region()).toEqual(iniProfileData.aaa.region); + expect(await clientA.config.retryStrategy()).toBeInstanceOf(AdaptiveRetryStrategy); + expect(await clientA.config.maxAttempts()).toEqual(Number(iniProfileData.aaa.max_attempts)); + expect(await clientA.config.useFipsEndpoint()).toEqual(iniProfileData.aaa.use_fips_endpoint === "true"); + expect(await clientA.config.useDualstackEndpoint()).toEqual(iniProfileData.aaa.use_dualstack_endpoint === "true"); + + expect(await clientB.config.region()).toEqual(iniProfileData.bbb.region); + expect(await clientB.config.retryStrategy()).toBeInstanceOf(StandardRetryStrategy); + expect(await clientB.config.maxAttempts()).toEqual(Number(iniProfileData.bbb.max_attempts)); + expect(await clientB.config.useFipsEndpoint()).toEqual(iniProfileData.bbb.use_fips_endpoint === "true"); + expect(await clientB.config.useDualstackEndpoint()).toEqual(iniProfileData.bbb.use_dualstack_endpoint === "true"); + }); + + it("should allow client profile to control fromIni init profile in implicit (default) credentials provider", async () => { + sts = new STS({ + profile: "assume", + }); + iniProfileData.static = { + aws_access_key_id: "ASSUME_STATIC_ACCESS_KEY", + aws_secret_access_key: "ASSUME_STATIC_SECRET_KEY", + }; + iniProfileData.assume = { + region: "eu-west-1", + role_arn: "ROLE_ARN", + role_session_name: "ROLE_SESSION_NAME", + external_id: "EXTERNAL_ID", + source_profile: "static", + }; + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "STS_AR_ACCESS_KEY_ID", + secretAccessKey: "STS_AR_SECRET_ACCESS_KEY", + sessionToken: "STS_AR_SESSION_TOKEN_eu-west-1", + expiration: new Date("3000-01-01T00:00:00.000Z"), + $source: { + CREDENTIALS_PROFILE_SOURCE_PROFILE: "o", + CREDENTIALS_STS_ASSUME_ROLE: "i", + }, + }); + }); + + it( + "should allow client profile to control fromIni init profile in explicit credentials provider " + + "without requiring redundant setting of profile or region on the provider factory", + async () => { + sts = new STS({ + profile: "assume", + // no profile is given to fromIni(), but it is used in + // the context of this client and should fall back to the client's + // profile. + credentials: fromIni(), + }); + const sts2 = new STS({}); + Object.assign(iniProfileData.default, { + aws_access_key_id: "DEFAULT", + aws_secret_access_key: "DEFAULT", + }); + iniProfileData.static = { + aws_access_key_id: "ASSUME_STATIC_ACCESS_KEY", + aws_secret_access_key: "ASSUME_STATIC_SECRET_KEY", + }; + iniProfileData.assume = { + region: "ap-northeast-1", + role_arn: "ROLE_ARN", + role_session_name: "ROLE_SESSION_NAME", + external_id: "EXTERNAL_ID", + source_profile: "static", + }; + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "STS_AR_ACCESS_KEY_ID", + secretAccessKey: "STS_AR_SECRET_ACCESS_KEY", + sessionToken: "STS_AR_SESSION_TOKEN_ap-northeast-1", + expiration: new Date("3000-01-01T00:00:00.000Z"), + $source: { + CREDENTIALS_CODE: "e", + CREDENTIALS_PROFILE_SOURCE_PROFILE: "o", + CREDENTIALS_STS_ASSUME_ROLE: "i", + }, + }); + expect(await sts2.config.credentials()).toEqual({ + accessKeyId: "DEFAULT", + secretAccessKey: "DEFAULT", + sessionToken: undefined, + $source: { + CREDENTIALS_PROFILE: "n", + }, + }); + } + ); + + it("credential provider factory init still overrides profile setting", async () => { + sts = new STS({ + profile: "assume", + credentials: fromIni({ + profile: "default", + }), + }); + Object.assign(iniProfileData.default, { + aws_access_key_id: "DEFAULT", + aws_secret_access_key: "DEFAULT", + region: "us-east-1", + }); + iniProfileData.static = { + aws_access_key_id: "ASSUME_STATIC_ACCESS_KEY", + aws_secret_access_key: "ASSUME_STATIC_SECRET_KEY", + }; + iniProfileData.assume = { + region: "ap-northeast-1", + role_arn: "ROLE_ARN", + role_session_name: "ROLE_SESSION_NAME", + external_id: "EXTERNAL_ID", + source_profile: "static", + }; + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "DEFAULT", + secretAccessKey: "DEFAULT", + sessionToken: undefined, + $source: { + CREDENTIALS_CODE: "e", + CREDENTIALS_PROFILE: "n", + }, + }); + expect(await sts.config.region()).toEqual("ap-northeast-1"); + }); + + describe("sso", () => { + it( + "should allow SSO region to be used in the SSO client request if " + + "a profile includes a region but also SSO credentials", + async () => { + sts = new STS({ + profile: "sso_root", + }); + iniProfileData["sso-session.ssoNew"] = { + sso_region: "us-sso-region-2", + sso_start_url: "SSO_START_URL", + sso_registration_scopes: "sso:account:access", + }; + iniProfileData.sso_root = { + sso_region: "us-sso-region-1", + sso_session: "ssoNew", + sso_account_id: "1234", + sso_role_name: "integration-test", + region: "ap-northeast-1", + }; + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "SSO_ACCESS_KEY_ID", + secretAccessKey: "SSO_SECRET_ACCESS_KEY", + sessionToken: "SSO_SESSION_TOKEN_us-sso-region-2", + expiration: new Date("3000-01-01T00:00:00.000Z"), + $source: { + CREDENTIALS_PROFILE_SSO: "r", + CREDENTIALS_SSO: "s", + }, + }); + expect(await sts.config.region()).toEqual("ap-northeast-1"); + } + ); + it( + "should allow SSO region to be used in the SSO client request if " + + "a client has set a region in code but selects a profile with SSO creds", + async () => { + sts = new STS({ + region: "eu-west-1", + credentials: fromIni({ + profile: "sso_root", + }), + }); + iniProfileData["sso-session.ssoNew"] = { + sso_region: "us-sso-region-2", + sso_start_url: "SSO_START_URL", + sso_registration_scopes: "sso:account:access", + }; + iniProfileData.sso_root = { + sso_region: "us-sso-region-1", + sso_session: "ssoNew", + sso_account_id: "1234", + sso_role_name: "integration-test", + region: "ap-northeast-1", + }; + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "SSO_ACCESS_KEY_ID", + secretAccessKey: "SSO_SECRET_ACCESS_KEY", + sessionToken: "SSO_SESSION_TOKEN_us-sso-region-2", + expiration: new Date("3000-01-01T00:00:00.000Z"), + $source: { + CREDENTIALS_CODE: "e", + CREDENTIALS_PROFILE_SSO: "r", + CREDENTIALS_SSO: "s", + }, + }); + expect(await sts.config.region()).toEqual("eu-west-1"); + } + ); + }); + + it("source_profile does not bring over any client configuration options", async () => { + sts = new STS({ + profile: "assume", + }); + iniProfileData.static = { + aws_access_key_id: "ASSUME_STATIC_ACCESS_KEY", + aws_secret_access_key: "ASSUME_STATIC_SECRET_KEY", + region: "us-west-2", + retry_mode: "adaptive", + max_attempts: "33", + use_fips_endpoint: "true", + use_dualstack_endpoint: "true", + }; + iniProfileData.assume = { + region: "ap-northeast-1", + role_arn: "ROLE_ARN", + role_session_name: "ROLE_SESSION_NAME", + external_id: "EXTERNAL_ID", + source_profile: "static", + }; + await sts.getCallerIdentity({}); + const credentials = await sts.config.credentials(); + expect(credentials).toEqual({ + accessKeyId: "STS_AR_ACCESS_KEY_ID", + secretAccessKey: "STS_AR_SECRET_ACCESS_KEY", + sessionToken: "STS_AR_SESSION_TOKEN_ap-northeast-1", + expiration: new Date("3000-01-01T00:00:00.000Z"), + $source: { + CREDENTIALS_PROFILE_SOURCE_PROFILE: "o", + CREDENTIALS_STS_ASSUME_ROLE: "i", + }, + }); + expect(await sts.config.region()).toEqual("ap-northeast-1"); + expect(await sts.config.retryStrategy()).toBeInstanceOf(StandardRetryStrategy); + expect(await sts.config.maxAttempts()).toEqual(3); + expect(await sts.config.useFipsEndpoint()).toEqual(false); + expect(await sts.config.useDualstackEndpoint()).toEqual(false); + }); + }); + describe("No credentials available", () => { it("should throw CredentialsProviderError", async () => { process.env.AWS_EC2_METADATA_DISABLED = "true"; diff --git a/packages/credential-provider-process/src/fromProcess.ts b/packages/credential-provider-process/src/fromProcess.ts index ec03d36ac8c8..bd211153ef7c 100644 --- a/packages/credential-provider-process/src/fromProcess.ts +++ b/packages/credential-provider-process/src/fromProcess.ts @@ -1,6 +1,5 @@ -import type { CredentialProviderOptions } from "@aws-sdk/types"; +import type { CredentialProviderOptions, RuntimeConfigAwsCredentialIdentityProvider } from "@aws-sdk/types"; import { getProfileName, parseKnownFiles, SourceProfileInit } from "@smithy/shared-ini-file-loader"; -import { AwsCredentialIdentityProvider } from "@smithy/types"; import { resolveProcessCredentials } from "./resolveProcessCredentials"; @@ -16,9 +15,15 @@ export interface FromProcessInit extends SourceProfileInit, CredentialProviderOp * in ini files. */ export const fromProcess = - (init: FromProcessInit = {}): AwsCredentialIdentityProvider => - async () => { + (init: FromProcessInit = {}): RuntimeConfigAwsCredentialIdentityProvider => + async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-process - fromProcess"); const profiles = await parseKnownFiles(init); - return resolveProcessCredentials(getProfileName(init), profiles, init.logger); + return resolveProcessCredentials( + getProfileName({ + profile: init.profile ?? callerClientConfig?.profile, + }), + profiles, + init.logger + ); }; diff --git a/packages/credential-provider-sso/src/fromSSO.ts b/packages/credential-provider-sso/src/fromSSO.ts index 1960b4855b63..c6e53fe707ef 100644 --- a/packages/credential-provider-sso/src/fromSSO.ts +++ b/packages/credential-provider-sso/src/fromSSO.ts @@ -1,4 +1,4 @@ -import type { CredentialProviderOptions } from "@aws-sdk/types"; +import type { CredentialProviderOptions, RuntimeConfigAwsCredentialIdentityProvider } from "@aws-sdk/types"; import { CredentialsProviderError } from "@smithy/property-provider"; import { getProfileName, loadSsoSessionData, parseKnownFiles, SourceProfileInit } from "@smithy/shared-ini-file-loader"; import { AwsCredentialIdentityProvider } from "@smithy/types"; @@ -79,12 +79,14 @@ export interface FromSSOInit extends SourceProfileInit, CredentialProviderOption * ``` */ export const fromSSO = - (init: FromSSOInit & Partial = {}): AwsCredentialIdentityProvider => - async () => { + (init: FromSSOInit & Partial = {}): RuntimeConfigAwsCredentialIdentityProvider => + async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO"); const { ssoStartUrl, ssoAccountId, ssoRegion, ssoRoleName, ssoSession } = init; const { ssoClient } = init; - const profileName = getProfileName(init); + const profileName = getProfileName({ + profile: init.profile ?? callerClientConfig?.profile, + }); if (!ssoStartUrl && !ssoAccountId && !ssoRegion && !ssoRoleName && !ssoSession) { // Load the SSO config from shared AWS config file. diff --git a/packages/credential-provider-web-identity/src/fromWebToken.ts b/packages/credential-provider-web-identity/src/fromWebToken.ts index 41489ce7467c..f18555bf74a3 100644 --- a/packages/credential-provider-web-identity/src/fromWebToken.ts +++ b/packages/credential-provider-web-identity/src/fromWebToken.ts @@ -169,14 +169,10 @@ export const fromWebToken = { ...init.clientConfig, credentialProviderLogger: init.logger, - ...(awsIdentityProperties?.callerClientConfig?.region || init.parentClientConfig - ? { - parentClientConfig: { - region: awsIdentityProperties?.callerClientConfig?.region, - ...init.parentClientConfig, - }, - } - : {}), + parentClientConfig: { + ...awsIdentityProperties?.callerClientConfig, + ...init.parentClientConfig, + }, }, init.clientPlugins ); diff --git a/packages/dsql-signer/src/Signer.ts b/packages/dsql-signer/src/Signer.ts index 070fb955132b..ba3604f990ba 100644 --- a/packages/dsql-signer/src/Signer.ts +++ b/packages/dsql-signer/src/Signer.ts @@ -12,7 +12,8 @@ type DsqlSignerAction = "DbConnect" | "DbConnectAdmin"; export interface DsqlSignerConfig { /** - * The AWS credentials to sign requests with. Uses the default credential provider chain if not specified. + * The AWS credentials to sign requests with. + * Uses the default credential provider chain if not specified. */ credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider; @@ -22,7 +23,8 @@ export interface DsqlSignerConfig { hostname: string; /** - * The region the database is located in. Uses the region inferred from the runtime if omitted. + * The region the database is located in. + * Uses the region from the profile or inferred from the runtime if omitted. */ region?: string; @@ -35,6 +37,16 @@ export interface DsqlSignerConfig { * The amount of time in seconds the generated token is valid. */ expiresIn?: number; + + /** + * Optional. Can be provided to configure region from a profile + * if operating in an environment with a file system having + * an AWS configuration file. + * + * The credentials will also resolve based on this profile, if using + * a credentials provider that includes the AWS configuration file. + */ + profile?: string; } /** diff --git a/packages/middleware-signing/src/awsAuthConfiguration.ts b/packages/middleware-signing/src/awsAuthConfiguration.ts index 539f317441ee..010d55a5c1c4 100644 --- a/packages/middleware-signing/src/awsAuthConfiguration.ts +++ b/packages/middleware-signing/src/awsAuthConfiguration.ts @@ -318,6 +318,7 @@ const createConfigBoundCredentialProvider = (input: { credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider | RuntimeConfigAwsCredentialIdentityProvider; credentialDefaultProvider: PreviouslyResolved["credentialDefaultProvider"]; region: PreviouslyResolved["region"]; + profile?: string; }): AwsCredentialIdentityProvider => { const normalizedCredentialsProvider = input.credentials ? normalizeCredentialProvider(input.credentials) @@ -330,6 +331,7 @@ const createConfigBoundCredentialProvider = (input: { (normalizedCredentialsProvider as RuntimeConfigAwsCredentialIdentityProvider)({ callerClientConfig: { region: normalizeProvider(input.region), + profile: input.profile, }, }); return normalizedCreds; diff --git a/packages/rds-signer/src/Signer.ts b/packages/rds-signer/src/Signer.ts index 406443550aa0..c0f2178263f0 100644 --- a/packages/rds-signer/src/Signer.ts +++ b/packages/rds-signer/src/Signer.ts @@ -13,7 +13,8 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; export interface SignerConfig { /** - * The AWS credentials to sign requests with. Uses the default credential provider chain if not specified. + * The AWS credentials to sign requests with. + * Uses the default credential provider chain if not specified. */ credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider; /** @@ -25,7 +26,9 @@ export interface SignerConfig { */ port: number; /** - * The region the database is located in. Uses the region inferred from the runtime if omitted. + * The region the database is located in. + * Uses the region of the given profile or inferred from the runtime if + * both are omitted. */ region?: string; /** @@ -36,6 +39,15 @@ export interface SignerConfig { * The username to login as. */ username: string; + /** + * Optional. Can be provided to configure region from a profile + * if operating in an environment with a file system having + * an AWS configuration file. + * + * The credentials will also resolve based on this profile, if using + * a credentials provider that includes the AWS configuration file. + */ + profile?: string; } /** diff --git a/packages/rds-signer/src/runtimeConfig.ts b/packages/rds-signer/src/runtimeConfig.ts index f413d71bae1a..60afbb0ee68a 100644 --- a/packages/rds-signer/src/runtimeConfig.ts +++ b/packages/rds-signer/src/runtimeConfig.ts @@ -12,8 +12,17 @@ export const getRuntimeConfig = (config: SignerConfig) => { return { runtime: "node", sha256: config?.sha256 ?? Hash.bind(null, "sha256"), - credentials: config?.credentials ?? fromNodeProviderChain(), - region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + credentials: + config?.credentials ?? + fromNodeProviderChain({ + profile: config.profile, + }), + region: + config?.region ?? + loadConfig(NODE_REGION_CONFIG_OPTIONS, { + ...NODE_REGION_CONFIG_FILE_OPTIONS, + profile: config.profile, + }), ...config, }; }; diff --git a/packages/token-providers/src/fromSso.spec.ts b/packages/token-providers/src/fromSso.spec.ts index c688ce544b07..ddac6507f438 100644 --- a/packages/token-providers/src/fromSso.spec.ts +++ b/packages/token-providers/src/fromSso.spec.ts @@ -34,6 +34,7 @@ describe(fromSso.name, () => { const mockProfileName = "mockProfileName"; const mockInit = { profile: mockProfileName }; + const mockInitWithParentClientConfig = { profile: mockProfileName, parentClientConfig: {} }; const mockProfiles = { [mockProfileName]: mockSsoProfile }; const mockSsoToken = { @@ -68,7 +69,7 @@ describe(fromSso.name, () => { }); afterEach(() => { - expect(parseKnownFiles).toHaveBeenCalledWith(mockInit); + expect(parseKnownFiles).toHaveBeenCalledWith(mockInitWithParentClientConfig); expect(getProfileName).toHaveBeenCalledWith(mockInit); vi.clearAllMocks(); }); @@ -167,7 +168,11 @@ describe(fromSso.name, () => { const { fromSso } = await import("./fromSso"); await expect(fromSso(mockInit)()).resolves.toStrictEqual(mockNewToken); expect(getNewSsoOidcToken).toHaveBeenCalledTimes(1); - expect(getNewSsoOidcToken).toHaveBeenCalledWith(mockSsoToken, mockSsoSession.sso_region, mockInit); + expect(getNewSsoOidcToken).toHaveBeenCalledWith( + mockSsoToken, + mockSsoSession.sso_region, + mockInitWithParentClientConfig + ); // Simulate token expiration. const ssoTokenExpiryError = new TokenProviderError(`SSO Token is expired. ${REFRESH_MESSAGE}`, false); @@ -183,7 +188,11 @@ describe(fromSso.name, () => { const { fromSso } = await import("./fromSso"); await expect(fromSso(mockInit)()).resolves.toStrictEqual(mockNewToken); expect(getNewSsoOidcToken).toHaveBeenCalledTimes(1); - expect(getNewSsoOidcToken).toHaveBeenCalledWith(mockSsoToken, mockSsoSession.sso_region, mockInit); + expect(getNewSsoOidcToken).toHaveBeenCalledWith( + mockSsoToken, + mockSsoSession.sso_region, + mockInitWithParentClientConfig + ); // Return a valid token for second call. const mockValidSsoToken = { @@ -234,7 +243,7 @@ describe(fromSso.name, () => { expect(getNewSsoOidcToken).toHaveBeenCalledWith( mockValidSsoTokenInExpiryWindow, mockSsoSession.sso_region, - mockInit + mockInitWithParentClientConfig ); }; @@ -244,7 +253,11 @@ describe(fromSso.name, () => { throw ssoTokenExpiryError; }); await expect(fromSsoImpl(mockInit)()).rejects.toStrictEqual(ssoTokenExpiryError); - expect(getNewSsoOidcToken).toHaveBeenCalledWith(mockSsoToken, mockSsoSession.sso_region, mockInit); + expect(getNewSsoOidcToken).toHaveBeenCalledWith( + mockSsoToken, + mockSsoSession.sso_region, + mockInitWithParentClientConfig + ); }; afterEach(() => { @@ -290,7 +303,11 @@ describe(fromSso.name, () => { const { fromSso } = await import("./fromSso"); await expect(fromSso(mockInit)()).resolves.toStrictEqual(mockNewToken); expect(getNewSsoOidcToken).toHaveBeenCalledTimes(1); - expect(getNewSsoOidcToken).toHaveBeenCalledWith(mockSsoToken, mockSsoSession.sso_region, mockInit); + expect(getNewSsoOidcToken).toHaveBeenCalledWith( + mockSsoToken, + mockSsoSession.sso_region, + mockInitWithParentClientConfig + ); expect(writeSSOTokenToFile).toHaveBeenCalledWith(mockSsoSessionName, { ...mockSsoToken, diff --git a/packages/token-providers/src/fromSso.ts b/packages/token-providers/src/fromSso.ts index 0266209a3b6c..06fde9511e6b 100644 --- a/packages/token-providers/src/fromSso.ts +++ b/packages/token-providers/src/fromSso.ts @@ -37,22 +37,20 @@ export interface FromSsoInit extends SourceProfileInit, CredentialProviderOption */ export const fromSso = (_init: FromSsoInit = {}): RuntimeConfigIdentityProvider => - async (awsIdentityProperties?: AwsIdentityProperties) => { + async ({ callerClientConfig } = {}) => { const init: FromSsoInit = { ..._init, - ...(awsIdentityProperties?.callerClientConfig?.region - ? { - parentClientConfig: { - region: awsIdentityProperties?.callerClientConfig?.region, - ..._init.parentClientConfig, - }, - } - : {}), + parentClientConfig: { + ...callerClientConfig, + ..._init.parentClientConfig, + }, }; init.logger?.debug("@aws-sdk/token-providers - fromSso"); const profiles = await parseKnownFiles(init); - const profileName = getProfileName(init); + const profileName = getProfileName({ + profile: init.profile ?? callerClientConfig?.profile, + }); const profile = profiles[profileName]; if (!profile) { diff --git a/packages/types/src/credentials.ts b/packages/types/src/credentials.ts index 33b02303ad8a..e7abfbf8c3e2 100644 --- a/packages/types/src/credentials.ts +++ b/packages/types/src/credentials.ts @@ -1,4 +1,4 @@ -import { Logger, RequestHandler } from "@smithy/types"; +import { Logger } from "@smithy/types"; import { AwsCredentialIdentity } from "./identity"; import { Provider } from "./util"; @@ -48,6 +48,7 @@ export type CredentialProviderOptions = { */ parentClientConfig?: { region?: string | Provider; + profile?: string; [key: string]: unknown; }; }; diff --git a/packages/types/src/identity/AwsCredentialIdentity.ts b/packages/types/src/identity/AwsCredentialIdentity.ts index ad1091af88ac..903050883f91 100644 --- a/packages/types/src/identity/AwsCredentialIdentity.ts +++ b/packages/types/src/identity/AwsCredentialIdentity.ts @@ -10,6 +10,7 @@ export { AwsCredentialIdentity, AwsCredentialIdentityProvider, IdentityProvider export interface AwsIdentityProperties { callerClientConfig?: { region(): Promise; + profile?: string; }; } diff --git a/private/aws-client-api-test/src/client-interface-tests/client-s3/impl/initializeWithMaximalConfiguration.ts b/private/aws-client-api-test/src/client-interface-tests/client-s3/impl/initializeWithMaximalConfiguration.ts index 7b7c2f3d7aa9..adbf6c675449 100644 --- a/private/aws-client-api-test/src/client-interface-tests/client-s3/impl/initializeWithMaximalConfiguration.ts +++ b/private/aws-client-api-test/src/client-interface-tests/client-s3/impl/initializeWithMaximalConfiguration.ts @@ -41,6 +41,7 @@ export const initializeWithMaximalConfiguration = () => { const config: Required = { // BEGIN user options + profile: "default", region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), credentials: defaultProvider({}), endpoint: "endpoint", diff --git a/private/aws-echo-service/src/EchoServiceClient.ts b/private/aws-echo-service/src/EchoServiceClient.ts index aa83516d1681..309f8f1160dd 100644 --- a/private/aws-echo-service/src/EchoServiceClient.ts +++ b/private/aws-echo-service/src/EchoServiceClient.ts @@ -136,6 +136,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ disableHostPrefix?: boolean; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/private/aws-echo-service/src/runtimeConfig.ts b/private/aws-echo-service/src/runtimeConfig.ts index 80653f7e63b4..19551ff12ade 100644 --- a/private/aws-echo-service/src/runtimeConfig.ts +++ b/private/aws-echo-service/src/runtimeConfig.ts @@ -23,6 +23,7 @@ export const getRuntimeConfig = (config: EchoServiceClientConfig) => { const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -31,16 +32,19 @@ export const getRuntimeConfig = (config: EchoServiceClientConfig) => { bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts b/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts index 5ecc130cc2d4..6b5a1574275d 100644 --- a/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts +++ b/private/aws-protocoltests-ec2/src/EC2ProtocolClient.ts @@ -262,6 +262,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-ec2/src/runtimeConfig.ts b/private/aws-protocoltests-ec2/src/runtimeConfig.ts index d0f7cf5448df..93398940a969 100644 --- a/private/aws-protocoltests-ec2/src/runtimeConfig.ts +++ b/private/aws-protocoltests-ec2/src/runtimeConfig.ts @@ -36,6 +36,7 @@ export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -47,22 +48,29 @@ export const getRuntimeConfig = (config: EC2ProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts b/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts index 06558c9ff5dd..0598872cd4d4 100644 --- a/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts +++ b/private/aws-protocoltests-json-10/src/JSONRPC10Client.ts @@ -235,6 +235,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-json-10/src/runtimeConfig.ts b/private/aws-protocoltests-json-10/src/runtimeConfig.ts index a8b81e83772e..64d547194dd5 100644 --- a/private/aws-protocoltests-json-10/src/runtimeConfig.ts +++ b/private/aws-protocoltests-json-10/src/runtimeConfig.ts @@ -36,6 +36,7 @@ export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -47,22 +48,29 @@ export const getRuntimeConfig = (config: JSONRPC10ClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-json-machinelearning/src/MachineLearningClient.ts b/private/aws-protocoltests-json-machinelearning/src/MachineLearningClient.ts index 6601d24c3e03..e865667733f1 100644 --- a/private/aws-protocoltests-json-machinelearning/src/MachineLearningClient.ts +++ b/private/aws-protocoltests-json-machinelearning/src/MachineLearningClient.ts @@ -162,6 +162,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-json-machinelearning/src/runtimeConfig.ts b/private/aws-protocoltests-json-machinelearning/src/runtimeConfig.ts index fe4ade50486b..faa80f3834e0 100644 --- a/private/aws-protocoltests-json-machinelearning/src/runtimeConfig.ts +++ b/private/aws-protocoltests-json-machinelearning/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: MachineLearningClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: MachineLearningClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-json/src/JsonProtocolClient.ts b/private/aws-protocoltests-json/src/JsonProtocolClient.ts index 999601cefa75..970cb32152e4 100644 --- a/private/aws-protocoltests-json/src/JsonProtocolClient.ts +++ b/private/aws-protocoltests-json/src/JsonProtocolClient.ts @@ -244,6 +244,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-json/src/runtimeConfig.ts b/private/aws-protocoltests-json/src/runtimeConfig.ts index 3247668cb2e8..df003b0234d7 100644 --- a/private/aws-protocoltests-json/src/runtimeConfig.ts +++ b/private/aws-protocoltests-json/src/runtimeConfig.ts @@ -36,6 +36,7 @@ export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -47,22 +48,29 @@ export const getRuntimeConfig = (config: JsonProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-query/src/QueryProtocolClient.ts b/private/aws-protocoltests-query/src/QueryProtocolClient.ts index 323e6f9d1e4b..52ad613c4572 100644 --- a/private/aws-protocoltests-query/src/QueryProtocolClient.ts +++ b/private/aws-protocoltests-query/src/QueryProtocolClient.ts @@ -292,6 +292,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-query/src/runtimeConfig.ts b/private/aws-protocoltests-query/src/runtimeConfig.ts index fdb361c0d7e3..b4a3f95cd306 100644 --- a/private/aws-protocoltests-query/src/runtimeConfig.ts +++ b/private/aws-protocoltests-query/src/runtimeConfig.ts @@ -36,6 +36,7 @@ export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -47,22 +48,29 @@ export const getRuntimeConfig = (config: QueryProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-restjson-apigateway/src/APIGatewayClient.ts b/private/aws-protocoltests-restjson-apigateway/src/APIGatewayClient.ts index f512309030e3..0f6556bfb0c5 100644 --- a/private/aws-protocoltests-restjson-apigateway/src/APIGatewayClient.ts +++ b/private/aws-protocoltests-restjson-apigateway/src/APIGatewayClient.ts @@ -163,6 +163,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-restjson-apigateway/src/runtimeConfig.ts b/private/aws-protocoltests-restjson-apigateway/src/runtimeConfig.ts index f1f0e992889b..933c6cd88012 100644 --- a/private/aws-protocoltests-restjson-apigateway/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restjson-apigateway/src/runtimeConfig.ts @@ -32,6 +32,7 @@ export const getRuntimeConfig = (config: APIGatewayClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -42,19 +43,25 @@ export const getRuntimeConfig = (config: APIGatewayClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-restjson-glacier/src/GlacierClient.ts b/private/aws-protocoltests-restjson-glacier/src/GlacierClient.ts index 77706c90a825..01d5145a2310 100644 --- a/private/aws-protocoltests-restjson-glacier/src/GlacierClient.ts +++ b/private/aws-protocoltests-restjson-glacier/src/GlacierClient.ts @@ -168,6 +168,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-restjson-glacier/src/runtimeConfig.ts b/private/aws-protocoltests-restjson-glacier/src/runtimeConfig.ts index 3a4a12051744..084d022b65bf 100644 --- a/private/aws-protocoltests-restjson-glacier/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restjson-glacier/src/runtimeConfig.ts @@ -33,6 +33,7 @@ export const getRuntimeConfig = (config: GlacierClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -44,19 +45,25 @@ export const getRuntimeConfig = (config: GlacierClientConfig) => { defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts index 15156c4f0f02..e2b1671a07dc 100644 --- a/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts +++ b/private/aws-protocoltests-restjson/src/RestJsonProtocolClient.ts @@ -647,6 +647,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-restjson/src/runtimeConfig.ts b/private/aws-protocoltests-restjson/src/runtimeConfig.ts index 4bcf96acb40d..59920d6ee44f 100644 --- a/private/aws-protocoltests-restjson/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restjson/src/runtimeConfig.ts @@ -37,6 +37,7 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -48,24 +49,31 @@ export const getRuntimeConfig = (config: RestJsonProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), md5: config?.md5 ?? Hash.bind(null, "md5"), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, streamHasher: config?.streamHasher ?? streamHasher, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts b/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts index b56ef81906c0..0ceb2ef9b2aa 100644 --- a/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts +++ b/private/aws-protocoltests-restxml/src/RestXmlProtocolClient.ts @@ -454,6 +454,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * Fetch related hostname, signing name or signing region with given region. * @internal diff --git a/private/aws-protocoltests-restxml/src/runtimeConfig.ts b/private/aws-protocoltests-restxml/src/runtimeConfig.ts index 62a2e67c7548..a9165ff2b007 100644 --- a/private/aws-protocoltests-restxml/src/runtimeConfig.ts +++ b/private/aws-protocoltests-restxml/src/runtimeConfig.ts @@ -36,6 +36,7 @@ export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); awsCheckVersion(process.version); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -47,22 +48,29 @@ export const getRuntimeConfig = (config: RestXmlProtocolClientConfig) => { config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), disableRequestCompression: - config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + config?.disableRequestCompression ?? loadNodeConfig(NODE_DISABLE_REQUEST_COMPRESSION_CONFIG_OPTIONS, config), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), requestMinCompressionSizeBytes: - config?.requestMinCompressionSizeBytes ?? loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS), + config?.requestMinCompressionSizeBytes ?? + loadNodeConfig(NODE_REQUEST_MIN_COMPRESSION_SIZE_BYTES_CONFIG_OPTIONS, config), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS), - useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS), - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + useDualstackEndpoint: + config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, profileConfig), + useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, profileConfig), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/src/RpcV2ProtocolClient.ts b/private/aws-protocoltests-smithy-rpcv2-cbor/src/RpcV2ProtocolClient.ts index ed330ed8f2a1..b8d8d56a2c9b 100644 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/src/RpcV2ProtocolClient.ts +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/src/RpcV2ProtocolClient.ts @@ -189,6 +189,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ disableHostPrefix?: boolean; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/private/aws-protocoltests-smithy-rpcv2-cbor/src/runtimeConfig.ts b/private/aws-protocoltests-smithy-rpcv2-cbor/src/runtimeConfig.ts index 14c3d28cd4cc..c29a4eaa74f2 100644 --- a/private/aws-protocoltests-smithy-rpcv2-cbor/src/runtimeConfig.ts +++ b/private/aws-protocoltests-smithy-rpcv2-cbor/src/runtimeConfig.ts @@ -23,6 +23,7 @@ export const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => { const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -31,16 +32,19 @@ export const getRuntimeConfig = (config: RpcV2ProtocolClientConfig) => { bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/weather-legacy-auth/src/WeatherClient.ts b/private/weather-legacy-auth/src/WeatherClient.ts index 5370f1e865f8..2e7de8a0a449 100644 --- a/private/weather-legacy-auth/src/WeatherClient.ts +++ b/private/weather-legacy-auth/src/WeatherClient.ts @@ -194,6 +194,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/private/weather-legacy-auth/src/runtimeConfig.ts b/private/weather-legacy-auth/src/runtimeConfig.ts index 1790a34f9611..f302bd8bf549 100644 --- a/private/weather-legacy-auth/src/runtimeConfig.ts +++ b/private/weather-legacy-auth/src/runtimeConfig.ts @@ -25,6 +25,7 @@ export const getRuntimeConfig = (config: WeatherClientConfig) => { const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -34,17 +35,22 @@ export const getRuntimeConfig = (config: WeatherClientConfig) => { credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider, defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/private/weather/src/WeatherClient.ts b/private/weather/src/WeatherClient.ts index af6de29cc225..0c2d327baecd 100644 --- a/private/weather/src/WeatherClient.ts +++ b/private/weather/src/WeatherClient.ts @@ -193,6 +193,25 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand */ region?: string | __Provider; + /** + * Setting a client profile is similar to setting a value for the + * AWS_PROFILE environment variable. Setting a profile on a client + * in code only affects the single client instance, unlike AWS_PROFILE. + * + * When set, and only for environments where an AWS configuration + * file exists, fields configurable by this file will be retrieved + * from the specified profile within that file. + * Conflicting code configuration and environment variables will + * still have higher priority. + * + * For client credential resolution that involves checking the AWS + * configuration file, the client's profile (this value) will be + * used unless a different profile is set in the credential + * provider options. + * + */ + profile?: string; + /** * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header * @internal diff --git a/private/weather/src/runtimeConfig.ts b/private/weather/src/runtimeConfig.ts index 9beb4feb174c..29b0b16b69b2 100644 --- a/private/weather/src/runtimeConfig.ts +++ b/private/weather/src/runtimeConfig.ts @@ -25,6 +25,7 @@ export const getRuntimeConfig = (config: WeatherClientConfig) => { const defaultsMode = resolveDefaultsModeConfig(config); const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode); const clientSharedValues = getSharedRuntimeConfig(config); + const profileConfig = { profile: config?.profile }; return { ...clientSharedValues, ...config, @@ -34,17 +35,22 @@ export const getRuntimeConfig = (config: WeatherClientConfig) => { credentials: config?.credentials ?? credentialDefaultProvider(), defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ clientVersion: packageInfo.version }), - maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), - region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), + maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config), + region: + config?.region ?? + loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }), requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider), retryMode: config?.retryMode ?? - loadNodeConfig({ - ...NODE_RETRY_MODE_CONFIG_OPTIONS, - default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, - }), + loadNodeConfig( + { + ...NODE_RETRY_MODE_CONFIG_OPTIONS, + default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE, + }, + config + ), sha256: config?.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config?.streamCollector ?? streamCollector, - userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS), + userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, profileConfig), }; }; diff --git a/scripts/generate-clients/config.js b/scripts/generate-clients/config.js index 1c7336f5ed2f..3d828780ce65 100644 --- a/scripts/generate-clients/config.js +++ b/scripts/generate-clients/config.js @@ -1,7 +1,7 @@ // Update this commit when taking up new changes from smithy-typescript. module.exports = { // Use full commit hash as we explicitly fetch it. - SMITHY_TS_COMMIT: "0480559f3c3abe05771a292794bd94e62de3d4ee", + SMITHY_TS_COMMIT: "7fa6e5ecec01e783340ccaa8786f1f5786fa4fbc", }; if (module.exports.SMITHY_TS_COMMIT.length < 40) {