Class: AWSCDK::CloudAssemblySchema::ViolatingConstructJson

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

Overview

A construct that violated a policy rule.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(construct_path:, cloud_formation_resource: nil, construct_fqn: nil, library_version: nil, stack_traces: nil) ⇒ ViolatingConstructJson

Returns a new instance of ViolatingConstructJson.

Parameters:

  • construct_path (String)

    The construct path as defined in the application.

  • cloud_formation_resource (AWSCDK::CloudAssemblySchema::CloudFormationResourceJson, nil) (defaults to: nil)

    If this construct violation regards a CloudFormation resource, a reference to the resource details.

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

    The fully qualified name of the construct class (includes the library name).

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

    The version of the library that contains this construct.

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

    Stack traces associated with this violation.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'cloud_assembly_schema/violating_construct_json.rb', line 12

def initialize(construct_path:, cloud_formation_resource: nil, construct_fqn: nil, library_version: nil, stack_traces: nil)
  @construct_path = construct_path
  Jsii::Type.check_type(@construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath")
  @cloud_formation_resource = cloud_formation_resource.is_a?(Hash) ? ::AWSCDK::CloudAssemblySchema::CloudFormationResourceJson.new(**cloud_formation_resource.transform_keys(&:to_sym)) : cloud_formation_resource
  Jsii::Type.check_type(@cloud_formation_resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5jbG91ZF9hc3NlbWJseV9zY2hlbWEuQ2xvdWRGb3JtYXRpb25SZXNvdXJjZUpzb24ifQ==")), "cloudFormationResource") unless @cloud_formation_resource.nil?
  @construct_fqn = construct_fqn
  Jsii::Type.check_type(@construct_fqn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructFqn") unless @construct_fqn.nil?
  @library_version = library_version
  Jsii::Type.check_type(@library_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "libraryVersion") unless @library_version.nil?
  @stack_traces = stack_traces
  Jsii::Type.check_type(@stack_traces, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "stackTraces") unless @stack_traces.nil?
end

Instance Attribute Details

#cloud_formation_resourceAWSCDK::CloudAssemblySchema::CloudFormationResourceJson? (readonly)

If this construct violation regards a CloudFormation resource, a reference to the resource details.



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

def cloud_formation_resource
  @cloud_formation_resource
end

#construct_fqnString? (readonly)

Note:

Default: - no construct info

The fully qualified name of the construct class (includes the library name).

Returns:

  • (String, nil)


38
39
40
# File 'cloud_assembly_schema/violating_construct_json.rb', line 38

def construct_fqn
  @construct_fqn
end

#construct_pathString (readonly)

Note:

Default: - no construct path

The construct path as defined in the application.

Returns:

  • (String)


29
30
31
# File 'cloud_assembly_schema/violating_construct_json.rb', line 29

def construct_path
  @construct_path
end

#library_versionString? (readonly)

Note:

Default: - no version info

The version of the library that contains this construct.

The library name is the first component of the construct FQN.

Returns:

  • (String, nil)


45
46
47
# File 'cloud_assembly_schema/violating_construct_json.rb', line 45

def library_version
  @library_version
end

#stack_tracesArray<String>? (readonly)

Note:

Default: - No stack traces

Stack traces associated with this violation.

This can be all the stack traces where a violating property got its value, or just the construct creation stack trace.

Every element of the array is a stack trace, where each stack trace is a \n-delimited string.

Returns:

  • (Array<String>, nil)


55
56
57
# File 'cloud_assembly_schema/violating_construct_json.rb', line 55

def stack_traces
  @stack_traces
end

Class Method Details

.jsii_propertiesObject



57
58
59
60
61
62
63
64
65
# File 'cloud_assembly_schema/violating_construct_json.rb', line 57

def self.jsii_properties
  {
    :construct_path => "constructPath",
    :cloud_formation_resource => "cloudFormationResource",
    :construct_fqn => "constructFqn",
    :library_version => "libraryVersion",
    :stack_traces => "stackTraces",
  }
end

Instance Method Details

#to_jsiiObject



67
68
69
70
71
72
73
74
75
76
77
# File 'cloud_assembly_schema/violating_construct_json.rb', line 67

def to_jsii
  result = {}
  result.merge!({
    "constructPath" => @construct_path,
    "cloudFormationResource" => @cloud_formation_resource,
    "constructFqn" => @construct_fqn,
    "libraryVersion" => @library_version,
    "stackTraces" => @stack_traces,
  })
  result.compact
end