Class: AWSCDK::EC2::InitUserOptions

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

Overview

Optional parameters used when creating a user.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(groups: nil, home_dir: nil, user_id: nil) ⇒ InitUserOptions

Returns a new instance of InitUserOptions.

Parameters:

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

    A list of group names.

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

    The user's home directory.

  • user_id (Numeric, nil) (defaults to: nil)

    A user ID.



10
11
12
13
14
15
16
17
# File 'ec2/init_user_options.rb', line 10

def initialize(groups: nil, home_dir: nil, user_id: nil)
  @groups = groups
  Jsii::Type.check_type(@groups, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "groups") unless @groups.nil?
  @home_dir = home_dir
  Jsii::Type.check_type(@home_dir, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "homeDir") unless @home_dir.nil?
  @user_id = user_id
  Jsii::Type.check_type(@user_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "userId") unless @user_id.nil?
end

Instance Attribute Details

#groupsArray<String>? (readonly)

Note:

Default: the user is not associated with any groups.

A list of group names.

The user will be added to each group in the list.

Returns:

  • (Array<String>, nil)


25
26
27
# File 'ec2/init_user_options.rb', line 25

def groups
  @groups
end

#home_dirString? (readonly)

Note:

Default: assigned by the OS

The user's home directory.

Returns:

  • (String, nil)


30
31
32
# File 'ec2/init_user_options.rb', line 30

def home_dir
  @home_dir
end

#user_idNumeric? (readonly)

Note:

Default: assigned by the OS

A user ID.

The creation process fails if the user name exists with a different user ID. If the user ID is already assigned to an existing user the operating system may reject the creation request.

Returns:

  • (Numeric, nil)


39
40
41
# File 'ec2/init_user_options.rb', line 39

def user_id
  @user_id
end

Class Method Details

.jsii_propertiesObject



41
42
43
44
45
46
47
# File 'ec2/init_user_options.rb', line 41

def self.jsii_properties
  {
    :groups => "groups",
    :home_dir => "homeDir",
    :user_id => "userId",
  }
end

Instance Method Details

#to_jsiiObject



49
50
51
52
53
54
55
56
57
# File 'ec2/init_user_options.rb', line 49

def to_jsii
  result = {}
  result.merge!({
    "groups" => @groups,
    "homeDir" => @home_dir,
    "userId" => @user_id,
  })
  result.compact
end