agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,120 @@
import type { Construct } from 'constructs';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import * as logs from '../../../aws-logs';
import type { Size } from '../../../core';
import type { ContainerDefinition } from '../container-definition';
/**
* awslogs provides two modes for delivering messages from the container to the log driver
*/
export declare enum AwsLogDriverMode {
/**
* (default) direct, blocking delivery from container to driver.
*/
BLOCKING = "blocking",
/**
* The non-blocking message delivery mode prevents applications from blocking due to logging back pressure.
* Applications are likely to fail in unexpected ways when STDERR or STDOUT streams block.
*/
NON_BLOCKING = "non-blocking"
}
/**
* Specifies the awslogs log driver configuration options.
*/
export interface AwsLogDriverProps {
/**
* Prefix for the log streams
*
* The awslogs-stream-prefix option allows you to associate a log stream
* with the specified prefix, the container name, and the ID of the Amazon
* ECS task to which the container belongs. If you specify a prefix with
* this option, then the log stream takes the following format:
*
* prefix-name/container-name/ecs-task-id
*/
readonly streamPrefix: string;
/**
* The log group to log to
*
* @default - A log group is automatically created.
*/
readonly logGroup?: logs.ILogGroupRef;
/**
* The number of days log events are kept in CloudWatch Logs when the log
* group is automatically created by this construct.
*
* @default - Logs never expire.
*/
readonly logRetention?: logs.RetentionDays;
/**
* This option defines a multiline start pattern in Python strftime format.
*
* A log message consists of a line that matches the pattern and any
* following lines that dont match the pattern. Thus the matched line is
* the delimiter between log messages.
*
* @default - No multiline matching.
*/
readonly datetimeFormat?: string;
/**
* This option defines a multiline start pattern using a regular expression.
*
* A log message consists of a line that matches the pattern and any
* following lines that dont match the pattern. Thus the matched line is
* the delimiter between log messages.
*
* This option is ignored if datetimeFormat is also configured.
*
* @default - No multiline matching.
*/
readonly multilinePattern?: string;
/**
* The delivery mode of log messages from the container to awslogs.
*
* @default - AwsLogDriverMode.BLOCKING
*/
readonly mode?: AwsLogDriverMode;
/**
* When AwsLogDriverMode.NON_BLOCKING is configured, this parameter
* controls the size of the non-blocking buffer used to temporarily
* store messages. This parameter is not valid with
* AwsLogDriverMode.BLOCKING.
*
* @default - 1 megabyte if driver mode is non-blocking, otherwise this property is not set
*/
readonly maxBufferSize?: Size;
}
/**
* A log driver that sends log information to CloudWatch Logs.
*/
export declare class AwsLogDriver extends LogDriver {
private readonly props;
/**
* The log group to send log streams to.
*
* Only available after the LogDriver has been bound to a ContainerDefinition.
*/
private _logGroup?;
/**
* Constructs a new instance of the AwsLogDriver class.
*
* @param props the awslogs log driver configuration options.
*/
constructor(props: AwsLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig;
/**
* The log group to send log streams to.
*
* Only available after the LogDriver has been bound to a ContainerDefinition.
*/
get logGroup(): logs.ILogGroup | undefined;
/**
* The log group to send log streams to.
*
* Only available after the LogDriver has been bound to a ContainerDefinition.
*/
set logGroup(logGroup: logs.ILogGroup | undefined);
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AwsLogDriver=exports.AwsLogDriverMode=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},logs=()=>{var tmp=require("../../../aws-logs");return logs=()=>tmp,tmp},ref_utils_1=()=>{var tmp=require("../../../aws-logs/lib/private/ref-utils");return ref_utils_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},AwsLogDriverMode;(function(AwsLogDriverMode2){AwsLogDriverMode2.BLOCKING="blocking",AwsLogDriverMode2.NON_BLOCKING="non-blocking"})(AwsLogDriverMode||(exports.AwsLogDriverMode=AwsLogDriverMode={}));class AwsLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.AwsLogDriver",version:"2.252.0"};_logGroup;constructor(props){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_AwsLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,AwsLogDriver),error}if(props.logGroup&&props.logRetention)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotSpecifyBoth`,"Cannot specify both `logGroup` and `logRetentionDays`.");if(props.maxBufferSize&&props.mode!==AwsLogDriverMode.NON_BLOCKING)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotSpecifyDriverMaxBufferSize`,"Cannot specify `maxBufferSize` when the driver mode is blocking")}bind(scope,containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}this._logGroup=this.props.logGroup||new(logs()).LogGroup(scope,"LogGroup",{retention:this.props.logRetention||1/0});const maxBufferSize=this.props.maxBufferSize?`${this.props.maxBufferSize.toBytes({rounding:core_1().SizeRoundingBehavior.FLOOR})}b`:void 0;return containerDefinition.taskDefinition.obtainExecutionRole().addToPrincipalPolicy(new(iam()).PolicyStatement({actions:["logs:CreateLogStream","logs:PutLogEvents"],resources:[this._logGroup.logGroupRef.logGroupArn]})),{logDriver:"awslogs",options:(0,utils_1().removeEmpty)({"awslogs-group":this._logGroup.logGroupRef.logGroupName,"awslogs-stream-prefix":this.props.streamPrefix,"awslogs-region":this._logGroup.env.region,"awslogs-datetime-format":this.props.datetimeFormat,"awslogs-multiline-pattern":this.props.multilinePattern,mode:this.props.mode,"max-buffer-size":maxBufferSize})}}get logGroup(){return this._logGroup&&(0,ref_utils_1().toILogGroup)(this._logGroup)}set logGroup(logGroup){this._logGroup=logGroup}}exports.AwsLogDriver=AwsLogDriver;

View File

@@ -0,0 +1,34 @@
export interface BaseLogDriverProps {
/**
* By default, Docker uses the first 12 characters of the container ID to tag
* log messages. Refer to the log tag option documentation for customizing the
* log tag format.
*
* @default - The first 12 characters of the container ID
*/
readonly tag?: string;
/**
* The labels option takes an array of keys. If there is collision
* between label and env keys, the value of the env takes precedence. Adds additional
* fields to the extra attributes of a logging message.
*
* @default - No labels
*/
readonly labels?: string[];
/**
* The env option takes an array of keys. If there is collision between
* label and env keys, the value of the env takes precedence. Adds additional fields
* to the extra attributes of a logging message.
*
* @default - No env
*/
readonly env?: string[];
/**
* The env-regex option is similar to and compatible with env. Its value is a regular
* expression to match logging-related environment variables. It is used for advanced
* log tag options.
*
* @default - No envRegex
*/
readonly envRegex?: string;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});

