Class: AWSCDK::Pipes::CfnPipe::ECSResourceRequirementProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
pipes/cfn_pipe.rb

Overview

The type and amount of a resource to assign to a container.

The supported resource types are GPUs and Elastic Inference accelerators. For more information, see Working with GPUs on Amazon ECS or Working with Amazon Elastic Inference on Amazon ECS in the Amazon Elastic Container Service Developer Guide

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:) ⇒ ECSResourceRequirementProperty

Returns a new instance of ECSResourceRequirementProperty.

Parameters:

  • type (String)

    The type of resource to assign to a container.

  • value (String)

    The value for the specified resource type.



1595
1596
1597
1598
1599
1600
# File 'pipes/cfn_pipe.rb', line 1595

def initialize(type:, value:)
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value")
end

Instance Attribute Details

#typeString (readonly)

The type of resource to assign to a container.

The supported values are GPU or InferenceAccelerator .



1608
1609
1610
# File 'pipes/cfn_pipe.rb', line 1608

def type
  @type
end

#valueString (readonly)

The value for the specified resource type.

If the GPU type is used, the value is the number of physical GPUs the Amazon ECS container agent reserves for the container. The number of GPUs that's reserved for all containers in a task can't exceed the number of available GPUs on the container instance that the task is launched on.

If the InferenceAccelerator type is used, the value matches the device_name for an InferenceAccelerator specified in a task definition.



1617
1618
1619
# File 'pipes/cfn_pipe.rb', line 1617

def value
  @value
end

Class Method Details

.jsii_propertiesObject



1619
1620
1621
1622
1623
1624
# File 'pipes/cfn_pipe.rb', line 1619

def self.jsii_properties
  {
    :type => "type",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



1626
1627
1628
1629
1630
1631
1632
1633
# File 'pipes/cfn_pipe.rb', line 1626

def to_jsii
  result = {}
  result.merge!({
    "type" => @type,
    "value" => @value,
  })
  result.compact
end