Skip to content

Instantly share code, notes, and snippets.

@fmasuhr
Last active April 10, 2019 09:36
Show Gist options
  • Save fmasuhr/e4b281b1860dda147ac3 to your computer and use it in GitHub Desktop.
Save fmasuhr/e4b281b1860dda147ac3 to your computer and use it in GitHub Desktop.
Get Node.js configuration for OpsWorks stacks
require 'aws-sdk-opsworks'
client = Aws::OpsWorks::Client.new(region: 'us-east-1')
stacks = client.describe_stacks.stacks
stacks.each do |stack|
custom_json = JSON.parse(stack.custom_json)
next unless custom_json['nodejs']
puts <<-END_OF_STRING
#{stack.name}
https://console.aws.amazon.com/opsworks/home#/stack/#{stack.stack_id}
Node.js version: #{custom_json['nodejs']['version']}
npm version: #{custom_json['nodejs']['npm']}
END_OF_STRING
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment