How to use the @aws-cdk/aws-logs.LogGroup function in @aws-cdk/aws-logs

To help you get started, we’ve selected a few @aws-cdk/aws-logs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-ecs / lib / log-drivers / aws-log-driver.ts View on Github external
public bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig {
    this.logGroup = this.props.logGroup || new logs.LogGroup(scope, 'LogGroup', {
        retention: this.props.logRetention || Infinity,
    });

    this.logGroup.grantWrite(containerDefinition.taskDefinition.obtainExecutionRole());

    return {
      logDriver: 'awslogs',
      options: removeEmpty({
        'awslogs-group': this.logGroup.logGroupName,
        'awslogs-stream-prefix': this.props.streamPrefix,
        'awslogs-region': Stack.of(containerDefinition).region,
        'awslogs-datetime-format': this.props.datetimeFormat,
        'awslogs-multiline-pattern': this.props.multilinePattern,
      }),
    };
  }
github seagull-js / seagull / packages / deploy-aws / src / seagull_stack.ts View on Github external
addLogGroup(logGroupName: string) {
    const retentionDays = Infinity
    const props = { logGroupName, retentionDays, retainLogGroup: false }
    return new LogGroup(this, `${this.id}-${logGroupName}`, props)
  }

@aws-cdk/aws-logs

The CDK Construct Library for AWS::Logs

Apache-2.0
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis