Class: AWSCDK::GameLift::CfnContainerGroupDefinitionProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
game_lift/cfn_container_group_definition_props.rb

Overview

Properties for defining a CfnContainerGroupDefinition.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, operating_system:, total_memory_limit_mebibytes:, total_vcpu_limit:, container_group_type: nil, game_server_container_definition: nil, source_version_number: nil, support_container_definitions: nil, tags: nil, version_description: nil) ⇒ CfnContainerGroupDefinitionProps

Returns a new instance of CfnContainerGroupDefinitionProps.

Parameters:

  • name (String)

    A descriptive identifier for the container group definition.

  • operating_system (String)

    The platform that all containers in the container group definition run on.

  • total_memory_limit_mebibytes (Numeric)

    The amount of memory (in MiB) on a fleet instance to allocate for the container group.

  • total_vcpu_limit (Numeric)

    The amount of vCPU units on a fleet instance to allocate for the container group (1 vCPU is equal to 1024 CPU units).

  • container_group_type (String, nil) (defaults to: nil)

    The type of container group.

  • game_server_container_definition (AWSCDK::IResolvable, AWSCDK::GameLift::CfnContainerGroupDefinition::GameServerContainerDefinitionProperty, nil) (defaults to: nil)

    The definition for the game server container in this group.

  • source_version_number (Numeric, nil) (defaults to: nil)

    A specific ContainerGroupDefinition version to be updated.

  • support_container_definitions (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::GameLift::CfnContainerGroupDefinition::SupportContainerDefinitionProperty>, nil) (defaults to: nil)

    The set of definitions for support containers in this group.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    An array of key-value pairs to apply to this resource.

  • version_description (String, nil) (defaults to: nil)

    An optional description that was provided for a container group definition update.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'game_lift/cfn_container_group_definition_props.rb', line 19

