This file contains hidden or 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
#md64.json -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu-14.04-amd64" | |
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box" | |
config.vm.provision "chef_client" do |chef| | |
chef.chef_server_url = "https://api.chef.io/organizations/mydemoorg" | |
chef.validation_key_path = "/Users/me/Google Drive/Chef/My Demo Org/chef-repo/.chef/mydemoorg-validator.pem" | |
chef.validation_client_name = "mydemoorg-validator" |
This file contains hidden or 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
import boto3 | |
from datetime import datetime | |
iam_client = boto3.client('iam') | |
iam_resource = boto3.resource('iam') | |
def get_UsersOlderThan(days): | |
''' Returns list of users whose PasswordLastUsed | |
is greater than <days> ago. |
This file contains hidden or 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
# This will shut down all instances in all regions at 17:30 | |
import boto3.ec2 | |
from datetime import datetime | |
import time | |
region_list = [] | |
if __name__ == "__main__": |
This file contains hidden or 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
import boto3 | |
region_list = ['us-west-1', 'us-west-2'] | |
for region in region_list: | |
print 'REGION:', region | |
ec2 = boto3.resource('ec2', region) | |
for instance in ec2.instances.all(): | |
print ' instance:', instance | |
ec2tags = instance.tags |