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
#!/bin/sh | |
## EC2 confiration | |
export JAVA_HOME="Set your java home path" | |
export EC2_HOME="Set your ec2 home path" | |
export EC2_PRIVATE_KEY="Set your aws private-key" | |
export EC2_CERT="Set your your X509-cert" | |
export EC2_URL="Set using ec2 url" | |
export EC2_REGION="Set using ec2 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
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
access_key = 'set your access key' | |
secret_key = 'set your secret key' | |
sqs_region = 'sqs.ap-northeast-1.amazonaws.com' | |
queue_name = 'okochang_que' | |
sqs = AWS::SQS.new( | |
:access_key => access_key, | |
:secret_key => secret_key, |
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
import boto3 | |
import datetime | |
import json | |
config = boto3.client("config") | |
ec2 = boto3.client("ec2") | |
def evaluate_flowlog(vpc_id): | |
response = ec2.describe_flow_logs( | |
Filter=[ |
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
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
# ACCESS_KEYとSECRET_KEYを定義します | |
ACCESS_KEY = 'YOUR_ACCESS_KEY' | |
SECRET_KEY = 'YOUR_SECRET_KEY' | |
# 送信メールの本文を作成します | |
body = 'Sample email attaching file.' | |
# ファイルを読み込みbase64フォーマットにエンコードします |
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
# -*- coding: utf-8 -*- | |
## EC2インスタスを起動するまでの流れで、スクリプトではないので注意して下さい | |
require 'aws-sdk' | |
ACCESS_KEY = 'set your access key id' | |
SECRET_KEY = 'set your secret key' | |
EC2_REGION = 'ec2.ap-southeast-1.amazonaws.com' | |
ec2 = AWS::EC2.new( | |
:access_key_id => ACCESS_KEY, | |
:secret_access_key => SECRET_KEY, |
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": [ | |
"logs:CreateLogGroup", | |
"logs:CreateLogStream", | |
"logs:PutLogEvents", | |
"config:PutEvaluations", |
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
# -*- coding: utf-8 -*- | |
require 'net/http' | |
require 'aws-sdk' | |
instance_id = Net::HTTP.get('169.254.169.254', '/latest/meta-data/instance-id') | |
ec2_region = 'ec2.' + Net::HTTP.get('169.254.169.254', '/latest/meta-data/placement/availability-zone').chop + '.amazonaws.com' | |
image_name = instance_id + '-' + Time.now.strftime("%Y%m%d%H%M") | |
comment = "automatically generated image" | |
@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
# -*- coding: utf-8 -*- | |
## AWS SDK for Rubyで各サービスのリージョンを指定する方法一覧 | |
AWS.config( | |
:access_key_id => 'set_your_access_key_id', | |
:secret_access_key => 'set_your_secret_key', | |
:auto_scaling_endpoint => 'autoscaling.ap-northeast-1.amazonaws.com', | |
:cloud_formation_endpoint => 'cloudformation.ap-northeast-1.amazonaws.com', | |
:cloud_front_endpoint => 'cloudfront.amazonaws.com', |
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
# -*- coding: utf-8 -*- | |
require 'aws-sdk' | |
ACCESS_KEY = 'set your access key' | |
SECRET_KEY = 'set your secret key' | |
support = AWS::Support.new( | |
:access_key_id => ACCESS_KEY, | |
:secret_access_key => SECRET_KEY, | |
).client |
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
# -*- coding: utf-8 -*- | |
## AWSのIAM用APIを使ってみたログであり、スクリプトではありません。 | |
require 'aws-sdk' | |
ACCESS_KEY = 'set your access key' | |
SECRET_KEY = 'set your secret key' | |
alias_name = 'okochang' | |
user_name = 'yanase' | |
user_policy_name = 'admin_user_policy' | |
user_policy = '{"Statement":[{"Effect":"Deny","Action":["support:*"],"Resource":"*"},{"Effect":"Allow","Action":"*","Resource":"*"}]}' | |
group_name = 'administrator' |
NewerOlder