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
#強制的にIAMユーザーのパスワードを変更する方法 | |
iam = AWS::IAM.new | |
u = iam.users['password-test'] | |
u.login_profile.password = 'fooBar#' | |
puts u |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "*", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Deny", |
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
/Users/komuro/.rbenv/versions/2.1.1/lib/ruby/2.1.0/net/http.rb:879:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError) | |
#上記エラーが出ていてなんだろなーと思っていたらAWS.config内に:region指定を入れていたのが原因だった。サポートにはリージョンという概念がないので、:regionを外したらエラー出なくなった |
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 File.expand_path('./credential.rb', File.dirname(__FILE__)) | |
iam = AWS::IAM.new | |
user_name = "student" | |
group_name = "#{user_name}-group" | |
=begin | |
summary = iam.account_summary | |
puts "Num users: #{summary[:users]}" |
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 File.expand_path('./credential.rb', File.dirname(__FILE__)) | |
require 'json' | |
require 'csv' | |
user_name = "student" | |
group_name = "#{user_name}-group" | |
iam = AWS::IAM.new | |
account_alias = iam.account_alias | |
signin_link = "https://#{account_alias}.signin.aws.amazon.com/console" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "*", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Deny", |
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
# -*- encoding: utf-8 -*- | |
require 'aws-sdk' | |
AWS.config({ | |
:access_key_id => '', | |
:secret_access_key => '' | |
} | |
) | |
ec2 = AWS::EC2::new |
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
# -*- encoding: utf-8 -*- | |
require 'rss' | |
require 'json' | |
rss_array = Array.new | |
alsa = 'http://aws.amazon.com/rss/amazon-linux-ami.rss' | |
rss = RSS::Parser.parse(alsa) | |
rss_array = ["description", "link", "title"] | |
rss.items.each do |item| | |
rss_array.push(item.description, item.link, item.title) |
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
# -*- encoding: utf-8 -*- | |
require 'aws-sdk' | |
AWS.config({ | |
:access_key_id => '', | |
:secret_access_key => '' | |
}) | |
support = AWS::Support.new | |
support.client.describe_cases(:language => 'ja', :include_resolved_cases => true).cases.each do | ca | |
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
r53 = AWS::Route53.new | |
r53.hosted_zones.each do | zone | | |
puts "Delete Host zone: #{zone.name}" | |
zone.resource_record_sets.each do | record | | |
if !record.type.include?("NS") and !record.type.include?("SOA") | |
puts "- Record: #{record.name} - #{record.type}" | |
record.delete | |
end | |
end |
OlderNewer