diff --git a/v1/iac/cfn/ecs/task.yaml b/v1/iac/cfn/ecs/task.yaml index 532c2a7..2d5ad1b 100644 --- a/v1/iac/cfn/ecs/task.yaml +++ b/v1/iac/cfn/ecs/task.yaml @@ -373,14 +373,16 @@ Resources: Value: !Ref ContainerPort - Name: "APP_CONFIG_CACHE" Value: !Ref ApplicationConfigCache - - Name: "APP_CONFIG_REGION" - Value: !Ref ApplicationRegion + - Name: "APP_CONFIG_ENVIRONMENT_IDENTIFIER" + Value: !Ref TagEnvironment - Name: "APP_CONFIG_FEATURE_FLAG_APP_IDENTIFIER" Value: !Ref ApplicationFeatureFlagId - Name: "APP_CONFIG_FREEFORM_APP_IDENTIFIER" Value: !Ref ApplicationFreeformId - - Name: "APP_CONFIG_ENVIRONMENT_IDENTIFIER" + - Name: "APP_CONFIG_PROFILE_IDENTIFIER" Value: !Ref TagEnvironment + - Name: "APP_CONFIG_REGION" + Value: !Ref ApplicationRegion - Name: !If [ Env1, !Ref EnvName1, "ENV1" ] Value: !If [ Env1, !Ref EnvValue1, !Ref "AWS::NoValue" ] - Name: !If [ Env2, !Ref EnvName2, "ENV2" ] diff --git a/v1/package.json b/v1/package.json index 5308a3b..dd9de56 100644 --- a/v1/package.json +++ b/v1/package.json @@ -1,6 +1,6 @@ { "name": "boilerplate-fargate-appconfig", - "version": "1.4.3", + "version": "1.4.4", "description": "This is a Fargate/AppConfig application boilerplate.", "main": "src/app.js", "type": "module", diff --git a/v1/src/app.js b/v1/src/app.js index 32739fb..5f5b0c2 100644 --- a/v1/src/app.js +++ b/v1/src/app.js @@ -19,11 +19,11 @@ import YAML from "yaml"; /* YAML parsing */ const __filename = url.fileURLToPath(import.meta.url), __dirname = path.dirname(__filename), APP_CONFIG_CACHE = process.env.APP_CONFIG_CACHE || 15, /* AppConfig cache time in seconds */ - APP_CONFIG_REGION = process.env.APP_CONFIG_REGION || "us-east-2", + APP_CONFIG_ENVIRONMENT_IDENTIFIER = process.env.APP_CONFIG_ENVIRONMENT_IDENTIFIER || "int", APP_CONFIG_FEATURE_FLAG_APP_IDENTIFIER = process.env.APP_CONFIG_FEATURE_FLAG_APP_IDENTIFIER || "boilerplate-fargate-appconfig-feature-flag", APP_CONFIG_FREEFORM_APP_IDENTIFIER = process.env.APP_CONFIG_FREEFORM_APP_IDENTIFIER || "boilerplate-fargate-appconfig-freeform", - APP_CONFIG_CONFIG_PROFILE_IDENTIFIER = process.env.APP_CONFIG_CONFIG_PROFILE_IDENTIFIER || "int", - APP_CONFIG_ENVIRONMENT_IDENTIFIER = process.env.APP_CONFIG_ENVIRONMENT_IDENTIFIER || "int", + APP_CONFIG_PROFILE_IDENTIFIER = process.env.APP_CONFIG_PROFILE_IDENTIFIER || "int", + APP_CONFIG_REGION = process.env.APP_CONFIG_REGION || "us-east-2", ENVIRONMENT=process.env.ENVIRONMENT || "NONE", HEALTH_CHECK_PATH=process.env.HEALTH_CHECK_PATH || "/hc/", HOSTNAME=process.env.HOSTNAME || "localhost", @@ -39,13 +39,13 @@ const client = new AppConfigDataClient({ region: APP_CONFIG_REGION }), // Parameters for the AppConfig sessions. const appConfigFeatureFlag = { ApplicationIdentifier: APP_CONFIG_FEATURE_FLAG_APP_IDENTIFIER, - ConfigurationProfileIdentifier: APP_CONFIG_CONFIG_PROFILE_IDENTIFIER, + ConfigurationProfileIdentifier: APP_CONFIG_PROFILE_IDENTIFIER, EnvironmentIdentifier: APP_CONFIG_ENVIRONMENT_IDENTIFIER }; const appConfigFreeform = { ApplicationIdentifier: APP_CONFIG_FREEFORM_APP_IDENTIFIER, - ConfigurationProfileIdentifier: APP_CONFIG_CONFIG_PROFILE_IDENTIFIER, + ConfigurationProfileIdentifier: APP_CONFIG_PROFILE_IDENTIFIER, EnvironmentIdentifier: APP_CONFIG_ENVIRONMENT_IDENTIFIER };