Class: AwsBillingReports
Defined Under Namespace
Classes: Backend
Instance Attribute Summary
#table
Instance Method Summary
collapse
included
#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner
Instance Method Details
#fetch_from_api ⇒ Object
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# File 'lib/resources/aws/aws_billing_reports.rb', line 48
def fetch_from_api
@table = []
= {}
backend = BackendFactory.create(inspec_runner)
loop do
api_result = backend.describe_report_definitions()
api_result.report_definitions.each do |raw_report|
report = raw_report.to_h
%i{time_unit compression}.each { |field| report[field].downcase! }
@table << report
end
= { next_token: api_result.next_token }
break unless api_result.next_token
end
end
|
#to_s ⇒ Object
44
45
46
|
# File 'lib/resources/aws/aws_billing_reports.rb', line 44
def to_s
"AWS Billing Reports"
end
|
#validate_params(resource_params) ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/resources/aws/aws_billing_reports.rb', line 36
def validate_params(resource_params)
unless resource_params.empty?
raise ArgumentError, "aws_billing_reports does not accept resource parameters."
end
resource_params
end
|