Interface IContainerDefinitionProps
The properties in a container definition.
Inherited Members
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public interface IContainerDefinitionProps : IContainerDefinitionOptions
Syntax (vb)
Public Interface IContainerDefinitionProps
Inherits 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;
TaskDefinition taskDefinition;
var containerDefinitionProps = new ContainerDefinitionProps {
Image = containerImage,
TaskDefinition = taskDefinition,
// 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
Properties
TaskDefinition | The name of the task definition that includes this container definition. |
Properties
TaskDefinition
The name of the task definition that includes this container definition.
TaskDefinition TaskDefinition { get; }
Property Value
Remarks
[disable-awslint:ref-via-interface]