Class: AWSCDK::ECSPatterns::ScheduledTaskImageProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::ECSPatterns::ScheduledTaskImageProps
- Defined in:
- ecs_patterns/scheduled_task_image_props.rb
Direct Known Subclasses
ScheduledEC2TaskImageOptions, ScheduledFargateTaskImageOptions
Instance Attribute Summary collapse
-
#command ⇒ Array<String>?
readonly
The command that is passed to the container.
-
#container_name ⇒ String?
readonly
Optional name for the container added.
-
#environment ⇒ Hash{String => String}?
readonly
The environment variables to pass to the container.
-
#image ⇒ AWSCDK::ECS::ContainerImage
readonly
The image used to start a container.
-
#log_driver ⇒ AWSCDK::ECS::LogDriver?
readonly
The log driver to use.
-
#secrets ⇒ Hash{String => AWSCDK::ECS::Secret}?
readonly
The secret to expose to the container as an environment variable.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(image:, command: nil, container_name: nil, environment: nil, log_driver: nil, secrets: nil) ⇒ ScheduledTaskImageProps
constructor
A new instance of ScheduledTaskImageProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(image:, command: nil, container_name: nil, environment: nil, log_driver: nil, secrets: nil) ⇒ ScheduledTaskImageProps
Returns a new instance of ScheduledTaskImageProps.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 12 def initialize(image:, command: nil, container_name: nil, environment: nil, log_driver: nil, secrets: nil) @image = image Jsii::Type.check_type(@image, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkNvbnRhaW5lckltYWdlIn0=")), "image") @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("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environment") unless @environment.nil? @log_driver = log_driver Jsii::Type.check_type(@log_driver, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWNzLkxvZ0RyaXZlciJ9")), "logDriver") unless @log_driver.nil? @secrets = secrets Jsii::Type.check_type(@secrets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lY3MuU2VjcmV0In0sImtpbmQiOiJtYXAifX0=")), "secrets") unless @secrets.nil? end |
Instance Attribute Details
#command ⇒ Array<String>? (readonly)
Default: - CMD value built into container image.
The command that is passed to the container.
If you provide a shell command as a single string, you have to quote command-line arguments.
40 41 42 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 40 def command @command end |
#container_name ⇒ String? (readonly)
Default: - ScheduledContainer
Optional name for the container added.
45 46 47 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 45 def container_name @container_name end |
#environment ⇒ Hash{String => String}? (readonly)
Default: none
The environment variables to pass to the container.
50 51 52 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 50 def environment @environment end |
#image ⇒ AWSCDK::ECS::ContainerImage (readonly)
Default: - none
The image used to start a container.
Image or taskDefinition must be specified, but not both.
33 34 35 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 33 def image @image end |
#log_driver ⇒ AWSCDK::ECS::LogDriver? (readonly)
Default: - AwsLogDriver if enableLogging is true
The log driver to use.
55 56 57 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 55 def log_driver @log_driver end |
#secrets ⇒ Hash{String => AWSCDK::ECS::Secret}? (readonly)
Default: - No secret environment variables.
The secret to expose to the container as an environment variable.
60 61 62 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 60 def secrets @secrets end |
Class Method Details
.jsii_properties ⇒ Object
62 63 64 65 66 67 68 69 70 71 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 62 def self.jsii_properties { :image => "image", :command => "command", :container_name => "containerName", :environment => "environment", :log_driver => "logDriver", :secrets => "secrets", } end |
Instance Method Details
#to_jsii ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'ecs_patterns/scheduled_task_image_props.rb', line 73 def to_jsii result = {} result.merge!({ "image" => @image, "command" => @command, "containerName" => @container_name, "environment" => @environment, "logDriver" => @log_driver, "secrets" => @secrets, }) result.compact end |