Struct aws_sdk_gamelift::types::ContainerDefinitionInput
source · #[non_exhaustive]pub struct ContainerDefinitionInput {
pub container_name: Option<String>,
pub image_uri: Option<String>,
pub memory_limits: Option<ContainerMemoryLimits>,
pub port_configuration: Option<ContainerPortConfiguration>,
pub cpu: Option<i32>,
pub health_check: Option<ContainerHealthCheck>,
pub command: Option<Vec<String>>,
pub essential: Option<bool>,
pub entry_point: Option<Vec<String>>,
pub working_directory: Option<String>,
pub environment: Option<Vec<ContainerEnvironment>>,
pub depends_on: Option<Vec<ContainerDependency>>,
}
Expand description
This data type is used with the Amazon GameLift containers feature, which is currently in public preview.
Describes a container's configuration, resources, and start instructions. Use this data type to create a container group definition. For the properties of a container that's been deployed to a fleet, see ContainerDefinition
. You can't change these properties after you've created the container group definition. If you need a container group with different properties, then you must create a new one.
Used with: CreateContainerGroupDefinition
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.container_name: Option<String>
A string that uniquely identifies the container definition within a container group.
image_uri: Option<String>
The location of a container image that $short; will copy and deploy to a container fleet. Images in Amazon Elastic Container Registry private repositories are supported. The repository must be in the same Amazon Web Services account and Amazon Web Services Region where you're creating the container group definition. For limits on image size, see Amazon GameLift endpoints and quotas. You can use any of the following image URI formats:
-
Image ID only:
[AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]
-
Image ID and digest:
[AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]@[digest]
-
Image ID and tag:
[AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]:[tag]
memory_limits: Option<ContainerMemoryLimits>
The amount of memory to make available to the container. If you don't specify memory limits for this container, then it shares the container group's total memory allocation.
Related data type: ContainerGroupDefinition$TotalMemoryLimit
port_configuration: Option<ContainerPortConfiguration>
A set of ports that Amazon GameLift can assign to processes in the container. All processes that accept inbound traffic connections, including game server processes, must be assigned a port from this set. The set of ports must be large enough to assign one to each process in the container that needs one. If the container includes your game server, include enough ports to assign one port to each concurrent server process (as defined in a container fleet's RuntimeConfiguration
). For more details, see Networking for container fleets.
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
.
cpu: Option<i32>
The number of CPU units to reserve for this container. The container can use more resources when needed, if available. Note: 1 vCPU unit equals 1024 CPU units. If you don't reserve CPU units for this container, then it shares the total CPU limit for the container group. This property is similar to the Amazon ECS container definition parameter environment (Amazon Elastic Container Service Developer Guide).
Related data type: ContainerGroupDefinition$TotalCpuLimit
health_check: Option<ContainerHealthCheck>
Configuration for a non-terminal health check. A container automatically restarts if it stops functioning. This parameter lets you define additional reasons to consider a container unhealthy and restart it. You can set a health check for any container except for the essential container in the replica container group. If an essential container in the daemon group fails a health check, the entire container group is restarted.
command: Option<Vec<String>>
A command to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition command parameter in the Amazon Elastic Container Service API reference.
essential: Option<bool>
Specifies whether the container is vital for the container group to function properly. If an essential container fails, it causes the entire container group to restart. Each container group must have an essential container.
Replica container groups - A replica group must have exactly one essential container. Use the following to configure an essential replica container:
-
Choose a container is running your game server and the Amazon GameLift Agent.
-
Include a port configuration. This container runs your game server processes, and each process requires a container port to allow access to game clients.
-
Don't configure a health check. The Agent handles this task for the essential replica container.
Daemon container groups - A daemon group must have at least one essential container.
entry_point: Option<Vec<String>>
An entry point to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference.
working_directory: Option<String>
The directory in the container where commands are run. See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference.
environment: Option<Vec<ContainerEnvironment>>
A set of environment variables to pass to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference.
depends_on: Option<Vec<ContainerDependency>>
Sets up dependencies between this container and the status of other containers in the same container group. A container can have dependencies on multiple different containers.
You can use dependencies to establish a startup/shutdown sequence across the container group. A container startup dependency is reversed on shutdown.
For example, you might specify that SideCarContainerB has a START
dependency on SideCarContainerA. This dependency means that SideCarContainerB can't start until after SideCarContainerA has started. This dependency is reversed on shutdown, which means that SideCarContainerB must shut down before SideCarContainerA can shut down.
Implementations§
source§impl ContainerDefinitionInput
impl ContainerDefinitionInput
sourcepub fn container_name(&self) -> Option<&str>
pub fn container_name(&self) -> Option<&str>
A string that uniquely identifies the container definition within a container group.
sourcepub fn image_uri(&self) -> Option<&str>
pub fn image_uri(&self) -> Option<&str>
The location of a container image that $short; will copy and deploy to a container fleet. Images in Amazon Elastic Container Registry private repositories are supported. The repository must be in the same Amazon Web Services account and Amazon Web Services Region where you're creating the container group definition. For limits on image size, see Amazon GameLift endpoints and quotas. You can use any of the following image URI formats:
-
Image ID only:
[AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]
-
Image ID and digest:
[AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]@[digest]
-
Image ID and tag:
[AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]:[tag]
sourcepub fn memory_limits(&self) -> Option<&ContainerMemoryLimits>
pub fn memory_limits(&self) -> Option<&ContainerMemoryLimits>
The amount of memory to make available to the container. If you don't specify memory limits for this container, then it shares the container group's total memory allocation.
Related data type: ContainerGroupDefinition$TotalMemoryLimit
sourcepub fn port_configuration(&self) -> Option<&ContainerPortConfiguration>
pub fn port_configuration(&self) -> Option<&ContainerPortConfiguration>
A set of ports that Amazon GameLift can assign to processes in the container. All processes that accept inbound traffic connections, including game server processes, must be assigned a port from this set. The set of ports must be large enough to assign one to each process in the container that needs one. If the container includes your game server, include enough ports to assign one port to each concurrent server process (as defined in a container fleet's RuntimeConfiguration
). For more details, see Networking for container fleets.
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
.
sourcepub fn cpu(&self) -> Option<i32>
pub fn cpu(&self) -> Option<i32>
The number of CPU units to reserve for this container. The container can use more resources when needed, if available. Note: 1 vCPU unit equals 1024 CPU units. If you don't reserve CPU units for this container, then it shares the total CPU limit for the container group. This property is similar to the Amazon ECS container definition parameter environment (Amazon Elastic Container Service Developer Guide).
Related data type: ContainerGroupDefinition$TotalCpuLimit
sourcepub fn health_check(&self) -> Option<&ContainerHealthCheck>
pub fn health_check(&self) -> Option<&ContainerHealthCheck>
Configuration for a non-terminal health check. A container automatically restarts if it stops functioning. This parameter lets you define additional reasons to consider a container unhealthy and restart it. You can set a health check for any container except for the essential container in the replica container group. If an essential container in the daemon group fails a health check, the entire container group is restarted.
sourcepub fn command(&self) -> &[String]
pub fn command(&self) -> &[String]
A command to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition command parameter in the Amazon Elastic Container Service API reference.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .command.is_none()
.
sourcepub fn essential(&self) -> Option<bool>
pub fn essential(&self) -> Option<bool>
Specifies whether the container is vital for the container group to function properly. If an essential container fails, it causes the entire container group to restart. Each container group must have an essential container.
Replica container groups - A replica group must have exactly one essential container. Use the following to configure an essential replica container:
-
Choose a container is running your game server and the Amazon GameLift Agent.
-
Include a port configuration. This container runs your game server processes, and each process requires a container port to allow access to game clients.
-
Don't configure a health check. The Agent handles this task for the essential replica container.
Daemon container groups - A daemon group must have at least one essential container.
sourcepub fn entry_point(&self) -> &[String]
pub fn entry_point(&self) -> &[String]
An entry point to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .entry_point.is_none()
.
sourcepub fn working_directory(&self) -> Option<&str>
pub fn working_directory(&self) -> Option<&str>
The directory in the container where commands are run. See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference.
sourcepub fn environment(&self) -> &[ContainerEnvironment]
pub fn environment(&self) -> &[ContainerEnvironment]
A set of environment variables to pass to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .environment.is_none()
.
sourcepub fn depends_on(&self) -> &[ContainerDependency]
pub fn depends_on(&self) -> &[ContainerDependency]
Sets up dependencies between this container and the status of other containers in the same container group. A container can have dependencies on multiple different containers.
You can use dependencies to establish a startup/shutdown sequence across the container group. A container startup dependency is reversed on shutdown.
For example, you might specify that SideCarContainerB has a START
dependency on SideCarContainerA. This dependency means that SideCarContainerB can't start until after SideCarContainerA has started. This dependency is reversed on shutdown, which means that SideCarContainerB must shut down before SideCarContainerA can shut down.
If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use .depends_on.is_none()
.
source§impl ContainerDefinitionInput
impl ContainerDefinitionInput
sourcepub fn builder() -> ContainerDefinitionInputBuilder
pub fn builder() -> ContainerDefinitionInputBuilder
Creates a new builder-style object to manufacture ContainerDefinitionInput
.
Trait Implementations§
source§impl Clone for ContainerDefinitionInput
impl Clone for ContainerDefinitionInput
source§fn clone(&self) -> ContainerDefinitionInput
fn clone(&self) -> ContainerDefinitionInput
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ContainerDefinitionInput
impl Debug for ContainerDefinitionInput
source§impl PartialEq for ContainerDefinitionInput
impl PartialEq for ContainerDefinitionInput
source§fn eq(&self, other: &ContainerDefinitionInput) -> bool
fn eq(&self, other: &ContainerDefinitionInput) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ContainerDefinitionInput
Auto Trait Implementations§
impl Freeze for ContainerDefinitionInput
impl RefUnwindSafe for ContainerDefinitionInput
impl Send for ContainerDefinitionInput
impl Sync for ContainerDefinitionInput
impl Unpin for ContainerDefinitionInput
impl UnwindSafe for ContainerDefinitionInput
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more