Skip to content

Commit

Permalink
Merge pull request #36 from WarnerMedia/f/NGTSK-147/application-refin…
Browse files Browse the repository at this point in the history
…ement

fix: Adding missing AppConfig environment variable (NGTSK-147)
  • Loading branch information
ngamradt-turner authored Aug 26, 2022
2 parents e11fa3e + c8e75be commit 5a4ce73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 5 additions & 3 deletions v1/iac/cfn/ecs/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
Expand Down
2 changes: 1 addition & 1 deletion v1/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 5 additions & 5 deletions v1/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
};

Expand Down

0 comments on commit 5a4ce73

Please sign in to comment.