def initialize(name:, operating_system:, total_memory_limit_mebibytes:, total_vcpu_limit:, container_group_type: nil, game_server_container_definition: nil, source_version_number: nil, support_container_definitions: nil, tags: nil, version_description: nil)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @operating_system = operating_system
  Jsii::Type.check_type(@operating_system, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operatingSystem")
  @total_memory_limit_mebibytes = total_memory_limit_mebibytes
  Jsii::Type.check_type(@total_memory_limit_mebibytes, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "totalMemoryLimitMebibytes")
  @total_vcpu_limit = total_vcpu_limit
  Jsii::Type.check_type(@total_vcpu_limit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "totalVcpuLimit")
  @container_group_type = container_group_type
  Jsii::Type.check_type(@container_group_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerGroupType") unless @container_group_type.nil?
  @game_server_container_definition = game_server_container_definition.is_a?(Hash) ? ::AWSCDK::GameLift::CfnContainerGroupDefinition::GameServerContainerDefinitionProperty.new(**game_server_container_definition.transform_keys(&:to_sym)) : game_server_container_definition
  Jsii::Type.check_type(@game_server_container_definition, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19nYW1lbGlmdC5DZm5Db250YWluZXJHcm91cERlZmluaXRpb24uR2FtZVNlcnZlckNvbnRhaW5lckRlZmluaXRpb25Qcm9wZXJ0eSJ9XX19")), "gameServerContainerDefinition") unless @game_server_container_definition.nil?
  @source_version_number = source_version_number
  Jsii::Type.check_type(@source_version_number, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "sourceVersionNumber") unless @source_version_number.nil?
  @support_container_definitions = support_container_definitions
  Jsii::Type.check_type(@support_container_definitions, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZ2FtZWxpZnQuQ2ZuQ29udGFpbmVyR3JvdXBEZWZpbml0aW9uLlN1cHBvcnRDb250YWluZXJEZWZpbml0aW9uUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "supportContainerDefinitions") unless @support_container_definitions.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @version_description = version_description
  Jsii::Type.check_type(@version_description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "versionDescription") unless @version_description.nil?
end

Instance Attribute Details

#container_group_typeString? (readonly)

The type of container group.

Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance.



78
79
80
# File 'game_lift/cfn_container_group_definition_props.rb', line 78

def container_group_type
  @container_group_type
end

#game_server_container_definitionAWSCDK::IResolvable, ... (readonly)

The definition for the game server container in this group.

This property is used only when the container group type is GAME_SERVER . This container definition specifies a container image with the game server build.



85
86
87
# File 'game_lift/cfn_container_group_definition_props.rb', line 85

def game_server_container_definition
  @game_server_container_definition
end

#nameString (readonly)

A descriptive identifier for the container group definition.

The name value is unique in an AWS Region.



48
49
50
# File 'game_lift/cfn_container_group_definition_props.rb', line 48

def name
  @name
end

#operating_systemString (readonly)

The platform that all containers in the container group definition run on.

Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the Amazon Linux 2 FAQs . For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See Migrate to server SDK version 5.



55
56
57
# File 'game_lift/cfn_container_group_definition_props.rb', line 55

def operating_system
  @operating_system
end

#source_version_numberNumeric? (readonly)

A specific ContainerGroupDefinition version to be updated.



90
91
92
# File 'game_lift/cfn_container_group_definition_props.rb', line 90

def source_version_number
  @source_version_number
end

#support_container_definitionsAWSCDK::IResolvable, ... (readonly)

The set of definitions for support containers in this group.

A container group definition might have zero support container definitions. Support container can be used in any type of container group.



97
98
99
# File 'game_lift/cfn_container_group_definition_props.rb', line 97

def support_container_definitions
  @support_container_definitions
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to this resource.



102
103
104
# File 'game_lift/cfn_container_group_definition_props.rb', line 102

def tags
  @tags
end

#total_memory_limit_mebibytesNumeric (readonly)

The amount of memory (in MiB) on a fleet instance to allocate for the container group.

All containers in the group share these resources.

You can set a limit for each container definition in the group. If individual containers have limits, this total value must be greater than any individual container's memory limit.



64
65
66
# File 'game_lift/cfn_container_group_definition_props.rb', line 64

def total_memory_limit_mebibytes
  @total_memory_limit_mebibytes
end

#total_vcpu_limitNumeric (readonly)

The amount of vCPU units on a fleet instance to allocate for the container group (1 vCPU is equal to 1024 CPU units).

All containers in the group share these resources. You can set a limit for each container definition in the group. If individual containers have limits, this total value must be equal to or greater than the sum of the limits for each container in the group.



71
72
73
# File 'game_lift/cfn_container_group_definition_props.rb', line 71

def total_vcpu_limit
  @total_vcpu_limit
end

#version_descriptionString? (readonly)

An optional description that was provided for a container group definition update.

Each version can have a unique description.



109
110
111
# File 'game_lift/cfn_container_group_definition_props.rb', line 109

def version_description
  @version_description
end

Class Method Details

.jsii_propertiesObject



111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'game_lift/cfn_container_group_definition_props.rb', line 111

def self.jsii_properties
  {
    :name => "name",
    :operating_system => "operatingSystem",
    :total_memory_limit_mebibytes => "totalMemoryLimitMebibytes",
    :total_vcpu_limit => "totalVcpuLimit",
    :container_group_type => "containerGroupType",
    :game_server_container_definition => "gameServerContainerDefinition",
    :source_version_number => "sourceVersionNumber",
    :support_container_definitions => "supportContainerDefinitions",
    :tags => "tags",
    :version_description => "versionDescription",
  }
end

Instance Method Details

#to_jsiiObject



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'game_lift/cfn_container_group_definition_props.rb', line 126

def to_jsii
  result = {}
  result.merge!({
    "name" => @name,
    "operatingSystem" => @operating_system,
    "totalMemoryLimitMebibytes" => @total_memory_limit_mebibytes,
    "totalVcpuLimit" => @total_vcpu_limit,
    "containerGroupType" => @container_group_type,
    "gameServerContainerDefinition" => @game_server_container_definition,
    "sourceVersionNumber" => @source_version_number,
    "supportContainerDefinitions" => @support_container_definitions,
    "tags" => @tags,
    "versionDescription" => @version_description,
  })
  result.compact
end