39
39
* made at most in case of retry.</li>
40
40
* <li>retryMode: Specifies which retry algorithm to use.</li>
41
41
* <li>logger: Optional logger for logging debug/info/warn/error.</li>
42
+ * <li>useDualstackEndpoint: Enables IPv6/IPv4 dualstack endpoint.</li>
43
+ * <li>useFipsEndpoint: Enables FIPS compatible endpoints.</li>
42
44
* </ul>
43
45
*
44
46
* <p>This plugin adds the following Node runtime specific values:
47
49
* <li>maxAttempts: Uses the default maxAttempts provider that checks things
48
50
* like environment variables and the AWS config file.</li>
49
51
* <li>retryMode: Specifies which retry algorithm to use.</li>
50
- * <li>logger: Sets to empty as logger is passed in client configuration</li>
52
+ * <li>logger: Sets to empty as logger is passed in client configuration.</li>
53
+ * <li>useDualstackEndpoint: Uses default useDualstackEndpoint provider.</li>
54
+ * <li>useFipsEndpoint: Uses default useFipsEndpoint provider.</li>
51
55
* </ul>
52
56
*
53
57
* <p>This plugin adds the following Browser runtime specific values:
54
58
*
55
59
* <ul>
56
60
* <li>maxAttempts: Returns default value of 3.</li>
57
61
* <li>retryMode: Provider which returns DEFAULT_RETRY_MODE.</li>
58
- * <li>logger: Sets to empty as logger is passed in client configuration</li>
62
+ * <li>logger: Sets to empty as logger is passed in client configuration.</li>
63
+ * <li>useDualstackEndpoint: Sets to false.</li>
64
+ * <li>useFipsEndpoint: Sets to false.</li>
59
65
* </ul>
60
66
*/
61
67
@ SmithyInternalApi
@@ -77,6 +83,10 @@ public void addConfigInterfaceFields(
77
83
.write ("retryMode?: string | __Provider<string>;\n " );
78
84
writer .writeDocs ("Optional logger for logging debug/info/warn/error." )
79
85
.write ("logger?: __Logger;\n " );
86
+ writer .writeDocs ("Enables IPv6/IPv4 dualstack endpoint." )
87
+ .write ("useDualstackEndpoint?: boolean | __Provider<boolean>;\n " );
88
+ writer .writeDocs ("Enables FIPS compatible endpoints." )
89
+ .write ("useFipsEndpoint?: boolean | __Provider<boolean>;\n " );
80
90
}
81
91
82
92
@ Override
@@ -107,6 +117,18 @@ public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(
107
117
writer .addImport ("DEFAULT_RETRY_MODE" , "DEFAULT_RETRY_MODE" ,
108
118
TypeScriptDependency .MIDDLEWARE_RETRY .packageName );
109
119
writer .write ("(() => Promise.resolve(DEFAULT_RETRY_MODE))" );
120
+ },
121
+ "useDualstackEndpoint" , writer -> {
122
+ writer .addDependency (TypeScriptDependency .CONFIG_RESOLVER );
123
+ writer .addImport ("DEFAULT_USE_DUALSTACK_ENDPOINT" , "DEFAULT_USE_DUALSTACK_ENDPOINT" ,
124
+ TypeScriptDependency .CONFIG_RESOLVER .packageName );
125
+ writer .write ("(() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT))" );
126
+ },
127
+ "useFipsEndpoint" , writer -> {
128
+ writer .addDependency (TypeScriptDependency .CONFIG_RESOLVER );
129
+ writer .addImport ("DEFAULT_USE_FIPS_ENDPOINT" , "DEFAULT_USE_FIPS_ENDPOINT" ,
130
+ TypeScriptDependency .CONFIG_RESOLVER .packageName );
131
+ writer .write ("(() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT))" );
110
132
}
111
133
);
112
134
case NODE :
@@ -127,6 +149,26 @@ public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(
127
149
writer .addImport ("NODE_RETRY_MODE_CONFIG_OPTIONS" , "NODE_RETRY_MODE_CONFIG_OPTIONS" ,
128
150
TypeScriptDependency .MIDDLEWARE_RETRY .packageName );
129
151
writer .write ("loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS)" );
152
+ },
153
+ "useDualstackEndpoint" , writer -> {
154
+ writer .addDependency (AwsDependency .NODE_CONFIG_PROVIDER );
155
+ writer .addImport ("loadConfig" , "loadNodeConfig" ,
156
+ AwsDependency .NODE_CONFIG_PROVIDER .packageName );
157
+ writer .addDependency (TypeScriptDependency .CONFIG_RESOLVER );
158
+ writer .addImport ("NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS" ,
159
+ "NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS" ,
160
+ TypeScriptDependency .CONFIG_RESOLVER .packageName );
161
+ writer .write ("loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS)" );
162
+ },
163
+ "useFipsEndpoint" , writer -> {
164
+ writer .addDependency (AwsDependency .NODE_CONFIG_PROVIDER );
165
+ writer .addImport ("loadConfig" , "loadNodeConfig" ,
166
+ AwsDependency .NODE_CONFIG_PROVIDER .packageName );
167
+ writer .addDependency (TypeScriptDependency .CONFIG_RESOLVER );
168
+ writer .addImport ("NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS" ,
169
+ "NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS" ,
170
+ TypeScriptDependency .CONFIG_RESOLVER .packageName );
171
+ writer .write ("loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)" );
130
172
}
131
173
);
132
174
default :
0 commit comments