Class: AWSCDK::EC2::SystemdConfigFileOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/systemd_config_file_options.rb

Overview

Options for creating a SystemD configuration file.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • command (String)

    The command to run to start this service.

  • after_network (Boolean, nil) (defaults to: nil)

    Start the service after the networking part of the OS comes up.

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

    The working directory for the command.

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

    A description of this service.

  • environment_files (Array<String>, nil) (defaults to: nil)

    Loads environment variables from files when the process is running.

  • environment_variables (Hash{String => String}, nil) (defaults to: nil)

    Environment variables to load when the process is running.

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

    The group to execute the process under.

  • keep_running (Boolean, nil) (defaults to: nil)

    Keep the process running all the time.

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

    The user to execute the process under.



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_networkBoolean? (readonly)

Note:

Default: true

Start the service after the networking part of the OS comes up.

Returns:

  • (Boolean, nil)


45
46
47
# File 'ec2/systemd_config_file_options.rb', line 45

def after_network
  @after_network
end

#commandString (readonly)

The command to run to start this service.

Returns:

  • (String)


40
41
42
# File 'ec2/systemd_config_file_options.rb', line 40

def command
  @command
end

#cwdString? (readonly)

Note:

Default: Root directory or home directory of specified user

The working directory for the command.

Returns:

  • (String, nil)


50
51
52
# File 'ec2/systemd_config_file_options.rb', line 50

def cwd
  @cwd
end

#descriptionString? (readonly)

Note:

Default: - No description

A description of this service.

Returns:

  • (String, nil)


55
56
57
# File 'ec2/systemd_config_file_options.rb', line 55

def description
  @description
end

#environment_filesArray<String>? (readonly)

Note:

Default: - No environment files

Loads environment variables from files when the process is running.

Must use absolute paths.

Returns:

  • (Array<String>, nil)


62
63
64
# File 'ec2/systemd_config_file_options.rb', line 62

def environment_files
  @environment_files
end

#environment_variablesHash{String => String}? (readonly)

Note:

Default: - No environment variables set

Environment variables to load when the process is running.

Returns:

  • (Hash{String => String}, nil)


67
68
69
# File 'ec2/systemd_config_file_options.rb', line 67

def environment_variables
  @environment_variables
end

#groupString? (readonly)

Note:

Default: root

The group to execute the process under.

Returns:

  • (String, nil)


72
73
74
# File 'ec2/systemd_config_file_options.rb', line 72

def group
  @group
end

#keep_runningBoolean? (readonly)

Note:

Default: true

Keep the process running all the time.

Restarts the process when it exits for any reason other than the machine shutting down.

Returns:

  • (Boolean, nil)


80
81
82
# File 'ec2/systemd_config_file_options.rb', line 80

def keep_running
  @keep_running
end

#userString? (readonly)

Note:

Default: root

The user to execute the process under.

Returns:

  • (String, nil)


85
86
87
# File 'ec2/systemd_config_file_options.rb', line 85

def user
  @user
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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