Class: AWSCDK::CloudFormationValidatePlugin

Inherits:
Jsii::Object
  • Object
show all
Includes:
IPolicyValidationPlugin
Defined in:
cloud_formation_validate_plugin.rb

Overview

Validation plugin that uses the CloudFormation validation engine to evaluate templates against built-in rules.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props = nil) ⇒ CloudFormationValidatePlugin

Returns a new instance of CloudFormationValidatePlugin.

Parameters:



10
11
12
13
14
# File 'cloud_formation_validate_plugin.rb', line 10

def initialize(props = nil)
  props = props.is_a?(Hash) ? ::AWSCDK::CloudFormationValidatePluginProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5DbG91ZEZvcm1hdGlvblZhbGlkYXRlUGx1Z2luUHJvcHMifQ==")), "props") unless props.nil?
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



16
17
18
19
20
21
22
23
# File 'cloud_formation_validate_plugin.rb', line 16

def self.jsii_overridable_methods
  {
    :name => { kind: :property, name: "name", is_optional: false },
    :rule_ids => { kind: :property, name: "ruleIds", is_optional: true },
    :version => { kind: :property, name: "version", is_optional: true },
    :validate => { kind: :method, name: "validate", is_optional: false },
  }
end

.PLUGIN_NAMEString

The default name of this plugin.

Returns:

  • (String)


28
29
30
# File 'cloud_formation_validate_plugin.rb', line 28

def self.PLUGIN_NAME()
  Jsii::Kernel.instance.get_static("aws-cdk-lib.CloudFormationValidatePlugin", "PLUGIN_NAME")
end

Instance Method Details

#nameString

The name of the plugin that will be displayed in the validation report.

Returns:

  • (String)


35
36
37
# File 'cloud_formation_validate_plugin.rb', line 35

def name()
  jsii_get_property("name")
end

#rule_idsArray<String>?

The list of rule IDs that the plugin will evaluate.

Used for analytics purposes.

Returns:

  • (Array<String>, nil)


45
46
47
# File 'cloud_formation_validate_plugin.rb', line 45

def rule_ids()
  jsii_get_property("ruleIds")
end

#validate(context) ⇒ AWSCDK::PolicyValidationPluginReport

The method that will be called by the CDK framework to perform validations.

This is where the plugin will evaluate the CloudFormation templates for compliance and report and violations



63
64
65
66
# File 'cloud_formation_validate_plugin.rb', line 63

def validate(context)
  Jsii::Type.check_type(context, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5JUG9saWN5VmFsaWRhdGlvbkNvbnRleHQifQ==")), "context")
  jsii_call_method("validate", [context])
end

#versionString?

The version of the plugin, following the Semantic Versioning specification (see https://semver.org/). This version is used for analytics purposes, to measure the usage of different plugins and different versions. The value of this property should be kept in sync with the actual version of the software package. If the version is not provided or is not a valid semantic version, it will be reported as 0.0.0.

Returns:

  • (String, nil)


52
53
54
# File 'cloud_formation_validate_plugin.rb', line 52

def version()
  jsii_get_property("version")
end