Sha256: 914d865c38d426e559a3434cb0aca88060adea00b31d830f2650b19a1b20f4cb

Contents?: true

Size: 660 Bytes

Versions: 7

Compression:

Stored size: 660 Bytes

Contents

#
# Customize resource format/shape
#
class Formatter
  #
  # Custom
  #
  def custom(account_id, region, service, resource)
    {
      account: account_id,
      name: resource[:arn] || "#{account_id}_#{region}_#{service.name}_#{resource[:type]}",
      service: service.name,
      region: region,
      asset_type: resource[:type],
      resource: { data: resource, version: 'v1' },
      timestamp: Time.now.utc
    }
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
aws_recon-0.2.7 lib/aws_recon/lib/formatter.rb
aws_recon-0.2.6 lib/aws_recon/lib/formatter.rb
aws_recon-0.2.5 lib/aws_recon/lib/formatter.rb
aws_recon-0.2.4 lib/aws_recon/lib/formatter.rb
aws_recon-0.2.3 lib/aws_recon/lib/formatter.rb
aws_recon-0.2.2 lib/aws_recon/lib/formatter.rb
aws_recon-0.2.1 lib/aws_recon/lib/formatter.rb