Giter Site home page Giter Site logo

cloudformation_troposphere's Introduction

環境構築

cloudformation実行用インスタンス

  • Amazon Linux AMI 2014.09.1 (HVM) - ami-4985b048
sudo yum update
sudo yum install git jq
sudo pip install jmespath-terminal

curl -kL https://raw.github.com/pypa/pip/master/contrib/get-pip.py | sudo python
sudo pip install virtualenv virtualenvwrapper
sudo pip install autoenv

vi ~/.bashrc
# User specific aliases and functions
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/Devel
source `which virtualenvwrapper.sh`
source `which activate.sh`

git clone [email protected]:twingo-b/cloudformation_troposphere.git
cd cloudformation_troposphere
pip install -r requirements.txt

NATインスタンスのAMI確認

export AWS_DEFAULT_REGION='ap-northeast-1'
aws ec2 describe-images --owners amazon > describe-images.json
# jmespath-terminal でquery作成
jpterm describe-images.json

aws ec2 describe-images --owners amazon --query 'Images[?starts_with(to_string(Name),`amzn-ami-vpc-nat-hvm`) == `true`].{Name:Name,ImageId:ImageId}' | jq .
[
  {
    "Name": "amzn-ami-vpc-nat-hvm-2014.09.1.x86_64-gp2",
    "ImageId": "ami-27d6e626"
  },
  {
    "Name": "amzn-ami-vpc-nat-hvm-2014.03.2.x86_64-gp2",
    "ImageId": "ami-49c29e48"
  },
  {
    "Name": "amzn-ami-vpc-nat-hvm-2014.03.2.x86_64-ebs",
    "ImageId": "ami-55c29e54"
  }
]

NATインスタンスのkey作成

aws ec2 create-key-pair --key-name gameday

CloudFormation起動と停止

起動

python gen-vpc-with-public-and-private-subnets.py > $HOME/gen-vpc-with-public-and-private-subnets.json
export AWS_DEFAULT_REGION='ap-northeast-1'
aws cloudformation create-stack --stack-name gameday --template-body file:////home//ec2-user//gen-vpc-with-public-and-private-subnets.json
{
    "StackId": "arn:aws:cloudformation:ap-northeast-1:<account_num>:stack/gameday/9e210a00-7ddc-11e4-a549-5088487c4896"
}

停止

aws cloudformation delete-stack --stack-name gameday

TODO

  • cf2py検証

参考

troposphere

pip,virtualenv,autoenv

aws-cli

cloudformation_troposphere's People

Contributors

twingo-b avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.