Skip to content

Commit

Permalink
fix(ecs): fix splunk-sourcetype (#6128)
Browse files Browse the repository at this point in the history
* fix(splunk-log-driver): correct misspelling of splunk-sourcetype (#5456)

* Reverted changes to yarn.lock
  • Loading branch information
Stericson committed Feb 5, 2020
1 parent 505c91e commit 6456a7c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Expand Up @@ -132,7 +132,7 @@ export class SplunkLogDriver extends LogDriver {
'splunk-token': this.props.token,
'splunk-url': this.props.url,
'splunk-source': this.props.source,
'splunk-sourceType': this.props.sourceType,
'splunk-sourcetype': this.props.sourceType,
'splunk-index': this.props.index,
'splunk-capath': this.props.caPath,
'splunk-caname': this.props.caName,
Expand Down
31 changes: 31 additions & 0 deletions packages/@aws-cdk/aws-ecs/test/test.splunk-log-driver.ts
Expand Up @@ -72,4 +72,35 @@ export = {

test.done();
},

"create a splunk log driver using splunk with sourcetype defined"(test: Test) {
// WHEN
td.addContainer('Container', {
image,
logging: ecs.LogDrivers.splunk({
token: cdk.SecretValue.secretsManager('my-splunk-token'),
url: 'my-splunk-url',
sourceType: 'my-source-type'
}),
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-sourcetype': 'my-source-type'
}
}
}
]
}));

test.done();
},
};

0 comments on commit 6456a7c

Please sign in to comment.