Interface CfnContainerGroupDefinition.IContainerDefinitionProperty
This data type is used with the Amazon GameLift containers feature, which is currently in public preview..
Namespace: Amazon.CDK.AWS.GameLift
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IContainerDefinitionProperty
Syntax (vb)
Public Interface IContainerDefinitionProperty
Remarks
Describes a container in a container fleet, the resources available to the container, and the commands that are run when the container starts. Container properties can't be updated. To change a property, create a new container group definition. See also ContainerDefinitionInput
.
Part of: ContainerGroupDefinition
Returned by: DescribeContainerGroupDefinition
, ListContainerGroupDefinitions
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.GameLift;
var containerDefinitionProperty = new ContainerDefinitionProperty {
ContainerName = "containerName",
ImageUri = "imageUri",
// the properties below are optional
Command = new [] { "command" },
Cpu = 123,
DependsOn = new [] { new ContainerDependencyProperty {
Condition = "condition",
ContainerName = "containerName"
} },
EntryPoint = new [] { "entryPoint" },
Environment = new [] { new ContainerEnvironmentProperty {
Name = "name",
Value = "value"
} },
Essential = false,
HealthCheck = new ContainerHealthCheckProperty {
Command = new [] { "command" },
// the properties below are optional
Interval = 123,
Retries = 123,
StartPeriod = 123,
Timeout = 123
},
MemoryLimits = new MemoryLimitsProperty {
HardLimit = 123,
SoftLimit = 123
},
PortConfiguration = new PortConfigurationProperty {
ContainerPortRanges = new [] { new ContainerPortRangeProperty {
FromPort = 123,
Protocol = "protocol",
ToPort = 123
} }
},
ResolvedImageDigest = "resolvedImageDigest",
WorkingDirectory = "workingDirectory"
};
Synopsis
Properties
Command | A command that's passed to the container on startup. |
ContainerName | The container definition identifier. |
Cpu | The number of CPU units that are reserved for the container. |
DependsOn | Indicates that the container relies on the status of other containers in the same container group during its startup and shutdown sequences. |
EntryPoint | The entry point that's passed to the container on startup. |
Environment | A set of environment variables that's passed to the container on startup. |
Essential | Indicates whether the container is vital to the container group. |
HealthCheck | A configuration for a non-terminal health check. |
ImageUri | The URI to the image that $short; |
MemoryLimits | The amount of memory that Amazon GameLift makes available to the container. |
PortConfiguration | Defines the ports that are available to assign to processes in the container. |
ResolvedImageDigest | A unique and immutable identifier for the container image that is deployed to a container fleet. |
WorkingDirectory | The directory in the container where commands are run. |
Properties
Command
A command that's passed to the container on startup.
virtual string[] Command { get; }
Property Value
System.String[]
Remarks
Each argument for the command is an additional string in the array. See the ContainerDefinition::command parameter in the Amazon Elastic Container Service API reference.
ContainerName
The container definition identifier.
string ContainerName { get; }
Property Value
System.String
Remarks
Container names are unique within a container group definition.
Cpu
The number of CPU units that are reserved for the container.
virtual Nullable<double> Cpu { get; }
Property Value
System.Nullable<System.Double>
Remarks
Note: 1 vCPU unit equals 1024 CPU units. If no resources are reserved, the container shares the total CPU limit for the container group.
Related data type: ContainerGroupDefinition$TotalCpuLimit
DependsOn
Indicates that the container relies on the status of other containers in the same container group during its startup and shutdown sequences.
virtual object DependsOn { get; }
Property Value
System.Object
Remarks
A container might have dependencies on multiple containers.
EntryPoint
The entry point that's passed to the container on startup.
virtual string[] EntryPoint { get; }
Property Value
System.String[]
Remarks
If there are multiple arguments, each argument is an additional string in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference .
Environment
A set of environment variables that's passed to the container on startup.
virtual object Environment { get; }
Property Value
System.Object
Remarks
See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference .
Essential
Indicates whether the container is vital to the container group.
virtual object Essential { get; }
Property Value
System.Object
Remarks
If an essential container fails, the entire container group is restarted.
HealthCheck
A configuration for a non-terminal health check.
virtual object HealthCheck { get; }
Property Value
System.Object
Remarks
A container, which automatically restarts if it stops functioning, also restarts if it fails this health check. If an essential container in the daemon group fails a health check, the entire container group is restarted. The essential container in the replica group doesn't use this health check mechanism, because the Amazon GameLift Agent automatically handles the task.
ImageUri
The URI to the image that $short;
string ImageUri { get; }
Property Value
System.String
Remarks
copied and deployed to a container fleet. For a more specific identifier, see ResolvedImageDigest
.
MemoryLimits
The amount of memory that Amazon GameLift makes available to the container.
virtual object MemoryLimits { get; }
Property Value
System.Object
Remarks
If memory limits aren't set for an individual container, the container shares the container group's total memory allocation.
Related data type: ContainerGroupDefinition$TotalMemoryLimit
PortConfiguration
Defines the ports that are available to assign to processes in the container.
virtual object PortConfiguration { get; }
Property Value
System.Object
Remarks
For example, a game server process requires a container port to allow game clients to connect to it. Container ports aren't directly accessed by inbound traffic. Amazon GameLift maps these container ports to externally accessible connection ports, which are assigned as needed from the container fleet's ConnectionPortRange
.
ResolvedImageDigest
A unique and immutable identifier for the container image that is deployed to a container fleet.
virtual string ResolvedImageDigest { get; }
Property Value
System.String
Remarks
The digest is a SHA 256 hash of the container image manifest.
WorkingDirectory
The directory in the container where commands are run.
virtual string WorkingDirectory { get; }
Property Value
System.String
Remarks
See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference .