From 2e30ea8dc5b9e4f92a37f6ca7187b15f0d1d3ee6 Mon Sep 17 00:00:00 2001 From: Sam Ainsworth Date: Fri, 10 Nov 2023 14:13:42 +0000 Subject: [PATCH] UML-3177 Remove hardcoded region from applications --- service-api/app/features/bootstrap/config.php | 2 +- .../src/App/src/DataAccess/ApiGateway/RequestSignerFactory.php | 2 +- .../test/BehatTest/DataAccess/ApiGateway/PactLpasFactory.php | 2 +- service-front/app/config/autoload/envs.global.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/service-api/app/features/bootstrap/config.php b/service-api/app/features/bootstrap/config.php index 424f50cf55..cf140171f9 100644 --- a/service-api/app/features/bootstrap/config.php +++ b/service-api/app/features/bootstrap/config.php @@ -18,7 +18,7 @@ ], 'aws' => [ - 'region' => 'eu-west-1', + 'region' => getenv('AWS_REGION') ?: null, 'version' => 'latest', 'DynamoDb' => [ diff --git a/service-api/app/src/App/src/DataAccess/ApiGateway/RequestSignerFactory.php b/service-api/app/src/App/src/DataAccess/ApiGateway/RequestSignerFactory.php index 92ac7bf8c6..ca9a806bc8 100644 --- a/service-api/app/src/App/src/DataAccess/ApiGateway/RequestSignerFactory.php +++ b/service-api/app/src/App/src/DataAccess/ApiGateway/RequestSignerFactory.php @@ -15,6 +15,6 @@ public function __invoke(ContainerInterface $container): RequestSigner $token = $config['codes_api']['static_auth_token'] ?? null; - return new RequestSigner(new SignatureV4('execute-api', 'eu-west-1'), $token); + return new RequestSigner(new SignatureV4('execute-api', $config['aws']['region']), $token); } } diff --git a/service-api/app/test/BehatTest/DataAccess/ApiGateway/PactLpasFactory.php b/service-api/app/test/BehatTest/DataAccess/ApiGateway/PactLpasFactory.php index ebdb41f407..d238b89ce2 100644 --- a/service-api/app/test/BehatTest/DataAccess/ApiGateway/PactLpasFactory.php +++ b/service-api/app/test/BehatTest/DataAccess/ApiGateway/PactLpasFactory.php @@ -26,7 +26,7 @@ public function __invoke(ContainerInterface $container) return new Lpas( new HttpClient(), - new SignatureV4('execute-api', 'eu-west-1'), + new SignatureV4('execute-api', $config['aws']['region']), $apiHost, $container->get(RequestTracing::TRACE_PARAMETER_NAME), $container->get(SiriusLpaSanitiser::class), diff --git a/service-front/app/config/autoload/envs.global.php b/service-front/app/config/autoload/envs.global.php index fea9c34ef8..1a4615dbbd 100644 --- a/service-front/app/config/autoload/envs.global.php +++ b/service-front/app/config/autoload/envs.global.php @@ -12,7 +12,7 @@ 'uri' => getenv('PDF_SERVICE_URL') ?: null, ], 'aws' => [ - 'region' => 'eu-west-1', + 'region' => getenv('AWS_REGION') ?: null, 'version' => 'latest', 'Kms' => [ 'endpoint' => getenv('AWS_ENDPOINT_KMS') ?: null,