Class: AWSCDK::CloudAssemblySchema::CDKCommand

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_assembly_schema/cdk_command.rb

Overview

Represents a cdk command i.e. synth, deploy, & destroy.

Direct Known Subclasses

DeployCommand, DestroyCommand

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enabled: nil, expected_message: nil, expect_error: nil) ⇒ CDKCommand

Returns a new instance of CDKCommand.

Parameters:

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

    Whether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable synth and disable deploy & destroy in order to limit the test to synthesis.

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

    This can be used in combination with expectedError to validate that a specific message is returned.

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

    If the runner should expect this command to fail.



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

def initialize(enabled: nil, expected_message: nil, expect_error: nil)
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil?
  @expected_message = expected_message
  Jsii::Type.check_type(@expected_message, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "expectedMessage") unless @expected_message.nil?
  @expect_error = expect_error
  Jsii::Type.check_type(@expect_error, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "expectError") unless @expect_error.nil?
end

Instance Attribute Details

#enabledBoolean? (readonly)

Note:

Default: true

Whether or not to run this command as part of the workflow This can be used if you only want to test some of the workflow for example enable synth and disable deploy & destroy in order to limit the test to synthesis.

Returns:

  • (Boolean, nil)


23
24
25
# File 'cloud_assembly_schema/cdk_command.rb', line 23

def enabled
  @enabled
end

#expect_errorBoolean? (readonly)

Note:

Default: false

If the runner should expect this command to fail.

Returns:

  • (Boolean, nil)


33
34
35
# File 'cloud_assembly_schema/cdk_command.rb', line 33

def expect_error
  @expect_error
end

#expected_messageString? (readonly)

Note:

Default: - do not validate message

This can be used in combination with expectedError to validate that a specific message is returned.

Returns:

  • (String, nil)


28
29
30
# File 'cloud_assembly_schema/cdk_command.rb', line 28

def expected_message
  @expected_message
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'cloud_assembly_schema/cdk_command.rb', line 35

def self.jsii_properties
  {
    :enabled => "enabled",
    :expected_message => "expectedMessage",
    :expect_error => "expectError",
  }
end

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'cloud_assembly_schema/cdk_command.rb', line 43

def to_jsii
  result = {}
  result.merge!({
    "enabled" => @enabled,
    "expectedMessage" => @expected_message,
    "expectError" => @expect_error,
  })
  result.compact
end