Class: AWSCDK::PolicyViolatingResource
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::PolicyViolatingResource
- Defined in:
- policy_violating_resource.rb
Overview
Resource violating a specific rule.
Instance Attribute Summary collapse
-
#construct_path ⇒ String?
readonly
The construct path of the violating construct.
-
#locations ⇒ Array<String>
readonly
The locations in the CloudFormation template that pose the violations.
-
#resource_logical_id ⇒ String?
readonly
The logical ID of the resource in the CloudFormation template.
-
#template_path ⇒ String?
readonly
The path to the CloudFormation template that contains this resource.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(locations:, construct_path: nil, resource_logical_id: nil, template_path: nil) ⇒ PolicyViolatingResource
constructor
A new instance of PolicyViolatingResource.
- #to_jsii ⇒ Object
Constructor Details
#initialize(locations:, construct_path: nil, resource_logical_id: nil, template_path: nil) ⇒ PolicyViolatingResource
Returns a new instance of PolicyViolatingResource.
11 12 13 14 15 16 17 18 19 20 |
# File 'policy_violating_resource.rb', line 11 def initialize(locations:, construct_path: nil, resource_logical_id: nil, template_path: nil) @locations = locations Jsii::Type.check_type(@locations, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "locations") @construct_path = construct_path Jsii::Type.check_type(@construct_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "constructPath") unless @construct_path.nil? @resource_logical_id = resource_logical_id Jsii::Type.check_type(@resource_logical_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "resourceLogicalId") unless @resource_logical_id.nil? @template_path = template_path Jsii::Type.check_type(@template_path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "templatePath") unless @template_path.nil? end |
Instance Attribute Details
#construct_path ⇒ String? (readonly)
Default: - construct path is derived from the resource logical ID
The construct path of the violating construct.
Use this for violations that originate from constructs rather than
CloudFormation resources (e.g. annotations added via Annotations.of()
or Validations.of()). When provided, the report will use this path
directly instead of deriving it from the resource logical ID.
Mutually exclusive with resource_logical_id.
39 40 41 |
# File 'policy_violating_resource.rb', line 39 def construct_path @construct_path end |
#locations ⇒ Array<String> (readonly)
The locations in the CloudFormation template that pose the violations.
TODO: Define whether this is from the root of the template, or from the resource itself. Not sure this is well-defined at the moment.
28 29 30 |
# File 'policy_violating_resource.rb', line 28 def locations @locations end |
#resource_logical_id ⇒ String? (readonly)
Default: - no resource logical ID
The logical ID of the resource in the CloudFormation template.
Required for plugin-sourced violations that operate on CloudFormation
templates. Mutually exclusive with construct_path.
47 48 49 |
# File 'policy_violating_resource.rb', line 47 def resource_logical_id @resource_logical_id end |
#template_path ⇒ String? (readonly)
Default: - no template path
The path to the CloudFormation template that contains this resource.
52 53 54 |
# File 'policy_violating_resource.rb', line 52 def template_path @template_path end |
Class Method Details
.jsii_properties ⇒ Object
54 55 56 57 58 59 60 61 |
# File 'policy_violating_resource.rb', line 54 def self.jsii_properties { :locations => "locations", :construct_path => "constructPath", :resource_logical_id => "resourceLogicalId", :template_path => "templatePath", } end |
Instance Method Details
#to_jsii ⇒ Object
63 64 65 66 67 68 69 70 71 72 |
# File 'policy_violating_resource.rb', line 63 def to_jsii result = {} result.merge!({ "locations" => @locations, "constructPath" => @construct_path, "resourceLogicalId" => @resource_logical_id, "templatePath" => @template_path, }) result.compact end |