Giter Site home page Giter Site logo

terraform-network's Introduction

init

  1. AWSのマネジメントコンソールで、tfstate用のbucketを作成。

  2. 設定ファイルの作成

$ cp config.tf.sample config.tf
$ cp terraform.tfvars.sample terraform.tfvars.tf

=> 自分の環境に合うように書き換えてください。(上で作成したbucketなど)

1-1.webコンソールでアクセスキー、シークレットキーありのユーザを作成。

環境変数で設定

$ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
$ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
$ export AWS_DEFAULT_REGION=ap-northeast-1

1-2.アクセスキーとシークレットキーを.aws/credentialsに保存。pipでawscliをインストール

.aws/credentials

aws_access_key_id = 控えたアクセスキー
aws_secret_access_key = 控えたシークレットアクセスキー
$pip install awscli

1-3.Dockerの場合

$ docker build -t terraform:latest .
$ docker run --it terraform bash
(# source ~/.bash_profile)
# tfenv install <version>
# cd <tfファイルのあるディレクトリ>
# terraform init

2-5 CircleCIのenvrionmentに設定

  • AWS_ACCESS_KEY_ID: outputされたアクセスキー
  • AWS_SECRET_ACCESS_KEY: outputされたシークレットキーを復号化したもの

3 実行

common: リージョンごとのVPC、セキュリティグループ env: 各環境ごとのsubnet

より、

common => env の順で実行する。

各カレントディレクトリで

$ terraform init
($ terraform plan)
$ terraform apply

terraform-network's People

Contributors

mormorbump avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

graffity-x

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.