Created
January 30, 2015 09:54
-
-
Save mryoshio/a242ff9852922b0f016c to your computer and use it in GitHub Desktop.
update OpsWorks Layers' enable_auto_healing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
TO=false | |
def main | |
client = AWS::OpsWorks::Client.new(region: 'us-east-1') | |
client.describe_stacks[:stacks].each do |s| | |
puts "## #{s[:stack_id]}: #{s[:name]}" | |
puts "##### [begin] at #{Time.now}" | |
client.describe_layers(stack_id: s[:stack_id])[:layers].each do |l| | |
client.update_layer(layer_id: l[:layer_id], enable_auto_healing: TO) | |
print "- #{l[:name]}(#{l[:layer_id]}): " | |
puts "#{l[:enable_auto_healing]} to #{TO}" | |
end | |
puts "##### [finished] at #{Time.now}" | |
end | |
end | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment