UNPKG

2.11 kBTypeScriptView Raw
1import { ContainerDefinition } from '../container-definition';
2import { CfnTaskDefinition } from '../ecs.generated';
3import { AwsLogDriverProps } from './aws-log-driver';
4import { Construct as CoreConstruct } from '@aws-cdk/core';
5/**
6 * The base class for log drivers.
7 */
8export declare abstract class LogDriver {
9 /**
10 * Creates a log driver configuration that sends log information to CloudWatch Logs.
11 */
12 static awsLogs(props: AwsLogDriverProps): LogDriver;
13 /**
14 * Called when the log driver is configured on a container
15 */
16 abstract bind(scope: CoreConstruct, containerDefinition: ContainerDefinition): LogDriverConfig;
17}
18/**
19 * The configuration to use when creating a log driver.
20 */
21export interface LogDriverConfig {
22 /**
23 * The log driver to use for the container. The valid values listed for this parameter are log drivers
24 * that the Amazon ECS container agent can communicate with by default.
25 *
26 * For tasks using the Fargate launch type, the supported log drivers are awslogs, splunk, and awsfirelens.
27 * For tasks using the EC2 launch type, the supported log drivers are awslogs, fluentd, gelf, json-file, journald,
28 * logentries,syslog, splunk, and awsfirelens.
29 *
30 * For more information about using the awslogs log driver, see
31 * [Using the awslogs Log Driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html)
32 * in the Amazon Elastic Container Service Developer Guide.
33 *
34 * For more information about using the awsfirelens log driver, see
35 * [Custom Log Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html)
36 * in the Amazon Elastic Container Service Developer Guide.
37 */
38 readonly logDriver: string;
39 /**
40 * The configuration options to send to the log driver.
41 */
42 readonly options?: {
43 [key: string]: string;
44 };
45 /**
46 * The secrets to pass to the log configuration.
47 * @default - No secret options provided.
48 */
49 readonly secretOptions?: CfnTaskDefinition.SecretProperty[];
50}