class TerraformLandscape::TerraformPlan

def display_resource(resource) # rubocop:disable Metrics/MethodLength

rubocop:disable Metrics/MethodLength
def display_resource(resource) # rubocop:disable Metrics/MethodLength
  change_color = CHANGE_SYMBOL_TO_COLOR[resource[:change]]
  resource_header = "#{resource[:change]} #{resource[:resource_type]}." \
                    "#{resource[:resource_name]}".colorize(change_color)
  if resource[:reason]
    resource_header += " (#{resource[:reason]})".colorize(:magenta)
  end
  if resource[:additional_reason]
    resource_header += " (#{resource[:additional_reason]})".colorize(:magenta)
  end
  @out.puts resource_header
  # Determine longest attribute name so we align all values at same indentation
  attribute_value_indent_amount = attribute_indent_amount_for_resource(resource)
  resource[:attributes].each do |attribute_name, attribute_value_and_reason|
    attribute_value = attribute_value_and_reason[:value]
    attribute_change_reason = attribute_value_and_reason[:reason]
    display_attribute(resource,
                      change_color,
                      attribute_name,
                      attribute_value,
                      attribute_change_reason,
                      attribute_value_indent_amount)
  end
end