Skip to content

Commit

Permalink
template/*-rest-api: Clean up templated environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
72636c committed May 22, 2024
1 parent 6855c0f commit c7923ec
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
11 changes: 11 additions & 0 deletions .changeset/violet-crabs-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'skuba': patch
---

template/\*-rest-api: Clean up templated environment variables

- `AWS_NODEJS_CONNECTION_REUSE_ENABLED` is no longer required with AWS SDK V3.

- The `env` boilerplate in Gantry values files was largely unnecessary and confusing.

Our templates prefer to declare configuration values directly in `src/config.ts`.
2 changes: 0 additions & 2 deletions template/express-rest-api/.gantry/dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
environment: dev
env:
SOME_ENVIRONMENT_VARIABLE: dev-value

maxInstanceCount: 1
minInstanceCount: 1
Expand Down
2 changes: 0 additions & 2 deletions template/express-rest-api/.gantry/prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
environment: prod
env:
SOME_ENVIRONMENT_VARIABLE: prod-value

maxInstanceCount: 10
minInstanceCount: 3
7 changes: 0 additions & 7 deletions template/express-rest-api/gantry.apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@ owner: '{{values "owner"}}'
image: '{{values "image"}}'

env:
# https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'

ENVIRONMENT: '{{values "environment"}}'
SERVICE: '{{values "service"}}'

{{range $key, $value := .Values.env}}
{{$key}}: {{$value}}
{{end}}

{{if .Values.cloudwatchDashboardDisabled}}
cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
{{end}}
Expand Down
2 changes: 0 additions & 2 deletions template/koa-rest-api/.gantry/dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
environment: dev
env:
SOME_ENVIRONMENT_VARIABLE: dev-value

maxInstanceCount: 1
minInstanceCount: 1
Expand Down
2 changes: 0 additions & 2 deletions template/koa-rest-api/.gantry/prod.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
environment: prod
env:
SOME_ENVIRONMENT_VARIABLE: prod-value

maxInstanceCount: 10
minInstanceCount: 3
Expand Down
7 changes: 0 additions & 7 deletions template/koa-rest-api/gantry.apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ owner: '{{values "owner"}}'
image: '{{values "image"}}'

env:
# https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'

ENVIRONMENT: '{{values "environment"}}'
OPENTELEMETRY_ENABLED: '{{.Values.openTelemetry.enabled | default false}}'
SERVICE: '{{values "service"}}'

{{range $key, $value := .Values.env}}
{{$key}}: {{$value}}
{{end}}

{{if .Values.cloudwatchDashboardDisabled}}
cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
{{end}}
Expand Down

0 comments on commit c7923ec

Please sign in to comment.