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.



19
20
21
# File 'lib/resources/aws/aws_config_recorder.rb', line 19

def recorder_name
  @recorder_name
end

#resource_typesObject (readonly)

Returns the value of attribute resource_types.



19
20
21
# File 'lib/resources/aws/aws_config_recorder.rb', line 19

def resource_types
  @resource_types
end

#role_arnObject (readonly)

Returns the value of attribute role_arn.



19
20
21
# File 'lib/resources/aws/aws_config_recorder.rb', line 19

def role_arn
  @role_arn
end

Instance Method Details

#recording?Boolean

Returns:

  • (Boolean)


43
44
45
46
47
# File 'lib/resources/aws/aws_config_recorder.rb', line 43

def recording?
  return unless @exists

  status[:recording]
end

#recording_all_global_types?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/resources/aws/aws_config_recorder.rb', line 29

def recording_all_global_types?
  @recording_all_global_types
end

#recording_all_resource_types?Boolean

Returns:

  • (Boolean)


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

def recording_all_resource_types?
  @recording_all_resource_types
end

#statusObject



33
34
35
36
37
38
39
40
41
# File 'lib/resources/aws/aws_config_recorder.rb', line 33

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



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

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