Terraform Destroy Error при подключении к TFE - PullRequest
0 голосов
/ 02 апреля 2019

Я создал рабочую область в Terraform Enterprise, запустив локально план terraform init && terraform, и Terraform enterprise настроен как мой бэкэнд:

    # Using a single workspace:
    terraform {
     backend "remote" {
      hostname = "dep.app.example.io"
      organization = "nnnn"

      workspaces {
       name = "create-workspace"
      }
     }
    }

Terraform Apply работает, и я могу запустить ec2 черезTerraform Enterprise с этим кодом:

    provider "aws" {
     region = "${var.region}"
    }

    resource "aws_instance" "feature" {
     count = 1
     ami = "${var.ami}"
     availability_zone = "${var.availability_zone}"
     instance_type = "${var.instance_type}"
     tags = {
      Name = "${var.name_tag}"
     }
    }

Теперь, когда я запускаю уничтожение terraform, я получаю эту ошибку:

    Error: error creating run: Invalid Attribute Infrastructure is 
    not destroyable

    The configured "remote" backend encountered an unexpected 
    error. Sometimes this is caused by network connection problems, 
    in which case you could retry the command. If the issue 
    persists please open a support ticket to get help resolving the 
    problem.

Что я здесь не так делаю?Я хочу иметь возможность запускать уничтожение Terraform, которое разрушает инфраструктуру, в которой разворачивается мое новое рабочее пространство Terraform Enterprise.

РЕДАКТИРОВАТЬ: ЛОГИ:

2019/04/03 09:11:54 [INFO] Terraform version: 0.11.11  ac4fff416318bf0915a0ab80e062a99ef3724334
2019/04/03 09:11:54 [INFO] Go runtime version: go1.11.1
2019/04/03 09:11:54 [INFO] CLI args: []string{"/usr/local/bin/terraform", "destroy"}
2019/04/03 09:11:54 [DEBUG] Attempting to open CLI config file: /Users/nlegorrec/.terraformrc
2019/04/03 09:11:54 Loading CLI configuration from /Users/nlegorrec/.terraformrc
2019/04/03 09:11:54 [INFO] CLI command args: []string{"destroy"}
2019/04/03 09:11:54 [TRACE] Preserving existing state lineage "f7abdc54-236c-c906-e701-049f3e2cc00c"
2019/04/03 09:11:54 [TRACE] Preserving existing state lineage "f7abdc54-236c-c906-e701-049f3e2cc00c"
2019/04/03 09:11:54 [DEBUG] Service discovery for dep.app.redbull.com at https://dep.app.redbull.com/.well-known/terraform.json
2019/04/03 09:11:56 [DEBUG] Retrieve version constraints for service tfe.v2 and product terraform
2019/04/03 09:11:57 [INFO] command: backend initialized: *remote.Remote
2019/04/03 09:11:57 [DEBUG] checking for provider in "."
2019/04/03 09:11:57 [DEBUG] checking for provider in "/usr/local/bin"
2019/04/03 09:11:57 [DEBUG] checking for provider in ".terraform/plugins/darwin_amd64"
2019/04/03 09:11:57 [DEBUG] found provider "terraform-provider-aws_v2.4.0_x4"
2019/04/03 09:11:57 [DEBUG] found valid plugin: "aws", "2.4.0", "/Users/nlegorrec/dev/Software Engineering/emp-kpi-tracker_web/dep/.terraform/plugins/darwin_amd64/terraform-provider-aws_v2.4.0_x4"
2019/04/03 09:11:57 [DEBUG] checking for provisioner in "."
2019/04/03 09:11:57 [DEBUG] checking for provisioner in "/usr/local/bin"
2019/04/03 09:11:57 [DEBUG] checking for provisioner in ".terraform/plugins/darwin_amd64"
2019/04/03 09:11:57 [INFO] backend/remote: starting Apply operation

2019/04/03 09:12:00 [DEBUG] plugin: waiting for all plugin processes to complete...
Error: error creating run: Invalid Attribute Infrastructure is not destroyable

The configured "remote" backend encountered an unexpected error. Sometimes
this is caused by network connection problems, in which case you could retry
the command. If the issue persists please open a support ticket to get help
resolving the problem.
...