File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ const fs = require('fs')
77const path = require ( 'path' )
88require ( 'dotenv' ) . config ( ) ;
99
10- // the env LOCALSTACK_HOSTNAME is automatically injected and available
11- const hostname = process . env . LOCALSTACK_HOSTNAME ;
10+ // the env AWS_ENDPOINT_URL is automatically injected and available
11+ const endpoint = process . env . AWS_ENDPOINT_URL ;
12+ const url = new URL ( endpoint ) ;
13+ const hostname = url . hostname ;
1214
1315// configure the secretsmanager to connect to the running LocalStack instance
1416const secrets = new AWS . SecretsManager ( {
15- endpoint : 'http://' + hostname + ':4566' ,
17+ endpoint : endpoint ,
1618 accessKeyId : 'test' ,
1719 secretAccessKey : 'test' ,
1820 region : 'us-east-1' ,
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ const mysql = require('mysql2')
22const AWS = require ( 'aws-sdk' )
33require ( 'dotenv' ) . config ( ) ;
44
5- // the env LOCALSTACK_HOSTNAME is automatically injected and available
6- const hostname = process . env . LOCALSTACK_HOSTNAME ;
5+ // the env AWS_ENDPOINT_URL is automatically injected and available
6+ const endpoint = process . env . AWS_ENDPOINT_URL ;
7+ const url = new URL ( endpoint ) ;
8+ const hostname = url . hostname ;
79
810// configure the secretsmanager to connect to the running LocalStack instance
911const secrets = new AWS . SecretsManager ( {
10- endpoint : 'http://' + hostname + ':4566' ,
12+ endpoint : endpoint ,
1113 accessKeyId : 'test' ,
1214 secretAccessKey : 'test' ,
1315 region : 'us-east-1' ,
You can’t perform that action at this time.
0 commit comments