aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

(@aws-cdk/aws-ecs): Expose logdriver "mode" property for @aws-cdk/aws-ecs.AwsLogDriverProps

Open nicohartto opened this issue 5 years ago • 4 comments

Currently it is possible to change aws logdriver "mode" in CloudFormation https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html

But AwsLogDriverProps do not expose the property in CDK.

Use Case

We have a performance need to deliver logs, but the ordering is not as relevant to us. Adjusting the mode to non-blocking would help.

Proposed Solution

Add "mode" as configurable option for AwsLogDriverProps / reach parity with CloudFormation API.

Other

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html

This is a :rocket: Feature Request

nicohartto avatar Mar 29 '21 13:03 nicohartto

@SoManyHs Can I pick this up?

hassanazharkhan avatar Mar 30 '21 09:03 hassanazharkhan

@hassanazharkhan absolutely!! We'd love your contribution. I'll go ahead and assign you to this issue!

SoManyHs avatar Mar 30 '21 17:03 SoManyHs

In case anyone is looking for a workaround while this feature is in progress:

It is possible to adjust this flag by falling back to the L1 Cfn resources. Using a L3 ApplicationLoadBalancedEc2Service as an example:

const albEc2Service = new ecs_patterns.ApplicationLoadBalancedEc2Service(...);

let cfnTaskDefinition = albEc2Service.taskDefinition.node.defaultChild as ecs.CfnTaskDefinition;
cfnTaskDefinition.addPropertyOverride('ContainerDefinitions.0.LogConfiguration.Options', {
  'mode': 'non-blocking'
});

This can of course be used on anything that surfaces a L2 TaskDefinition. 👍

Bio2hazard avatar Mar 31 '21 17:03 Bio2hazard

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar May 04 '21 18:05 github-actions[bot]