Skip to content
v2.274.0

FireLensLogDriver Class ​

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.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';

declare const secret: ecs.Secret;
const fireLensLogDriver = new ecs.FireLensLogDriver({
  env: ['env'],
  envRegex: 'envRegex',
  labels: ['labels'],
  options: {
    optionsKey: 'options',
  },
  secretOptions: {
    secretOptionsKey: secret,
  },
  tag: 'tag',
});
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs

# secret: ecs.Secret

fire_lens_log_driver = ecs.FireLensLogDriver(
    env=["env"],
    env_regex="envRegex",
    labels=["labels"],
    options={
        "options_key": "options"
    },
    secret_options={
        "secret_options_key": secret
    },
    tag="tag"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;

Secret secret;

FireLensLogDriver fireLensLogDriver = FireLensLogDriver.Builder.create()
        .env(List.of("env"))
        .envRegex("envRegex")
        .labels(List.of("labels"))
        .options(Map.of(
                "optionsKey", "options"))
        .secretOptions(Map.of(
                "secretOptionsKey", secret))
        .tag("tag")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;

Secret secret;

var fireLensLogDriver = new FireLensLogDriver(new FireLensLogDriverProps {
    Env = new [] { "env" },
    EnvRegex = "envRegex",
    Labels = new [] { "labels" },
    Options = new Dictionary<string, string> {
        { "optionsKey", "options" }
    },
    SecretOptions = new Dictionary<string, Secret> {
        { "secretOptionsKey", secret }
    },
    Tag = "tag"
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

var secret Secret

fireLensLogDriver := awscdk.Aws_ecs.NewFireLensLogDriver(&FireLensLogDriverProps{
	Env: []*string{
		jsii.String("env"),
	},
	EnvRegex: jsii.String("envRegex"),
	Labels: []*string{
		jsii.String("labels"),
	},
	Options: map[string]*string{
		"optionsKey": jsii.String("options"),
	},
	SecretOptions: map[string]Secret{
		"secretOptionsKey": secret,
	},
	Tag: jsii.String("tag"),
})

Initializer ​

ts
new FireLensLogDriver(props: FireLensLogDriverProps)
python
FireLensLogDriver(props: FireLensLogDriverProps)
java
new FireLensLogDriver(FireLensLogDriverProps props)
csharp
new FireLensLogDriver(FireLensLogDriverProps props)
go
NewFireLensLogDriver(Props FireLensLogDriverProps)

Methods ​

awsLogs(props: AwsLogDriverProps): LogDriver@staticmethod def aws_logs(props: AwsLogDriverProps) -> LogDriverpublic static LogDriver awsLogs(AwsLogDriverProps props)public static LogDriver AwsLogs(AwsLogDriverProps props)func AwsLogs(Props AwsLogDriverProps) LogDriverstatic#
Creates a log driver configuration that sends log information to CloudWatch Logs.
bind(_scope: Construct, _containerDefinition: ContainerDefinition): LogDriverConfigdef bind(self, _scope: Construct, _container_definition: ContainerDefinition) -> LogDriverConfigpublic LogDriverConfig bind(Construct _scope, ContainerDefinition _containerDefinition)public LogDriverConfig Bind(Construct _scope, ContainerDefinition _containerDefinition)func Bind(_scope Construct, _containerDefinition ContainerDefinition) LogDriverConfig#
Called when the log driver is configured on a container.