Class FirelensLogRouterDefinitionOptions
The options for creating a firelens log router.
Inheritance
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public class FirelensLogRouterDefinitionOptions : Object, IFirelensLogRouterDefinitionOptions, IContainerDefinitionOptions
Syntax (vb)
Public Class FirelensLogRouterDefinitionOptions
Inherits Object
Implements IFirelensLogRouterDefinitionOptions, IContainerDefinitionOptions
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
using Amazon.CDK;
ContainerImage containerImage;
EnvironmentFile environmentFile;
LinuxParameters linuxParameters;
LogDriver logDriver;
Secret secret;
var firelensLogRouterDefinitionOptions = new FirelensLogRouterDefinitionOptions {
FirelensConfig = new FirelensConfig {
Type = FirelensLogRouterType.FLUENTBIT,
// the properties below are optional
Options = new FirelensOptions {
ConfigFileType = FirelensConfigFileType.S3,
ConfigFileValue = "configFileValue",
EnableECSLogMetadata = false
}
},
Image = containerImage,
// the properties below are optional
Command = new [] { "command" },
ContainerName = "containerName",
Cpu = 123,
DisableNetworking = false,
DnsSearchDomains = new [] { "dnsSearchDomains" },
DnsServers = new [] { "dnsServers" },
DockerLabels = new Dictionary<string, string> {
{ "dockerLabelsKey", "dockerLabels" }
},
DockerSecurityOptions = new [] { "dockerSecurityOptions" },
EntryPoint = new [] { "entryPoint" },
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
EnvironmentFiles = new [] { environmentFile },
Essential = false,
ExtraHosts = new Dictionary<string, string> {
{ "extraHostsKey", "extraHosts" }
},
GpuCount = 123,
HealthCheck = new HealthCheck {
Command = new [] { "command" },
// the properties below are optional
Interval = Duration.Minutes(30),
Retries = 123,
StartPeriod = Duration.Minutes(30),
Timeout = Duration.Minutes(30)
},
Hostname = "hostname",
InferenceAcceleratorResources = new [] { "inferenceAcceleratorResources" },
LinuxParameters = linuxParameters,
Logging = logDriver,
MemoryLimitMiB = 123,
MemoryReservationMiB = 123,
PortMappings = new [] { new PortMapping {
ContainerPort = 123,
// the properties below are optional
HostPort = 123,
Protocol = Protocol.TCP
} },
Privileged = false,
ReadonlyRootFilesystem = false,
Secrets = new Dictionary<string, Secret> {
{ "secretsKey", secret }
},
StartTimeout = Duration.Minutes(30),
StopTimeout = Duration.Minutes(30),
SystemControls = new [] { new SystemControl {
Namespace = "namespace",
Value = "value"
} },
User = "user",
WorkingDirectory = "workingDirectory"
};
Synopsis
Constructors
FirelensLogRouterDefinitionOptions() |
Properties
Command | The command that is passed to the container. |
ContainerName | The name of the container. |
Cpu | The minimum number of CPU units to reserve for the container. |
DisableNetworking | Specifies whether networking is disabled within the container. |
DnsSearchDomains | A list of DNS search domains that are presented to the container. |
DnsServers | A list of DNS servers that are presented to the container. |
DockerLabels | A key/value map of labels to add to the container. |
DockerSecurityOptions | A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. |
EntryPoint | The ENTRYPOINT value to pass to the container. |
Environment | The environment variables to pass to the container. |
EnvironmentFiles | The environment files to pass to the container. |
Essential | Specifies whether the container is marked essential. |
ExtraHosts | A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. |
FirelensConfig | Firelens configuration. |
GpuCount | The number of GPUs assigned to the container. |
HealthCheck | The health check command and associated configuration parameters for the container. |
Hostname | The hostname to use for your container. |
Image | The image used to start a container. |
InferenceAcceleratorResources | The inference accelerators referenced by the container. |
LinuxParameters | Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. |
Logging | The log configuration specification for the container. |
MemoryLimitMiB | The amount (in MiB) of memory to present to the container. |
MemoryReservationMiB | The soft limit (in MiB) of memory to reserve for the container. |
PortMappings | The port mappings to add to the container definition. |
Privileged | Specifies whether the container is marked as privileged. |
ReadonlyRootFilesystem | When this parameter is true, the container is given read-only access to its root file system. |
Secrets | The secret environment variables to pass to the container. |
StartTimeout | Time duration (in seconds) to wait before giving up on resolving dependencies for a container. |
StopTimeout | Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. |
SystemControls | A list of namespaced kernel parameters to set in the container. |
User | The user name to use inside the container. |
WorkingDirectory | The working directory in which to run commands inside the container. |
Constructors
FirelensLogRouterDefinitionOptions()
public FirelensLogRouterDefinitionOptions()
Properties
Command
The command that is passed to the container.
public string[] Command { get; set; }
Property Value
System.String[]
Remarks
If you provide a shell command as a single string, you have to quote command-line arguments.
Default: - CMD value built into container image.
ContainerName
The name of the container.
public string ContainerName { get; set; }
Property Value
System.String
Remarks
Default: - id of node associated with ContainerDefinition.
Cpu
The minimum number of CPU units to reserve for the container.
public Nullable<double> Cpu { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - No minimum CPU units reserved.
DisableNetworking
Specifies whether networking is disabled within the container.
public Nullable<bool> DisableNetworking { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
When this parameter is true, networking is disabled within the container.
Default: false
DnsSearchDomains
A list of DNS search domains that are presented to the container.
public string[] DnsSearchDomains { get; set; }
Property Value
System.String[]
Remarks
Default: - No search domains.
DnsServers
A list of DNS servers that are presented to the container.
public string[] DnsServers { get; set; }
Property Value
System.String[]
Remarks
Default: - Default DNS servers.
DockerLabels
A key/value map of labels to add to the container.
public IDictionary<string, string> DockerLabels { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No labels.
DockerSecurityOptions
A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.
public string[] DockerSecurityOptions { get; set; }
Property Value
System.String[]
Remarks
Default: - No security labels.
EntryPoint
The ENTRYPOINT value to pass to the container.
public string[] EntryPoint { get; set; }
Property Value
System.String[]
Remarks
Default: - Entry point configured in container.
See: https://docs.docker.com/engine/reference/builder/#entrypoint
Environment
The environment variables to pass to the container.
public IDictionary<string, string> Environment { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No environment variables.
EnvironmentFiles
The environment files to pass to the container.
public EnvironmentFile[] EnvironmentFiles { get; set; }
Property Value
Remarks
Default: - No environment files.
See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html
Essential
Specifies whether the container is marked essential.
public Nullable<bool> Essential { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. All tasks must have at least one essential container.
If this parameter is omitted, a container is assumed to be essential.
Default: true
ExtraHosts
A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.
public IDictionary<string, string> ExtraHosts { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Default: - No extra hosts.
FirelensConfig
Firelens configuration.
public IFirelensConfig FirelensConfig { get; set; }
Property Value
GpuCount
The number of GPUs assigned to the container.
public Nullable<double> GpuCount { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Default: - No GPUs assigned.
HealthCheck
The health check command and associated configuration parameters for the container.
public IHealthCheck HealthCheck { get; set; }
Property Value
Remarks
Default: - Health check configuration from container.
Hostname
The hostname to use for your container.
public string Hostname { get; set; }
Property Value
System.String
Remarks
Default: - Automatic hostname.
Image
The image used to start a container.
public ContainerImage Image { get; set; }
Property Value
Remarks
This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage
InferenceAcceleratorResources
The inference accelerators referenced by the container.
public string[] InferenceAcceleratorResources { get; set; }
Property Value
System.String[]
Remarks
Default: - No inference accelerators assigned.
LinuxParameters
Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.
public LinuxParameters LinuxParameters { get; set; }
Property Value
Remarks
For more information see KernelCapabilities.
Default: - No Linux parameters.
Logging
The log configuration specification for the container.
public LogDriver Logging { get; set; }
Property Value
Remarks
Default: - Containers use the same logging driver that the Docker daemon uses.
MemoryLimitMiB
The amount (in MiB) of memory to present to the container.
public Nullable<double> MemoryLimitMiB { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
If your container attempts to exceed the allocated memory, the container is terminated.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
Default: - No memory limit.
MemoryReservationMiB
The soft limit (in MiB) of memory to reserve for the container.
public Nullable<double> MemoryReservationMiB { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
Default: - No memory reserved.
PortMappings
The port mappings to add to the container definition.
public IPortMapping[] PortMappings { get; set; }
Property Value
Remarks
Default: - No ports are mapped.
Privileged
Specifies whether the container is marked as privileged.
public Nullable<bool> Privileged { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
Default: false
ReadonlyRootFilesystem
When this parameter is true, the container is given read-only access to its root file system.
public Nullable<bool> ReadonlyRootFilesystem { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Secrets
The secret environment variables to pass to the container.
public IDictionary<string, Secret> Secrets { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, Secret>
Remarks
Default: - No secret environment variables.
StartTimeout
Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
public Duration StartTimeout { get; set; }
Property Value
Remarks
Default: - none
StopTimeout
Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
public Duration StopTimeout { get; set; }
Property Value
Remarks
Default: - none
SystemControls
A list of namespaced kernel parameters to set in the container.
public ISystemControl[] SystemControls { get; set; }
Property Value
Remarks
Default: - No system controls are set.
User
The user name to use inside the container.
public string User { get; set; }
Property Value
System.String
Remarks
Default: root
WorkingDirectory
The working directory in which to run commands inside the container.
public string WorkingDirectory { get; set; }
Property Value
System.String
Remarks
Default: /