Class: AWSCDK::EC2::InitCommand

Inherits:
InitElement
  • Object
show all
Defined in:
ec2/init_command.rb

Overview

Command to execute on the instance.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ InitCommand

Returns a new instance of InitCommand.

Raises:

  • (NoMethodError)


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.

Parameters:

Returns:

  • (AWSCDK::EC2::InitCommand)


25
26
27
28
29
30
# File 'ec2/init_command.rb', line 25

def self.argv_command(argv, options = nil)
  Jsii::Type.check_type(argv, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "argv")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::InitCommandOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluaXRDb21tYW5kT3B0aW9ucyJ9")), "options") unless options.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.InitCommand", "argvCommand", [argv, options])
end

.jsii_overridable_methodsObject



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.

Parameters:

Returns:

  • (AWSCDK::EC2::InitCommand)


40
41
42
43
44
45
# File 'ec2/init_command.rb', line 40

def self.shell_command(shell_command, options = nil)
  Jsii::Type.check_type(shell_command, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "shellCommand")
  options = options.is_a?(Hash) ? ::AWSCDK::EC2::InitCommandOptions.new(**options.transform_keys(&:to_sym)) : options
  Jsii::Type.check_type(options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLkluaXRDb21tYW5kT3B0aW9ucyJ9")), "options") unless options.nil?
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_ec2.InitCommand", "shellCommand", [shell_command, options])
end

Instance Method Details

#element_typeString

Returns the init element type for this element.

Returns:

  • (String)


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

def element_type()
  jsii_get_property("elementType")
end