2019/06/23に見た記事等を雑に分類するだけ

  • Docker
  • CircleCI
    • AWS ECR/ECS へのデプロイ - CircleCI

      • Debian GNU/Linux 9 (stretch)でTerraform(0.12.2)をインストールし、terraform init時に次のエラーが発生
        • $ terraform init Initializing the backend... Initializing provider plugins... - Checking for available provider plugins... Provider "aws" v1.60.0 is not compatible with Terraform 0.12.2. Provider version 2.7.0 is the earliest compatible version. Select it with the following version constraint: version = "~> 2.7" Terraform checked all of the plugin versions matching the given constraint: ~> 1.35 Consult the documentation for this provider for more information on compatibility between provider and Terraform versions. Error: incompatible provider version
      • 【2019/06/26 追記】改めて実行したところ、次の対応(打消線部分)は不要だった
      • 次のAWSプロバイダのバイナリファイル(terraform-provider-aws_1.60.0_linux_amd64.zip)を解凍し ~/.terraform.d/plugins に置くと解消した。
        • terraform-provider-aws v1.60.0 Binaries | HashiCorp Releases
        • $ terraform init Initializing the backend... Initializing provider plugins... Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see any changes that are required for your infrastructure. All Terraform commands should now work. If you ever set or change modules or backend configuration for Terraform, rerun this command to reinitialize your working directory. If you forget, other commands will detect it and remind you to do so if necessary.
      • 引き続きterraform planを実行すると次のエラーが発生
        • $ terraform plan Error: Failed to instantiate provider "aws" to obtain schema: Incompatible API version with plugin. Plugin version: 4, Client versions: [5]
      • circleci-demo-aws-ecs-ecr/terraform_setup/terraform.tfの5行目「version = "~> 1.35"」を「version = "~> 2.7"」に変更し、terraform init, terraform planを実行すると次のエラーが発生
        • Error: Unsupported block type on terraform.tf line 30, in resource "aws_cloudformation_stack" "vpc": 30: parameters { Blocks of type "parameters" are not expected here. Did you mean to define argument "parameters"? If so, use the equals sign to assign it a value.
      • circleci-demo-aws-ecs-ecr/terraform_setup/terraform.tfの30行目、42行目の "parameters {" を "parameters = {" に修正し、terraform planを実行すると解消した
  • Terraform