Class: AWSCDK::Lightsail::CfnContainer::ContainerProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lightsail/cfn_container.rb

Overview

Container is a property of the ContainerServiceDeployment property. It describes the settings of a container that will be launched, or that is launched, to an Amazon Lightsail container service.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command: nil, container_name: nil, environment: nil, image: nil, ports: nil) ⇒ ContainerProperty

Returns a new instance of ContainerProperty.

Parameters:



642
643
644
645
646
647
648
649
650
651
652
653
# File 'lightsail/cfn_container.rb', line 642

def initialize(command: nil, container_name: nil, environment: nil, image: nil, ports: nil)
  @command = command
  Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "command") unless @command.nil?
  @container_name = container_name
  Jsii::Type.check_type(@container_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "containerName") unless @container_name.nil?
  @environment = environment
  Jsii::Type.check_type(@environment, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGlnaHRzYWlsLkNmbkNvbnRhaW5lci5FbnZpcm9ubWVudFZhcmlhYmxlUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "environment") unless @environment.nil?
  @image = image
  Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "image") unless @image.nil?
  @ports = ports
  Jsii::Type.check_type(@ports, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGlnaHRzYWlsLkNmbkNvbnRhaW5lci5Qb3J0SW5mb1Byb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "ports") unless @ports.nil?
end

Instance Attribute Details

#commandArray<String>? (readonly)

The launch command for the container.



659
660
661
# File 'lightsail/cfn_container.rb', line 659

def command
  @command
end

#container_nameString? (readonly)

The name of the container.



664
665
666
# File 'lightsail/cfn_container.rb', line 664

def container_name
  @container_name
end

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

The environment variables of the container.



669
670
671
# File 'lightsail/cfn_container.rb', line 669

def environment
  @environment
end

#imageString? (readonly)

The name of the image used for the container.

Container images that are sourced from (registered and stored on) your container service start with a colon ( : ). For example, if your container service name is container-service-1 , the container image label is mystaticsite , and you want to use the third version ( 3 ) of the registered container image, then you should specify :container-service-1.mystaticsite.3 . To use the latest version of a container image, specify latest instead of a version number (for example, :container-service-1.mystaticsite.latest ). Your container service will automatically use the highest numbered version of the registered container image.

Container images that are sourced from a public registry like Docker Hub don’t start with a colon. For example, nginx:latest or nginx .



678
679
680
# File 'lightsail/cfn_container.rb', line 678

def image
  @image
end

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

An object that describes the open firewall ports and protocols of the container.



683
684
685
# File 'lightsail/cfn_container.rb', line 683

def ports
  @ports
end

Class Method Details

.jsii_propertiesObject



685
686
687
688
689
690
691
692
693
# File 'lightsail/cfn_container.rb', line 685

def self.jsii_properties
  {
    :command => "command",
    :container_name => "containerName",
    :environment => "environment",
    :image => "image",
    :ports => "ports",
  }
end

Instance Method Details

#to_jsiiObject



695
696
697
698
699
700
701
702
703
704
705
# File 'lightsail/cfn_container.rb', line 695

def to_jsii
  result = {}
  result.merge!({
    "command" => @command,
    "containerName" => @container_name,
    "environment" => @environment,
    "image" => @image,
    "ports" => @ports,
  })
  result.compact
end