Closed5

既存 terraform をいじる

tkttkt
docker-compose.yml
version: "3.7"
services:
  terraform:
    image: hashicorp/terraform:0.12.21
    working_dir: /src
    entrypoint: ["/bin/sh", "-c"]
    environment:
      AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
      AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
      AWS_DEFAULT_REGION: ap-northeast-1
    volumes:
      - .:/src

これ置いて、

$ docker-compose run --rm terraform /bin/sh

実行して、

terraform apply
Backend reinitialization required. Please run "terraform init".
Reason: Initial configuration of the requested backend "s3"

The "backend" is the interface that Terraform uses to store state,
perform operations, etc. If this message is showing up, it means that the
Terraform configuration you're using is using a custom configuration for
the Terraform backend.

Changes to backend configurations require reinitialization. This allows
Terraform to setup the new configuration, copy existing state, etc. This is
only done during "terraform init". Please run that command now then try again.

If the change reason above is incorrect, please verify your configuration
hasn't changed and try again. At this point, no changes to your existing
configuration or state have been made.


Error: Initialization required. Please see the error message above.

怒られた

tkttkt

既存のいじる時も init いるんかな

tkttkt

バージョン指定の方法考えないとだけれど

このスクラップは2021/01/14にクローズされました