Class: AWSCDK::EC2::InitUser
- Inherits:
-
InitElement
- Object
- InitElement
- AWSCDK::EC2::InitUser
- Defined in:
- ec2/init_user.rb
Overview
Create Linux/UNIX users and to assign user IDs.
Users are created as non-interactive system users with a shell of /sbin/nologin. This is by design and cannot be modified.
Not supported for Windows systems.
Class Method Summary collapse
-
.from_name(user_name, options = nil) ⇒ AWSCDK::EC2::InitUser
Create a user from user name.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#element_type ⇒ String
Returns the init element type for this element.
-
#initialize(user_name, user_options) ⇒ InitUser
constructor
A new instance of InitUser.
Constructor Details
#initialize(user_name, user_options) ⇒ InitUser
Returns a new instance of InitUser.
15 16 17 18 19 20 |
# File 'ec2/init_user.rb', line 15 def initialize(user_name, ) = .is_a?(Hash) ? ::AWSCDK::EC2::InitUserOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(user_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userName") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluaXRVc2VyT3B0aW9ucyJ9")), "userOptions") Jsii::Object.instance_method(:initialize).bind(self).call(user_name, ) end |
Class Method Details
.from_name(user_name, options = nil) ⇒ AWSCDK::EC2::InitUser
Create a user from user name.
33 34 35 36 37 38 |
# File 'ec2/init_user.rb', line 33 def self.from_name(user_name, = nil) Jsii::Type.check_type(user_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "userName") = .is_a?(Hash) ? ::AWSCDK::EC2::InitUserOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluaXRVc2VyT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.InitUser", "fromName", [user_name, ]) end |
.jsii_overridable_methods ⇒ Object
22 23 24 25 26 |
# File 'ec2/init_user.rb', line 22 def self.jsii_overridable_methods { :element_type => { kind: :property, name: "elementType", is_optional: false }, } end |
Instance Method Details
#element_type ⇒ String
Returns the init element type for this element.
43 44 45 |
# File 'ec2/init_user.rb', line 43 def element_type() jsii_get_property("elementType") end |