File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,23 @@ function isValidEndpointUrl(url: string | undefined): boolean {
6868 }
6969}
7070
71- function checkIfConfigNeedsOverride ( section : IniSection | undefined ) : boolean {
71+ async function checkIfConfigNeedsOverride (
72+ section : IniSection | undefined ,
73+ ) : Promise < boolean > {
7274 if ( ! section ) {
7375 return true ; // profile doesn't exist
7476 }
7577
78+ if (
79+ section . properties . endpoint_url === "http://localhost.localstack.cloud:4566"
80+ ) {
81+ const isDnsResolved = await dnsResolveCheck ( undefined ) ;
82+ if ( ! isDnsResolved ) {
83+ // if DNS is not resolved, we need to override the endpoint_url
84+ return true ;
85+ }
86+ }
87+
7688 return ! (
7789 section . properties . region &&
7890 section . properties . endpoint_url &&
@@ -317,7 +329,7 @@ export async function configureAwsProfiles(options: {
317329 let configModified : boolean | undefined ;
318330 let credentialsModified : boolean | undefined ;
319331
320- const configNeedsOverride = checkIfConfigNeedsOverride ( configSection ) ;
332+ const configNeedsOverride = await checkIfConfigNeedsOverride ( configSection ) ;
321333 const credentialsNeedsOverride =
322334 checkIfCredentialsNeedsOverride ( credentialsSection ) ;
323335
You can’t perform that action at this time.
0 commit comments