Class: AWSCDK::EC2::SystemdConfigFileOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EC2::SystemdConfigFileOptions
- Defined in:
- ec2/systemd_config_file_options.rb
Overview
Options for creating a SystemD configuration file.
Instance Attribute Summary collapse
-
#after_network ⇒ Boolean?
readonly
Start the service after the networking part of the OS comes up.
-
#command ⇒ String
readonly
The command to run to start this service.
-
#cwd ⇒ String?
readonly
The working directory for the command.
-
#description ⇒ String?
readonly
A description of this service.
-
#environment_files ⇒ Array<String>?
readonly
Loads environment variables from files when the process is running.
-
#environment_variables ⇒ Hash{String => String}?
readonly
Environment variables to load when the process is running.
-
#group ⇒ String?
readonly
The group to execute the process under.
-
#keep_running ⇒ Boolean?
readonly
Keep the process running all the time.
-
#user ⇒ String?
readonly
The user to execute the process under.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(command:, after_network: nil, cwd: nil, description: nil, environment_files: nil, environment_variables: nil, group: nil, keep_running: nil, user: nil) ⇒ SystemdConfigFileOptions
constructor
A new instance of SystemdConfigFileOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(command:, after_network: nil, cwd: nil, description: nil, environment_files: nil, environment_variables: nil, group: nil, keep_running: nil, user: nil) ⇒ SystemdConfigFileOptions
Returns a new instance of SystemdConfigFileOptions.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'ec2/systemd_config_file_options.rb', line 16 def initialize(command:, after_network: nil, cwd: nil, description: nil, environment_files: nil, environment_variables: nil, group: nil, keep_running: nil, user: nil) @command = command Jsii::Type.check_type(@command, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "command") @after_network = after_network Jsii::Type.check_type(@after_network, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "afterNetwork") unless @after_network.nil? @cwd = cwd Jsii::Type.check_type(@cwd, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cwd") unless @cwd.nil? @description = description Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil? @environment_files = environment_files Jsii::Type.check_type(@environment_files, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "environmentFiles") unless @environment_files.nil? @environment_variables = environment_variables Jsii::Type.check_type(@environment_variables, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "environmentVariables") unless @environment_variables.nil? @group = group Jsii::Type.check_type(@group, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "group") unless @group.nil? @keep_running = keep_running Jsii::Type.check_type(@keep_running, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "keepRunning") unless @keep_running.nil? @user = user Jsii::Type.check_type(@user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "user") unless @user.nil? end |
Instance Attribute Details
#after_network ⇒ Boolean? (readonly)
Default: true
Start the service after the networking part of the OS comes up.
45 46 47 |
# File 'ec2/systemd_config_file_options.rb', line 45 def after_network @after_network end |
#command ⇒ String (readonly)
The command to run to start this service.
40 41 42 |
# File 'ec2/systemd_config_file_options.rb', line 40 def command @command end |
#cwd ⇒ String? (readonly)
Default: Root directory or home directory of specified user
The working directory for the command.
50 51 52 |
# File 'ec2/systemd_config_file_options.rb', line 50 def cwd @cwd end |
#description ⇒ String? (readonly)
Default: - No description
A description of this service.
55 56 57 |
# File 'ec2/systemd_config_file_options.rb', line 55 def description @description end |
#environment_files ⇒ Array<String>? (readonly)
Default: - No environment files
Loads environment variables from files when the process is running.
Must use absolute paths.
62 63 64 |
# File 'ec2/systemd_config_file_options.rb', line 62 def environment_files @environment_files end |
#environment_variables ⇒ Hash{String => String}? (readonly)
Default: - No environment variables set
Environment variables to load when the process is running.
67 68 69 |
# File 'ec2/systemd_config_file_options.rb', line 67 def environment_variables @environment_variables end |
#group ⇒ String? (readonly)
Default: root
The group to execute the process under.
72 73 74 |
# File 'ec2/systemd_config_file_options.rb', line 72 def group @group end |
#keep_running ⇒ Boolean? (readonly)
Default: true
Keep the process running all the time.
Restarts the process when it exits for any reason other than the machine shutting down.
80 81 82 |
# File 'ec2/systemd_config_file_options.rb', line 80 def keep_running @keep_running end |
#user ⇒ String? (readonly)
Default: root
The user to execute the process under.
85 86 87 |
# File 'ec2/systemd_config_file_options.rb', line 85 def user @user end |
Class Method Details
.jsii_properties ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'ec2/systemd_config_file_options.rb', line 87 def self.jsii_properties { :command => "command", :after_network => "afterNetwork", :cwd => "cwd", :description => "description", :environment_files => "environmentFiles", :environment_variables => "environmentVariables", :group => "group", :keep_running => "keepRunning", :user => "user", } end |
Instance Method Details
#to_jsii ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'ec2/systemd_config_file_options.rb', line 101 def to_jsii result = {} result.merge!({ "command" => @command, "afterNetwork" => @after_network, "cwd" => @cwd, "description" => @description, "environmentFiles" => @environment_files, "environmentVariables" => @environment_variables, "group" => @group, "keepRunning" => @keep_running, "user" => @user, }) result.compact end |