Class: AWSCDK::EC2::InitFileOptions

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

Overview

Options for InitFile.

Direct Known Subclasses

InitFileAssetOptions

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base64_encoded: nil, group: nil, mode: nil, owner: nil, service_restart_handles: nil) ⇒ InitFileOptions

Returns a new instance of InitFileOptions.

Parameters:

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

    True if the inlined content (from a string or file) should be treated as base64 encoded.

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

    The name of the owning group for this file.

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

    A six-digit octal value representing the mode for this file.

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

    The name of the owning user for this file.

  • service_restart_handles (Array<AWSCDK::EC2::InitServiceRestartHandle>, nil) (defaults to: nil)

    Restart the given service after this file has been written.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'ec2/init_file_options.rb', line 12

def initialize(base64_encoded: nil, group: nil, mode: nil, owner: nil, service_restart_handles: nil)
  @base64_encoded = base64_encoded
  Jsii::Type.check_type(@base64_encoded, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "base64Encoded") unless @base64_encoded.nil?
  @group = group
  Jsii::Type.check_type(@group, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "group") unless @group.nil?
  @mode = mode
  Jsii::Type.check_type(@mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mode") unless @mode.nil?
  @owner = owner
  Jsii::Type.check_type(@owner, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "owner") unless @owner.nil?
  @service_restart_handles = service_restart_handles
  Jsii::Type.check_type(@service_restart_handles, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSW5pdFNlcnZpY2VSZXN0YXJ0SGFuZGxlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "serviceRestartHandles") unless @service_restart_handles.nil?
end

Instance Attribute Details

#base64_encodedBoolean? (readonly)

Note:

Default: false

True if the inlined content (from a string or file) should be treated as base64 encoded.

Only applicable for inlined string and file content.

Returns:

  • (Boolean, nil)


31
32
33
# File 'ec2/init_file_options.rb', line 31

def base64_encoded
  @base64_encoded
end

#groupString? (readonly)

Note:

Default: 'root'

The name of the owning group for this file.

Not supported for Windows systems.

Returns:

  • (String, nil)


38
39
40
# File 'ec2/init_file_options.rb', line 38

def group
  @group
end

#modeString? (readonly)

Note:

Default: '000644'

A six-digit octal value representing the mode for this file.

Use the first three digits for symlinks and the last three digits for setting permissions. To create a symlink, specify 120xxx, where xxx defines the permissions of the target file. To specify permissions for a file, use the last three digits, such as 000644.

Not supported for Windows systems.

Returns:

  • (String, nil)


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

def mode
  @mode
end

#ownerString? (readonly)

Note:

Default: 'root'

The name of the owning user for this file.

Not supported for Windows systems.

Returns:

  • (String, nil)


57
58
59
# File 'ec2/init_file_options.rb', line 57

def owner
  @owner
end

#service_restart_handlesArray<AWSCDK::EC2::InitServiceRestartHandle>? (readonly)

Note:

Default: - Do not restart any service

Restart the given service after this file has been written.

Returns:



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

def service_restart_handles
  @service_restart_handles
end

Class Method Details

.jsii_propertiesObject



64
65
66
67
68
69
70
71
72
# File 'ec2/init_file_options.rb', line 64

def self.jsii_properties
  {
    :base64_encoded => "base64Encoded",
    :group => "group",
    :mode => "mode",
    :owner => "owner",
    :service_restart_handles => "serviceRestartHandles",
  }
end

Instance Method Details

#to_jsiiObject



74
75
76
77
78
79
80
81
82
83
84
# File 'ec2/init_file_options.rb', line 74

def to_jsii
  result = {}
  result.merge!({
    "base64Encoded" => @base64_encoded,
    "group" => @group,
    "mode" => @mode,
    "owner" => @owner,
    "serviceRestartHandles" => @service_restart_handles,
  })
  result.compact
end