Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
fix: tweak secret template to work for production (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLicense authored Mar 15, 2024
1 parent cf48ce2 commit 1a997c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion config/autoload/config-paramater.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,19 @@

$environment = getenv('ENVIRONMENT_NAME');

// This logic will be moved to environment variables with the migration to ECS.
$isProduction = strtoupper($environment) === 'APP';
$isProductionAccount = in_array(strtoupper($environment), ['INT', 'PP', 'APP']);

$providers = [];

if (!empty($environment)) {
// The `int` environment is actually `nduint` in AWS Secrets Manager.
$secretsManagerEnvironmentName = ($environment === 'int' ? 'nduint' : $environment);

$providers = [
SecretsManager::class => [
sprintf('DEVAPP%s-BASE-SM-APPLICATION-INTERNAL', strtoupper($environment)),
sprintf('%sAPP%s-BASE-SM-APPLICATION-INTERNAL', ($isProductionAccount ? "" : "DEV"), ($isProduction ? "" : strtoupper($secretsManagerEnvironmentName))),
],
ParameterStore::class => [
sprintf('/applicationparams/%s/', strtolower($environment)),
Expand Down

0 comments on commit 1a997c1

Please sign in to comment.