diff --git a/backend-api/template.yaml b/backend-api/template.yaml index 312e4ec7..ac1c7b40 100644 --- a/backend-api/template.yaml +++ b/backend-api/template.yaml @@ -32,6 +32,18 @@ Parameters: Default: none Mappings: + EnvironmentConfiguration: + dev: + dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables + build: + dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables + staging: + dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables + integration: + dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceNonProductionVariables + production: + dynatraceSecretArn: arn:aws:secretsmanager:eu-west-2:216552277552:secret:DynatraceProductionVariables + PrivateApigw: dev: ApiBurstLimit: 10 @@ -210,6 +222,27 @@ Globals: # ISSUER should be updated with DNS once available ISSUER: mockIssuer SESSION_TABLE_NAME: !Ref SessionsTable + AWS_LAMBDA_EXEC_WRAPPER: /opt/dynatrace + DT_CONNECTION_AUTH_TOKEN: !Sub + - '{{resolve:secretsmanager:${SecretArn}:SecretString:DT_CONNECTION_AUTH_TOKEN}}' + - SecretArn: !FindInMap [ EnvironmentConfiguration, !Ref Environment, dynatraceSecretArn ] + DT_CONNECTION_BASE_URL: !Sub + - '{{resolve:secretsmanager:${SecretArn}:SecretString:DT_CONNECTION_BASE_URL}}' + - SecretArn: !FindInMap [ EnvironmentConfiguration, !Ref Environment, dynatraceSecretArn ] + DT_CLUSTER_ID: !Sub + - '{{resolve:secretsmanager:${SecretArn}:SecretString:DT_CLUSTER_ID}}' + - SecretArn: !FindInMap [ EnvironmentConfiguration, !Ref Environment, dynatraceSecretArn ] + DT_LOG_COLLECTION_AUTH_TOKEN: !Sub + - '{{resolve:secretsmanager:${SecretArn}:SecretString:DT_LOG_COLLECTION_AUTH_TOKEN}}' + - SecretArn: !FindInMap [ EnvironmentConfiguration, !Ref Environment, dynatraceSecretArn ] + DT_TENANT: !Sub + - '{{resolve:secretsmanager:${SecretArn}:SecretString:DT_TENANT}}' + - SecretArn: !FindInMap [ EnvironmentConfiguration, !Ref Environment, dynatraceSecretArn ] + DT_OPEN_TELEMETRY_ENABLE_INTEGRATION: "true" + Layers: + - !Sub + - '{{resolve:secretsmanager:${SecretArn}:SecretString:NODEJS_LAYER}}' + - SecretArn: !FindInMap [ EnvironmentConfiguration, !Ref Environment, dynatraceSecretArn ] Resources: diff --git a/backend-api/tests/infra-tests/application.test.ts b/backend-api/tests/infra-tests/application.test.ts index dbcd2f88..14bb299f 100644 --- a/backend-api/tests/infra-tests/application.test.ts +++ b/backend-api/tests/infra-tests/application.test.ts @@ -407,6 +407,13 @@ describe("Backend application infrastructure", () => { "ISSUER", "TXMA_SQS", "SESSION_TABLE_NAME", + "AWS_LAMBDA_EXEC_WRAPPER", + "DT_CONNECTION_AUTH_TOKEN", + "DT_CONNECTION_BASE_URL", + "DT_CLUSTER_ID", + "DT_LOG_COLLECTION_AUTH_TOKEN", + "DT_TENANT", + "DT_OPEN_TELEMETRY_ENABLE_INTEGRATION", ]; const envVars = template.toJSON().Globals.Function.Environment.Variables;