From c02b8e970c8b05991fee24f58a0604e687aca1f4 Mon Sep 17 00:00:00 2001 From: Ryan Ling Date: Tue, 23 Feb 2021 00:01:50 +1100 Subject: [PATCH] Drop region parameterisation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🙊 --- .changeset/good-eggs-jog.md | 5 +++++ template/express-rest-api/.gantry/common.yml | 1 - template/express-rest-api/gantry.apply.yml | 3 +-- template/express-rest-api/src/config.ts | 3 --- template/express-rest-api/src/framework/logging.ts | 1 - template/koa-rest-api/.gantry/common.yml | 1 - template/koa-rest-api/gantry.apply.yml | 3 +-- template/koa-rest-api/src/config.ts | 3 --- template/koa-rest-api/src/framework/logging.ts | 1 - template/lambda-sqs-worker/src/config.ts | 3 --- template/lambda-sqs-worker/src/framework/logging.ts | 1 - 11 files changed, 7 insertions(+), 18 deletions(-) create mode 100644 .changeset/good-eggs-jog.md diff --git a/.changeset/good-eggs-jog.md b/.changeset/good-eggs-jog.md new file mode 100644 index 000000000..03533d632 --- /dev/null +++ b/.changeset/good-eggs-jog.md @@ -0,0 +1,5 @@ +--- +'skuba': patch +--- + +**template:** Drop region parameterisation diff --git a/template/express-rest-api/.gantry/common.yml b/template/express-rest-api/.gantry/common.yml index eb9e563f2..75bbe1193 100644 --- a/template/express-rest-api/.gantry/common.yml +++ b/template/express-rest-api/.gantry/common.yml @@ -1,7 +1,6 @@ prodAccountId: '<%- prodAwsAccountId %>' image: '{{values "prodAccountId"}}.dkr.ecr.ap-southeast-2.amazonaws.com/{{values "service"}}:{{.BuildID}}' -region: ap-southeast-2 service: '<%- serviceName %>' # TODO: enable Datadog agent diff --git a/template/express-rest-api/gantry.apply.yml b/template/express-rest-api/gantry.apply.yml index 4c32cc231..5e6d65789 100644 --- a/template/express-rest-api/gantry.apply.yml +++ b/template/express-rest-api/gantry.apply.yml @@ -6,14 +6,13 @@ name: '{{values "service"}}' image: '{{values "image"}}' -region: '{{values "region"}}' +region: ap-southeast-2 env: # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1' ENVIRONMENT: '{{.Environment}}' - REGION: '{{values "region"}}' SERVICE: '{{values "service"}}' {{range $key, $value := .Values.env}} diff --git a/template/express-rest-api/src/config.ts b/template/express-rest-api/src/config.ts index e7a4dfc30..f2b8117df 100644 --- a/template/express-rest-api/src/config.ts +++ b/template/express-rest-api/src/config.ts @@ -5,7 +5,6 @@ interface Config { logLevel: string; name: string; - region: string; version: string; metricsServer?: string; @@ -26,7 +25,6 @@ const configs: Record Omit> = { local: () => ({ logLevel: 'debug', name: '<%- serviceName %>', - region: 'ap-southeast-2', version: 'local', port: Env.nonNegativeInteger('PORT', { default: Number('<%- port %>') }), @@ -48,7 +46,6 @@ const configs: Record Omit> = { [prod]: () => ({ logLevel: 'info', name: Env.string('SERVICE'), - region: Env.string('REGION'), version: Env.string('VERSION'), metricsServer: 'localhost', diff --git a/template/express-rest-api/src/framework/logging.ts b/template/express-rest-api/src/framework/logging.ts index 079367ebe..9bba3860e 100644 --- a/template/express-rest-api/src/framework/logging.ts +++ b/template/express-rest-api/src/framework/logging.ts @@ -5,7 +5,6 @@ import { config } from 'src/config'; export const rootLogger = createLogger({ base: { environment: config.environment, - region: config.region, version: config.version, }, diff --git a/template/koa-rest-api/.gantry/common.yml b/template/koa-rest-api/.gantry/common.yml index eb9e563f2..75bbe1193 100644 --- a/template/koa-rest-api/.gantry/common.yml +++ b/template/koa-rest-api/.gantry/common.yml @@ -1,7 +1,6 @@ prodAccountId: '<%- prodAwsAccountId %>' image: '{{values "prodAccountId"}}.dkr.ecr.ap-southeast-2.amazonaws.com/{{values "service"}}:{{.BuildID}}' -region: ap-southeast-2 service: '<%- serviceName %>' # TODO: enable Datadog agent diff --git a/template/koa-rest-api/gantry.apply.yml b/template/koa-rest-api/gantry.apply.yml index fe5977a9a..9a961e927 100644 --- a/template/koa-rest-api/gantry.apply.yml +++ b/template/koa-rest-api/gantry.apply.yml @@ -6,14 +6,13 @@ name: '{{values "service"}}' image: '{{values "image"}}' -region: '{{values "region"}}' +region: ap-southeast-2 env: # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1' ENVIRONMENT: '{{.Environment}}' - REGION: '{{values "region"}}' SERVICE: '{{values "service"}}' {{range $key, $value := .Values.env}} diff --git a/template/koa-rest-api/src/config.ts b/template/koa-rest-api/src/config.ts index e7a4dfc30..f2b8117df 100644 --- a/template/koa-rest-api/src/config.ts +++ b/template/koa-rest-api/src/config.ts @@ -5,7 +5,6 @@ interface Config { logLevel: string; name: string; - region: string; version: string; metricsServer?: string; @@ -26,7 +25,6 @@ const configs: Record Omit> = { local: () => ({ logLevel: 'debug', name: '<%- serviceName %>', - region: 'ap-southeast-2', version: 'local', port: Env.nonNegativeInteger('PORT', { default: Number('<%- port %>') }), @@ -48,7 +46,6 @@ const configs: Record Omit> = { [prod]: () => ({ logLevel: 'info', name: Env.string('SERVICE'), - region: Env.string('REGION'), version: Env.string('VERSION'), metricsServer: 'localhost', diff --git a/template/koa-rest-api/src/framework/logging.ts b/template/koa-rest-api/src/framework/logging.ts index 8f323da7e..8dddb8b3f 100644 --- a/template/koa-rest-api/src/framework/logging.ts +++ b/template/koa-rest-api/src/framework/logging.ts @@ -7,7 +7,6 @@ import { Context } from 'src/types/koa'; export const rootLogger = createLogger({ base: { environment: config.environment, - region: config.region, version: config.version, }, diff --git a/template/lambda-sqs-worker/src/config.ts b/template/lambda-sqs-worker/src/config.ts index ae1946013..50b57844e 100644 --- a/template/lambda-sqs-worker/src/config.ts +++ b/template/lambda-sqs-worker/src/config.ts @@ -5,7 +5,6 @@ interface Config { logLevel: string; name: string; - region: string; version: string; destinationSnsTopicArn: string; @@ -22,7 +21,6 @@ const configs: Record Omit> = { local: () => ({ logLevel: 'debug', name: '<%- serviceName %>', - region: 'ap-southeast-2', version: 'local', destinationSnsTopicArn: 'arn:aws:sns:us-east-2:123456789012:destination', @@ -44,7 +42,6 @@ const configs: Record Omit> = { prod: () => ({ logLevel: 'info', name: Env.string('SERVICE'), - region: Env.string('AWS_REGION'), version: Env.string('VERSION'), destinationSnsTopicArn: Env.string('DESTINATION_SNS_TOPIC_ARN'), diff --git a/template/lambda-sqs-worker/src/framework/logging.ts b/template/lambda-sqs-worker/src/framework/logging.ts index 4248877bc..a05f00613 100644 --- a/template/lambda-sqs-worker/src/framework/logging.ts +++ b/template/lambda-sqs-worker/src/framework/logging.ts @@ -6,7 +6,6 @@ import { config } from 'src/config'; export const rootLogger = createLogger({ base: { environment: config.environment, - region: config.region, version: config.version, },