Skip to content

Commit

Permalink
Collect more SageMaker details
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlarsen committed Dec 22, 2020
1 parent 5e21fdf commit 1835e93
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion lib/aws_recon/collectors/sagemaker.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# frozen_string_literal: true

#
# Collect SageMaker Resources
#
class SageMaker < Mapper
#
# Returns an array of resources.
Expand All @@ -12,14 +17,33 @@ def collect
log(response.context.operation_name, page)

response.notebook_instances.each do |instance|
struct = OpenStruct.new(instance.to_h)
struct = OpenStruct.new(@client.describe_notebook_instance({
notebook_instance_name: instance.notebook_instance_name
}).to_h)
struct.type = 'notebook_instance'
struct.arn = instance.notebook_instance_arn

resources.push(struct.to_h)
end
end

#
# list_endpoints
#
@client.list_endpoints.each_with_index do |response, page|
log(response.context.operation_name, page)

response.endpoints.each do |instance|
struct = OpenStruct.new(@client.describe_endpoint({
endpoint_name: instance.endpoint_name
}).to_h)
struct.type = 'endpoint'
struct.arn = instance.endpoint_arn

resources.push(struct.to_h)
end
end

resources
end
end

0 comments on commit 1835e93

Please sign in to comment.