View File

@@ -0,0 +1,49 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { ContainerDefinition, Secret } from '../container-definition';
/**
* Specifies the firelens log driver configuration options.
*/
export interface FireLensLogDriverProps extends BaseLogDriverProps {
/**
* The configuration options to send to the log driver.
* @default - the log driver options
*/
readonly options?: {
[key: string]: string;
};
/**
* The secrets to pass to the log configuration.
* @default - No secret options provided.
*/
readonly secretOptions?: {
[key: string]: Secret;
};
}
/**
* FireLens enables you to use task definition parameters to route logs to an AWS service
* or AWS Partner Network (APN) destination for log storage and analytics
*/
export declare class FireLensLogDriver extends LogDriver {
/**
* The configuration options to send to the log driver.
* @default - the log driver options
*/
private options?;
/**
* The secrets to pass to the log configuration.
* @default - No secret options provided.
*/
private secretOptions?;
/**
* Constructs a new instance of the FireLensLogDriver class.
* @param props the awsfirelens log driver configuration options.
*/
constructor(props: FireLensLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FireLensLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp};class FireLensLogDriver extends log_driver_1().LogDriver{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.FireLensLogDriver",version:"2.252.0"};options;secretOptions;constructor(props){super();try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_FireLensLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,FireLensLogDriver),error}this.options=props.options,this.secretOptions=props.secretOptions}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"awsfirelens",...this.options&&{options:(0,utils_1().removeEmpty)(this.options)},secretOptions:this.secretOptions&&(0,utils_1().renderLogDriverSecretOptions)(this.secretOptions,_containerDefinition.taskDefinition)}}}exports.FireLensLogDriver=FireLensLogDriver;

View File

@@ -0,0 +1,76 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { Duration } from '../../../core';
import type { ContainerDefinition } from '../container-definition';
/**
* Specifies the fluentd log driver configuration options.
*
* [Source](https://docs.docker.com/config/containers/logging/fluentd/)
*/
export interface FluentdLogDriverProps extends BaseLogDriverProps {
/**
* By default, the logging driver connects to localhost:24224. Supply the
* address option to connect to a different address. tcp(default) and unix
* sockets are supported.
*
* @default - address not set.
*/
readonly address?: string;
/**
* Docker connects to Fluentd in the background. Messages are buffered until
* the connection is established.
*
* @default - false
* @deprecated use `async` instead
*/
readonly asyncConnect?: boolean;
/**
* Docker connects to Fluentd in the background. Messages are buffered until
* the connection is established.
*
* @default - false
*/
readonly async?: boolean;
/**
* The amount of data to buffer before flushing to disk.
*
* @default - The amount of RAM available to the container.
*/
readonly bufferLimit?: number;
/**
* How long to wait between retries.
*
* @default - 1 second
*/
readonly retryWait?: Duration;
/**
* The maximum number of retries.
*
* @default - 4294967295 (2**32 - 1).
*/
readonly maxRetries?: number;
/**
* Generates event logs in nanosecond resolution.
*
* @default - false
*/
readonly subSecondPrecision?: boolean;
}
/**
* A log driver that sends log information to journald Logs.
*/
export declare class FluentdLogDriver extends LogDriver {
private readonly props;
/**
* Constructs a new instance of the FluentdLogDriver class.
*
* @param props the fluentd log driver configuration options.
*/
constructor(props?: FluentdLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FluentdLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp};class FluentdLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.FluentdLogDriver",version:"2.252.0"};constructor(props={}){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_FluentdLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,FluentdLogDriver),error}}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"fluentd",options:(0,utils_1().stringifyOptions)({"fluentd-address":this.props.address,"fluentd-async-connect":this.props.asyncConnect,"fluentd-async":this.props.async,"fluentd-buffer-limit":this.props.bufferLimit,"fluentd-retry-wait":this.props.retryWait&&this.props.retryWait.toSeconds(),"fluentd-max-retries":this.props.maxRetries,"fluentd-sub-second-precision":this.props.subSecondPrecision,...(0,utils_1().renderCommonLogDriverOptions)(this.props)})}}}exports.FluentdLogDriver=FluentdLogDriver;

View File

@@ -0,0 +1,71 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { Duration } from '../../../core';
import type { ContainerDefinition } from '../container-definition';
/**
* The type of compression the GELF driver uses to compress each log message.
*/
export declare enum GelfCompressionType {
GZIP = "gzip",
ZLIB = "zlib",
NONE = "none"
}
/**
* Specifies the journald log driver configuration options.
*
* [Source](https://docs.docker.com/config/containers/logging/gelf/)
*/
export interface GelfLogDriverProps extends BaseLogDriverProps {
/**
* The address of the GELF server. tcp and udp are the only supported URI
* specifier and you must specify the port.
*/
readonly address: string;
/**
* UDP Only The type of compression the GELF driver uses to compress each
* log message. Allowed values are gzip, zlib and none.
*
* @default - gzip
*/
readonly compressionType?: GelfCompressionType;
/**
* UDP Only The level of compression when gzip or zlib is the gelf-compression-type.
* An integer in the range of -1 to 9 (BestCompression). Higher levels provide more
* compression at lower speed. Either -1 or 0 disables compression.
*
* @default - 1
*/
readonly compressionLevel?: number;
/**
* TCP Only The maximum number of reconnection attempts when the connection drop.
* A positive integer.
*
* @default - 3
*/
readonly tcpMaxReconnect?: number;
/**
* TCP Only The number of seconds to wait between reconnection attempts.
* A positive integer.
*
* @default - 1
*/
readonly tcpReconnectDelay?: Duration;
}
/**
* A log driver that sends log information to journald Logs.
*/
export declare class GelfLogDriver extends LogDriver {
private readonly props;
/**
* Constructs a new instance of the GelfLogDriver class.
*
* @param props the gelf log driver configuration options.
*/
constructor(props: GelfLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GelfLogDriver=exports.GelfCompressionType=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp},GelfCompressionType;(function(GelfCompressionType2){GelfCompressionType2.GZIP="gzip",GelfCompressionType2.ZLIB="zlib",GelfCompressionType2.NONE="none"})(GelfCompressionType||(exports.GelfCompressionType=GelfCompressionType={}));class GelfLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.GelfLogDriver",version:"2.252.0"};constructor(props){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_GelfLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,GelfLogDriver),error}props.compressionLevel&&(0,utils_1().ensureInRange)(props.compressionLevel,-1,9),props.tcpMaxReconnect&&(0,utils_1().ensurePositiveInteger)(props.tcpMaxReconnect)}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"gelf",options:(0,utils_1().stringifyOptions)({"gelf-address":this.props.address,"gelf-compression-type":this.props.compressionType,"gelf-compression-level":this.props.compressionLevel,"gelf-tcp-max-reconnect":this.props.tcpMaxReconnect,"gelf-tcp-reconnect-delay":this.props.tcpReconnectDelay&&this.props.tcpReconnectDelay.toSeconds(),...(0,utils_1().renderCommonLogDriverOptions)(this.props)})}}}exports.GelfLogDriver=GelfLogDriver;

View File

@@ -0,0 +1,68 @@
import type { Construct } from 'constructs';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { ContainerDefinition, Secret } from '../container-definition';
/**
* The configuration to use when creating a log driver.
*/
export interface GenericLogDriverProps {
/**
* The log driver to use for the container. The valid values listed for this parameter are log drivers
* that the Amazon ECS container agent can communicate with by default.
*
* For tasks using the Fargate launch type, the supported log drivers are awslogs and splunk.
* For tasks using the EC2 launch type, the supported log drivers are awslogs, syslog, gelf, fluentd, splunk, journald, and json-file.
*
* For more information about using the awslogs log driver, see
* [Using the awslogs Log Driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html)
* in the Amazon Elastic Container Service Developer Guide.
*/
readonly logDriver: string;
/**
* The configuration options to send to the log driver.
* @default - the log driver options.
*/
readonly options?: {
[key: string]: string;
};
/**
* The secrets to pass to the log configuration.
* @default - no secret options provided.
*/
readonly secretOptions?: {
[key: string]: Secret;
};
}
/**
* A log driver that sends logs to the specified driver.
*/
export declare class GenericLogDriver extends LogDriver {
/**
* The log driver to use for the container. The valid values listed for this parameter are log drivers
* that the Amazon ECS container agent can communicate with by default. You cannot use awslogs with the GenericLogDriver.
* You must use the AwsLogDriver if you want to use awslogs.
*
* For tasks using the Fargate launch type, the supported log drivers are awslogs and splunk.
* For tasks using the EC2 launch type, the supported log drivers are awslogs, syslog, gelf, fluentd, splunk, journald, and json-file.
*
*/
private logDriver;
/**
* The configuration options to send to the log driver.
*/
private options;
/**
* The secrets to pass to the log configuration.
*/
private secretOptions?;
/**
* Constructs a new instance of the GenericLogDriver class.
*
* @param props the generic log driver configuration options.
*/
constructor(props: GenericLogDriverProps);
/**
* Called when the log driver is configured on a container.
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GenericLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp};class GenericLogDriver extends log_driver_1().LogDriver{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.GenericLogDriver",version:"2.252.0"};logDriver;options;secretOptions;constructor(props){super();try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_GenericLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,GenericLogDriver),error}this.logDriver=props.logDriver,this.options=props.options||{},this.secretOptions=props.secretOptions}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:this.logDriver,options:(0,utils_1().removeEmpty)(this.options),secretOptions:this.secretOptions&&(0,utils_1().renderLogDriverSecretOptions)(this.secretOptions,_containerDefinition.taskDefinition)}}}exports.GenericLogDriver=GenericLogDriver;

View File

@@ -0,0 +1,28 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { ContainerDefinition } from '../container-definition';
/**
* Specifies the journald log driver configuration options.
*
* [Source](https://docs.docker.com/config/containers/logging/journald/)
*/
export interface JournaldLogDriverProps extends BaseLogDriverProps {
}
/**
* A log driver that sends log information to journald Logs.
*/
export declare class JournaldLogDriver extends LogDriver {
private readonly props;
/**
* Constructs a new instance of the JournaldLogDriver class.
*
* @param props the journald log driver configuration options.
*/
constructor(props?: JournaldLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JournaldLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp};class JournaldLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.JournaldLogDriver",version:"2.252.0"};constructor(props={}){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_JournaldLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,JournaldLogDriver),error}}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"journald",options:(0,utils_1().stringifyOptions)({...(0,utils_1().renderCommonLogDriverOptions)(this.props)})}}}exports.JournaldLogDriver=JournaldLogDriver;

View File

@@ -0,0 +1,49 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { ContainerDefinition } from '../container-definition';
/**
* Specifies the json-file log driver configuration options.
*
* [Source](https://docs.docker.com/config/containers/logging/json-file/)
*/
export interface JsonFileLogDriverProps extends BaseLogDriverProps {
/**
* The maximum size of the log before it is rolled. A positive integer plus a modifier
* representing the unit of measure (k, m, or g).
*
* @default - -1 (unlimited)
*/
readonly maxSize?: string;
/**
* The maximum number of log files that can be present. If rolling the logs creates
* excess files, the oldest file is removed. Only effective when max-size is also set.
* A positive integer.
*
* @default - 1
*/
readonly maxFile?: number;
/**
* Toggles compression for rotated logs.
*
* @default - false
*/
readonly compress?: boolean;
}
/**
* A log driver that sends log information to json-file Logs.
*/
export declare class JsonFileLogDriver extends LogDriver {
private readonly props;
/**
* Constructs a new instance of the JsonFileLogDriver class.
*
* @param props the json-file log driver configuration options.
*/
constructor(props?: JsonFileLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonFileLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class JsonFileLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.JsonFileLogDriver",version:"2.252.0"};constructor(props={}){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_JsonFileLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,JsonFileLogDriver),error}if(props.maxFile&&props.maxFile<0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`MustBePositiveInteger`,"`maxFile` must be a positive integer.")}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"json-file",options:(0,utils_1().stringifyOptions)({"max-size":this.props.maxSize,"max-file":this.props.maxFile,compress:this.props.compress,labels:(0,utils_1().joinWithCommas)(this.props.labels),env:(0,utils_1().joinWithCommas)(this.props.env),"env-regex":this.props.envRegex})}}}exports.JsonFileLogDriver=JsonFileLogDriver;

View File

@@ -0,0 +1,50 @@
import type { Construct } from 'constructs';
import type { AwsLogDriverProps } from './aws-log-driver';
import type { ContainerDefinition } from '../container-definition';
import type { CfnTaskDefinition } from '../ecs.generated';
/**
* The base class for log drivers.
*/
export declare abstract class LogDriver {
/**
* Creates a log driver configuration that sends log information to CloudWatch Logs.
*/
static awsLogs(props: AwsLogDriverProps): LogDriver;
/**
* Called when the log driver is configured on a container
*/
abstract bind(scope: Construct, containerDefinition: ContainerDefinition): LogDriverConfig;
}
/**
* The configuration to use when creating a log driver.
*/
export interface LogDriverConfig {
/**
* The log driver to use for the container. The valid values listed for this parameter are log drivers
* that the Amazon ECS container agent can communicate with by default.
*
* For tasks using the Fargate launch type, the supported log drivers are awslogs, splunk, and awsfirelens.
* For tasks using the EC2 launch type, the supported log drivers are awslogs, fluentd, gelf, json-file, journald,
* logentries,syslog, splunk, and awsfirelens.
*
* For more information about using the awslogs log driver, see
* [Using the awslogs Log Driver](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html)
* in the Amazon Elastic Container Service Developer Guide.
*
* For more information about using the awsfirelens log driver, see
* [Custom Log Routing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html)
* in the Amazon Elastic Container Service Developer Guide.
*/
readonly logDriver: string;
/**
* The configuration options to send to the log driver.
*/
readonly options?: {
[key: string]: string;
};
/**
* The secrets to pass to the log configuration.
* @default - No secret options provided.
*/
readonly secretOptions?: CfnTaskDefinition.SecretProperty[];
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var aws_log_driver_1=()=>{var tmp=require("./aws-log-driver");return aws_log_driver_1=()=>tmp,tmp};class LogDriver{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.LogDriver",version:"2.252.0"};static awsLogs(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_AwsLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.awsLogs),error}return new(aws_log_driver_1()).AwsLogDriver(props)}}exports.LogDriver=LogDriver;

View File

@@ -0,0 +1,52 @@
import type { AwsLogDriverProps } from './aws-log-driver';
import type { FireLensLogDriverProps } from './firelens-log-driver';
import type { FluentdLogDriverProps } from './fluentd-log-driver';
import type { GelfLogDriverProps } from './gelf-log-driver';
import type { JournaldLogDriverProps } from './journald-log-driver';
import type { JsonFileLogDriverProps } from './json-file-log-driver';
import type { LogDriver } from './log-driver';
import type { SplunkLogDriverProps } from './splunk-log-driver';
import type { SyslogLogDriverProps } from './syslog-log-driver';
/**
* The base class for log drivers.
*/
export declare class LogDrivers {
/**
* Creates a log driver configuration that sends log information to CloudWatch Logs.
*/
static awsLogs(props: AwsLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that sends log information to fluentd Logs.
*/
static fluentd(props?: FluentdLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that sends log information to gelf Logs.
*/
static gelf(props: GelfLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that sends log information to journald Logs.
*/
static journald(props?: JournaldLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that sends log information to json-file Logs.
*/
static jsonFile(props?: JsonFileLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that sends log information to splunk Logs.
*/
static splunk(props: SplunkLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that sends log information to syslog Logs.
*/
static syslog(props?: SyslogLogDriverProps): LogDriver;
/**
* Creates a log driver configuration that disables logging (Docker `none` driver).
*/
static none(): LogDriver;
/**
* Creates a log driver configuration that sends log information to firelens log router.
* For detail configurations, please refer to Amazon ECS FireLens Examples:
* https://github.com/aws-samples/amazon-ecs-firelens-examples
*/
static firelens(props: FireLensLogDriverProps): LogDriver;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogDrivers=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var aws_log_driver_1=()=>{var tmp=require("./aws-log-driver");return aws_log_driver_1=()=>tmp,tmp},firelens_log_driver_1=()=>{var tmp=require("./firelens-log-driver");return firelens_log_driver_1=()=>tmp,tmp},fluentd_log_driver_1=()=>{var tmp=require("./fluentd-log-driver");return fluentd_log_driver_1=()=>tmp,tmp},gelf_log_driver_1=()=>{var tmp=require("./gelf-log-driver");return gelf_log_driver_1=()=>tmp,tmp},journald_log_driver_1=()=>{var tmp=require("./journald-log-driver");return journald_log_driver_1=()=>tmp,tmp},json_file_log_driver_1=()=>{var tmp=require("./json-file-log-driver");return json_file_log_driver_1=()=>tmp,tmp},none_log_driver_1=()=>{var tmp=require("./none-log-driver");return none_log_driver_1=()=>tmp,tmp},splunk_log_driver_1=()=>{var tmp=require("./splunk-log-driver");return splunk_log_driver_1=()=>tmp,tmp},syslog_log_driver_1=()=>{var tmp=require("./syslog-log-driver");return syslog_log_driver_1=()=>tmp,tmp};class LogDrivers{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.LogDrivers",version:"2.252.0"};static awsLogs(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_AwsLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.awsLogs),error}return new(aws_log_driver_1()).AwsLogDriver(props)}static fluentd(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_FluentdLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fluentd),error}return new(fluentd_log_driver_1()).FluentdLogDriver(props)}static gelf(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_GelfLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.gelf),error}return new(gelf_log_driver_1()).GelfLogDriver(props)}static journald(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_JournaldLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.journald),error}return new(journald_log_driver_1()).JournaldLogDriver(props)}static jsonFile(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_JsonFileLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonFile),error}return new(json_file_log_driver_1()).JsonFileLogDriver(props)}static splunk(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_SplunkLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.splunk),error}return new(splunk_log_driver_1()).SplunkLogDriver(props)}static syslog(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_SyslogLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.syslog),error}return new(syslog_log_driver_1()).SyslogLogDriver(props)}static none(){return new(none_log_driver_1()).NoneLogDriver}static firelens(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_FireLensLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.firelens),error}return new(firelens_log_driver_1()).FireLensLogDriver(props)}}exports.LogDrivers=LogDrivers;

View File

@@ -0,0 +1,17 @@
import type { Construct } from 'constructs';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { ContainerDefinition } from '../container-definition';
/**
* A log driver that sets the log driver to `none` (no logs collected).
*/
export declare class NoneLogDriver extends LogDriver {
/**
* Constructs a new instance of the NoneLogDriver class.
*/
constructor();
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NoneLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp};class NoneLogDriver extends log_driver_1().LogDriver{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.NoneLogDriver",version:"2.252.0"};constructor(){super()}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"none"}}}exports.NoneLogDriver=NoneLogDriver;

View File

@@ -0,0 +1,113 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { SecretValue } from '../../../core';
import type { ContainerDefinition, Secret } from '../container-definition';
/**
* Log Message Format
*/
export declare enum SplunkLogFormat {
INLINE = "inline",
JSON = "json",
RAW = "raw"
}
/**
* Specifies the splunk log driver configuration options.
*
* [Source](https://docs.docker.com/config/containers/logging/splunk/)
*/
export interface SplunkLogDriverProps extends BaseLogDriverProps {
/**
* Splunk HTTP Event Collector token (Secret).
*
* The splunk-token is added to the SecretOptions property of the Log Driver Configuration. So the secret value will not be
* resolved or viewable as plain text.
*/
readonly secretToken: Secret;
/**
* Path to your Splunk Enterprise, self-service Splunk Cloud instance, or Splunk
* Cloud managed cluster (including port and scheme used by HTTP Event Collector)
* in one of the following formats: https://your_splunk_instance:8088 or
* https://input-prd-p-XXXXXXX.cloud.splunk.com:8088 or https://http-inputs-XXXXXXXX.splunkcloud.com.
*/
readonly url: string;
/**
* Event source.
*
* @default - source not set.
*/
readonly source?: string;
/**
* Event source type.
*
* @default - sourceType not set.
*/
readonly sourceType?: string;
/**
* Event index.
*
* @default - index not set.
*/
readonly index?: string;
/**
* Path to root certificate.
*
* @default - caPath not set.
*/
readonly caPath?: string;
/**
* Name to use for validating server certificate.
*
* @default - The hostname of the splunk-url
*/
readonly caName?: string;
/**
* Ignore server certificate validation.
*
* @default - insecureSkipVerify not set.
*/
readonly insecureSkipVerify?: string;
/**
* Message format. Can be inline, json or raw.
*
* @default - inline
*/
readonly format?: SplunkLogFormat;
/**
* Verify on start, that docker can connect to Splunk server.
*
* @default - true
*/
readonly verifyConnection?: boolean;
/**
* Enable/disable gzip compression to send events to Splunk Enterprise or Splunk
* Cloud instance.
*
* @default - false
*/
readonly gzip?: boolean;
/**
* Set compression level for gzip. Valid values are -1 (default), 0 (no compression),
* 1 (best speed) ... 9 (best compression).
*
* @default - -1 (Default Compression)
*/
readonly gzipLevel?: number;
}
/**
* A log driver that sends log information to splunk Logs.
*/
export declare class SplunkLogDriver extends LogDriver {
private readonly props;
/**
* Constructs a new instance of the SplunkLogDriver class.
*
* @param props the splunk log driver configuration options.
*/
constructor(props: SplunkLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SplunkLogDriver=exports.SplunkLogFormat=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},SplunkLogFormat;(function(SplunkLogFormat2){SplunkLogFormat2.INLINE="inline",SplunkLogFormat2.JSON="json",SplunkLogFormat2.RAW="raw"})(SplunkLogFormat||(exports.SplunkLogFormat=SplunkLogFormat={}));class SplunkLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.SplunkLogDriver",version:"2.252.0"};constructor(props){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_SplunkLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SplunkLogDriver),error}if(!props.token&&!props.secretToken)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ProvideTokenSecretToken`,"Please provide either token or secretToken.");props.gzipLevel&&(0,utils_1().ensureInRange)(props.gzipLevel,-1,9)}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"splunk",options:(0,utils_1().stringifyOptions)({"splunk-token":this.props.token?.unsafeUnwrap(),"splunk-url":this.props.url,"splunk-source":this.props.source,"splunk-sourcetype":this.props.sourceType,"splunk-index":this.props.index,"splunk-capath":this.props.caPath,"splunk-caname":this.props.caName,"splunk-insecureskipverify":this.props.insecureSkipVerify,"splunk-format":this.props.format,"splunk-verify-connection":this.props.verifyConnection,"splunk-gzip":this.props.gzip,"splunk-gzip-level":this.props.gzipLevel,...(0,utils_1().renderCommonLogDriverOptions)(this.props)}),secretOptions:this.props.secretToken&&(0,utils_1().renderLogDriverSecretOptions)({"splunk-token":this.props.secretToken},_containerDefinition.taskDefinition)}}}exports.SplunkLogDriver=SplunkLogDriver;

View File

@@ -0,0 +1,80 @@
import type { Construct } from 'constructs';
import type { BaseLogDriverProps } from './base-log-driver';
import type { LogDriverConfig } from './log-driver';
import { LogDriver } from './log-driver';
import type { ContainerDefinition } from '../container-definition';
/**
* Specifies the syslog log driver configuration options.
*
* [Source](https://docs.docker.com/config/containers/logging/syslog/)
*/
export interface SyslogLogDriverProps extends BaseLogDriverProps {
/**
* The address of an external syslog server. The URI specifier may be
* [tcp|udp|tcp+tls]://host:port, unix://path, or unixgram://path.
*
* @default - If the transport is tcp, udp, or tcp+tls, the default port is 514.
*/
readonly address?: string;
/**
* The syslog facility to use. Can be the number or name for any valid
* syslog facility. See the syslog documentation:
* https://tools.ietf.org/html/rfc5424#section-6.2.1.
*
* @default - facility not set
*/
readonly facility?: string;
/**
* The absolute path to the trust certificates signed by the CA. Ignored
* if the address protocol is not tcp+tls.
*
* @default - tlsCaCert not set
*/
readonly tlsCaCert?: string;
/**
* The absolute path to the TLS certificate file. Ignored if the address
* protocol is not tcp+tls.
*
* @default - tlsCert not set
*/
readonly tlsCert?: string;
/**
* The absolute path to the TLS key file. Ignored if the address protocol
* is not tcp+tls.
*
* @default - tlsKey not set
*/
readonly tlsKey?: string;
/**
* If set to true, TLS verification is skipped when connecting to the syslog
* daemon. Ignored if the address protocol is not tcp+tls.
*
* @default - false
*/
readonly tlsSkipVerify?: boolean;
/**
* The syslog message format to use. If not specified the local UNIX syslog
* format is used, without a specified hostname. Specify rfc3164 for the RFC-3164
* compatible format, rfc5424 for RFC-5424 compatible format, or rfc5424micro
* for RFC-5424 compatible format with microsecond timestamp resolution.
*
* @default - format not set
*/
readonly format?: string;
}
/**
* A log driver that sends log information to syslog Logs.
*/
export declare class SyslogLogDriver extends LogDriver {
private readonly props;
/**
* Constructs a new instance of the SyslogLogDriver class.
*
* @param props the syslog log driver configuration options.
*/
constructor(props?: SyslogLogDriverProps);
/**
* Called when the log driver is configured on a container
*/
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfig;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SyslogLogDriver=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var log_driver_1=()=>{var tmp=require("./log-driver");return log_driver_1=()=>tmp,tmp},utils_1=()=>{var tmp=require("./utils");return utils_1=()=>tmp,tmp};class SyslogLogDriver extends log_driver_1().LogDriver{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_ecs.SyslogLogDriver",version:"2.252.0"};constructor(props={}){super(),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_SyslogLogDriverProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,SyslogLogDriver),error}}bind(_scope,_containerDefinition){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_ecs_ContainerDefinition(_containerDefinition)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bind),error}return{logDriver:"syslog",options:(0,utils_1().stringifyOptions)({"syslog-address":this.props.address,"syslog-facility":this.props.facility,"syslog-tls-ca-cert":this.props.tlsCaCert,"syslog-tls-cert":this.props.tlsCert,"syslog-tls-key":this.props.tlsKey,"syslog-tls-skip-verify":this.props.tlsSkipVerify,"syslog-format":this.props.format,...(0,utils_1().renderCommonLogDriverOptions)(this.props)})}}}exports.SyslogLogDriver=SyslogLogDriver;

View File

@@ -0,0 +1,37 @@
import type { BaseLogDriverProps } from './base-log-driver';
import type { Duration } from '../../../core';
import { SecretValue } from '../../../core';
import type { TaskDefinition } from '../base/task-definition';
import type { Secret } from '../container-definition';
import type { CfnTaskDefinition } from '../ecs.generated';
/**
* Remove undefined values from a dictionary
*/
export declare function removeEmpty<T>(x: {
[key: string]: (T | undefined | string);
}): {
[key: string]: string;
};
/**
* Checks that a value is a positive integer
*/
export declare function ensurePositiveInteger(val: number): void;
/**
* Checks that a value is contained in a range of two other values
*/
export declare function ensureInRange(val: number, start: number, end: number): void;
export declare function stringifyOptions(options: {
[key: string]: (SecretValue | Duration | string | string[] | number | boolean | undefined);
}): {
[key: string]: string;
};
export declare function renderCommonLogDriverOptions(opts: BaseLogDriverProps): {
tag: string | undefined;
labels: string | undefined;
env: string | undefined;
'env-regex': string | undefined;
};
export declare function joinWithCommas(xs?: string[]): string | undefined;
export declare function renderLogDriverSecretOptions(secretValue: {
[key: string]: Secret;
}, taskDefinition: TaskDefinition): CfnTaskDefinition.SecretProperty[];

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.removeEmpty=removeEmpty,exports.ensurePositiveInteger=ensurePositiveInteger,exports.ensureInRange=ensureInRange,exports.stringifyOptions=stringifyOptions,exports.renderCommonLogDriverOptions=renderCommonLogDriverOptions,exports.joinWithCommas=joinWithCommas,exports.renderLogDriverSecretOptions=renderLogDriverSecretOptions;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};function removeEmpty(x){for(const key of Object.keys(x))x[key]===void 0&&delete x[key];return x}function ensurePositiveInteger(val){if(!core_1().Token.isUnresolved(val)&&Number.isInteger(val)&&val<0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ValueMustBePositiveInteger`,`\`${val}\` must be a positive integer.`)}function ensureInRange(val,start,end){if(!core_1().Token.isUnresolved(val)&&!(val>=start&&val<=end))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ValueMustBeWithinRange`,`\`${val}\` must be within range ${start}:${end}`)}function stringifyOptions(options){const _options={},filteredOptions=removeEmpty(options);for(const[key,value]of Object.entries(filteredOptions))_options[key]=core_1().SecretValue.isSecretValue(value)?value.unsafeUnwrap():`${value}`;return _options}function renderCommonLogDriverOptions(opts){return{tag:opts.tag,labels:joinWithCommas(opts.labels),env:joinWithCommas(opts.env),"env-regex":opts.envRegex}}function joinWithCommas(xs){return xs&&xs.join(",")}function renderLogDriverSecretOptions(secretValue,taskDefinition){const secrets=[];for(const[name,secret]of Object.entries(secretValue))secret.grantRead(taskDefinition.obtainExecutionRole()),secrets.push({name,valueFrom:secret.arn});return secrets}