From eaf293ae936e4c085c1e0ef4702ba5df0ce8c9f5 Mon Sep 17 00:00:00 2001 From: Benjamin Genz Date: Wed, 31 Mar 2021 09:33:30 +0200 Subject: [PATCH] Revert "fix(aws-ecs): broken splunk-logging `tag`-option in fargate platform version 1.4 (#13882)" This reverts commit e9d9299b6bcdab489d94c974074e8c796bce00f3. Unfortunately the above commit leads to broken deployments that are caused by behaviors upstream (i.e. in the ECS backend): > Resource handler returned message: "Invalid request provided: Create TaskDefinition: Log driver splunk disallows options: splunk-tag (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID: d13abe56-36fa-4e81-b980-bf83789d4d0d; Proxy : null)" (RequestToken: 546a74e2-a2eb-ef75-43e7-231fe8927096, HandlerErrorCode: InvalidRequest) This means however, that the buggy behavior mentioned in #13881 persists. --- .../lib/log-drivers/splunk-log-driver.ts | 1 - .../aws-ecs/test/splunk-log-driver.test.ts | 31 ------------------- 2 files changed, 32 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts b/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts index b536db6003ec3..ecb4d9f0dd9c1 100644 --- a/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/lib/log-drivers/splunk-log-driver.ts @@ -145,7 +145,6 @@ export class SplunkLogDriver extends LogDriver { 'splunk-verify-connection': this.props.verifyConnection, 'splunk-gzip': this.props.gzip, 'splunk-gzip-level': this.props.gzipLevel, - 'splunk-tag': this.props.tag, ...renderCommonLogDriverOptions(this.props), }), }; diff --git a/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts b/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts index fb1091a3ae027..c8afd01daade1 100644 --- a/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts +++ b/packages/@aws-cdk/aws-ecs/test/splunk-log-driver.test.ts @@ -103,35 +103,4 @@ nodeunitShim({ test.done(); }, - - 'create a splunk log driver using splunk-tag property when tag is defined'(test: Test) { - // WHEN - td.addContainer('Container', { - image, - logging: ecs.LogDrivers.splunk({ - token: cdk.SecretValue.secretsManager('my-splunk-token'), - url: 'my-splunk-url', - tag: 'abc', - }), - memoryLimitMiB: 128, - }); - - // THEN - expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - ContainerDefinitions: [ - { - LogConfiguration: { - LogDriver: 'splunk', - Options: { - 'splunk-token': '{{resolve:secretsmanager:my-splunk-token:SecretString:::}}', - 'splunk-url': 'my-splunk-url', - 'splunk-tag': 'abc', - }, - }, - }, - ], - })); - - test.done(); - }, });