https://github.com/pei0804/terraform-template
https://github.com/pei0804/terraform-template
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pei0804/terraform-template
- Owner: pei0804
- License: mit
- Created: 2020-05-10T02:13:53.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-22T09:12:17.000Z (about 6 years ago)
- Last Synced: 2026-03-27T23:42:36.751Z (3 months ago)
- Language: Makefile
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Getting Started
tfstateを置くバケットを作成します(既存のものがあればやらなくてもOK)
CLIで作る場合は、お好みのバージョンを使ってください。
筆者はPCに入ってたCLIでバケットを作成しました。
```
❯ aws --version
aws-cli/1.18.56 Python/3.7.0 Darwin/17.7.0 botocore/1.16.6
❯ aws s3api create-bucket --bucket pei-sandbox-tfstate --create-bucket-configuration LocationConstraint=ap-northeast-1
{
"Location": "http://pei-sandbox-tfstate.s3.amazonaws.com/"
}
```
[Makefileのパラメーターをいじる](./Makefile)
作成したバケット名に変更する
```
TFSTATE_BUCKET := pei-sandbox-tfstate
```
プロファイルを設定してください。 `~/.aws/config`
私の場合は、peiというプロファイルを作成していたので、`pei`とします。
```
AWS_PROFILE := pei
```
特にプロファイルの設定をしてない場合はdefaultで動きます
```
AWS_PROFILE := default
```
設定を適用
```
❯ make plan SCOPE=example/ #良さそうならapplyもしよう
❯ make apply SCOPE=example/
```