Giter Club home page Giter Club logo

love-psychology-terraform's Introduction

love-psychology-terraform

以下のWebサービスのインフラを管理します。

ステージング環境と本番環境でそれぞれ別々のAWSアカウントを利用する想定です。

事前準備

tfstate 保存用のS3バケットを作成

tfstate をS3バケットに保存します。

これらのS3バケットを事前に作成しておきます。

  • stg-love-psychology-tfstate
  • prod-love-psychology-tfstate

AWSのクレデンシャルをプロファイル付きで設定

~/.aws/credentials を以下のように設定します。

[love-psychology-stg]
aws_access_key_id = アクセスキーID
aws_secret_access_key = アクセスキーシークレット

[love-psychology-prod]
aws_access_key_id = アクセスキーID
aws_secret_access_key = アクセスキーシークレット

これらのプロファイル情報をTerraformが参照します。

Terraformは様々なAWSリソースを作成します。

よってアクセス権を絞るのは非常に難しいと思うので AdministratorAccess を与えるのが無難だと思います。

初期設定

docker-compose up -d でTerraformのコンテナを立ち上げます。

Terraformの初期化を行います。以下の手順で初期化スクリプトを実行して下さい。

chmod 755 terraform-init-stg.sh
docker-compose exec terraform ./terraform-init-stg.sh

docker-compose exec terraform sh でコンテナの中に入ります。

以降、Terraformの実行はコンテナの中で行います。

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.