Class: AWSCDK::EC2::InitCommand
- Inherits:
-
InitElement
- Object
- InitElement
- AWSCDK::EC2::InitCommand
- Defined in:
- ec2/init_command.rb
Overview
Command to execute on the instance.
Class Method Summary collapse
-
.argv_command(argv, options = nil) ⇒ AWSCDK::EC2::InitCommand
Run a command from an argv array.
- .jsii_overridable_methods ⇒ Object
-
.shell_command(shell_command, options = nil) ⇒ AWSCDK::EC2::InitCommand
Run a shell command.
Instance Method Summary collapse
-
#element_type ⇒ String
Returns the init element type for this element.
-
#initialize(*args) ⇒ InitCommand
constructor
A new instance of InitCommand.
Constructor Details
#initialize(*args) ⇒ InitCommand
Returns a new instance of InitCommand.
8 9 10 |
# File 'ec2/init_command.rb', line 8 def initialize(*args) raise NoMethodError, "aws-cdk-lib.aws_ec2.InitCommand does not have a visible constructor; use the provided factory methods" end |
Class Method Details
.argv_command(argv, options = nil) ⇒ AWSCDK::EC2::InitCommand
Run a command from an argv array.
You do not need to escape space characters or enclose command parameters in quotes.
25 26 27 28 29 30 |
# File 'ec2/init_command.rb', line 25 def self.argv_command(argv, = nil) Jsii::Type.check_type(argv, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "argv") = .is_a?(Hash) ? ::AWSCDK::EC2::InitCommandOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluaXRDb21tYW5kT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.InitCommand", "argvCommand", [argv, ]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 |
# File 'ec2/init_command.rb', line 12 def self.jsii_overridable_methods { :element_type => { kind: :property, name: "elementType", is_optional: false }, } end |
.shell_command(shell_command, options = nil) ⇒ AWSCDK::EC2::InitCommand
Run a shell command.
Remember that some characters like &, |, ;, > etc. have special meaning in a shell and
need to be preceded by a \ if you want to treat them as part of a filename.
40 41 42 43 44 45 |
# File 'ec2/init_command.rb', line 40 def self.shell_command(shell_command, = nil) Jsii::Type.check_type(shell_command, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "shellCommand") = .is_a?(Hash) ? ::AWSCDK::EC2::InitCommandOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluaXRDb21tYW5kT3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.InitCommand", "shellCommand", [shell_command, ]) end |
Instance Method Details
#element_type ⇒ String
Returns the init element type for this element.
50 51 52 |
# File 'ec2/init_command.rb', line 50 def element_type() jsii_get_property("elementType") end |