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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "VPC Bestpractice Template For MonstarLab,Inc.", | |
"Parameters": { | |
"SSHLocation" : { | |
"Description" : " The IP address range that can be used to SSH to the EC2 instances", | |
"Type": "String", | |
"MinLength": "9", | |
"MaxLength": "18", | |
"Default": "0.0.0.0/0", |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"vpc80ef6be5": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.0.0.0/16", | |
"InstanceTenancy": "default", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "false", |
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
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require': /Library/Ruby/Gems/2) | |
... def has_listener?(protocol:, port:, instance_protocol:, i... | |
... ^ | |
/Library/Ruby/Gems/2.0.0/gems/awspec-0.14.0/lib/awspec/type/elb.rb:60: syntax error, unexpected keyword_end, expecting end-of-input | |
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require' | |
from /Library/Ruby/Gems/2.0.0/gems/awspec-0.14.0/lib/awspec/helper/type.rb:12:in `block in <module:Type>' | |
from /Library/Ruby/Gems/2.0.0/gems/awspec-0.14.0/lib/awspec/helper/type.rb:11:in `each' | |
from /Library/Ruby/Gems/2.0.0/gems/awspec-0.14.0/lib/awspec/helper/type.rb:11:in `<module:Type>' | |
from /Library/Ruby/Gems/2.0.0/gems/awspec-0.14.0/lib/awspec/helper/type.rb:3:in `<module:Helper>' | |
from /Library/Ruby/Gems/2.0.0/gems/awspec-0.14.0/lib/awspec/helper/type.rb:2:in `<module:Awspec>' |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"vpce17ecf84": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.0.0.0/16", | |
"InstanceTenancy": "default", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "false", |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"vpcf84de09d": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.0.0.0/16", | |
"InstanceTenancy": "default", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "true", |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"vpc84b012e1": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.0.0.0/16", | |
"InstanceTenancy": "default", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "false", |
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
#!/bin/sh | |
DATE_CURRENT=`date +%Y-%m-%d` | |
TIME_CURRENT=`date +%Y%m%d%H%M%S` | |
PURGE_AFTER_DAYS=10 | |
PURGE_AFTER=`date -d +${PURGE_AFTER_DAYS}days -u +%Y-%m-%d` | |
# 1-1.バックアップを作成したいリソース一覧を取得する | |
INSTANCES=`aws ec2 describe-tags --filters "Name=resource-type,Values=instance" "Name=key,Values=Backup" | awk '{print $3}'` | |
for INSTANCE in ${INSTANCES}; do |
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
## xcodeインストール | |
xcode-select --install | |
## Homebrew install | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
## brew doctor | |
brew doctor | |
## brew update |
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
--- | |
- hosts: all | |
sudo: yes | |
tasks: | |
- name: add a new user | |
user: name=takayuki | |
- name: insdtall libselinux-python | |
yum: name=libselinux-python state=latest | |
- hosts: web |
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
#!/bin/sh | |
DEFAULT_REGION='ap-northeast-1' | |
INSTANCE_ID='i-xxxxxxxx' | |
echo "" | |
echo "instance-id:["$INSTANCE_ID"]" | |
## 指定インスタンスのステータス確認(aws ec2 describe-instance-status) | |
INSTANCE_STATUS=`aws ec2 describe-instance-status --instance-ids $INSTANCE_ID --region $DEFAULT_REGION | jq -r '.InstanceStatuses[].InstanceState.Name'` | |
echo "instance-status:["$INSTANCE_STATUS"]" |