Class: Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_recon/lib/formatter.rb

Overview

Customize resource format/shape

Instance Method Summary collapse

Instance Method Details

#aws(account_id, region, service, resource) ⇒ Object

Standard AWS



23
24
25
26
27
28
29
30
31
# File 'lib/aws_recon/lib/formatter.rb', line 23

def aws(, region, service, resource)
  {
    account: ,
    service: service.name,
    region: region,
    resource: resource,
    timestamp: Time.now.utc
  }
end

#custom(account_id, region, service, resource) ⇒ Object

Custom



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/aws_recon/lib/formatter.rb', line 8

def custom(, region, service, resource)
  {
    account: ,
    name: resource[:arn],
    service: service.name,
    region: region,
    asset_type: resource[:type],
    resource: { data: resource, version: 'v1' },
    timestamp: Time.now.utc
  }
end