Class: AwsConfigurationRecorder

Inherits:
Object
  • Object
show all
Includes:
AwsSingularResourceMixin
Defined in:
lib/resources/aws/aws_config_recorder.rb

Defined Under Namespace

Classes: Backend

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AwsSingularResourceMixin

#exists?, included

Methods included from AwsResourceMixin

#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner

Instance Attribute Details

#recorder_nameObject (readonly)

Returns the value of attribute recorder_name.



15
16
17
# File 'lib/resources/aws/aws_config_recorder.rb', line 15

def recorder_name
  @recorder_name
end

#resource_typesObject (readonly)

Returns the value of attribute resource_types.



15
16
17
# File 'lib/resources/aws/aws_config_recorder.rb', line 15

def resource_types
  @resource_types
end

#role_arnObject (readonly)

Returns the value of attribute role_arn.



15
16
17
# File 'lib/resources/aws/aws_config_recorder.rb', line 15

def role_arn
  @role_arn
end

Instance Method Details

#recording?Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/resources/aws/aws_config_recorder.rb', line 38

def recording?
  return unless @exists
  status[:recording]
end

#recording_all_global_types?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/resources/aws/aws_config_recorder.rb', line 25

def recording_all_global_types?
  @recording_all_global_types
end

#recording_all_resource_types?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/resources/aws/aws_config_recorder.rb', line 21

def recording_all_resource_types?
  @recording_all_resource_types
end

#statusObject



29
30
31
32
33
34
35
36
# File 'lib/resources/aws/aws_config_recorder.rb', line 29

def status
  return {} unless @exists
  backend = BackendFactory.create(inspec_runner)
  catch_aws_errors do
    response = backend.describe_configuration_recorder_status(configuration_recorder_names: [@recorder_name])
    @status = response.configuration_recorders_status.first.to_h
  end
end

#to_sObject



17
18
19
# File 'lib/resources/aws/aws_config_recorder.rb', line 17

def to_s
  "Configuration_Recorder: #{@recorder_name}"
end