aptible / terraform-provider-aptible

The official Terraform provider for Aptible Deploy
https://registry.terraform.io/providers/aptible/aptible/latest
10 stars 13 forks source link

Operation Failure Deploying New App Resource #44

Closed derylseale closed 3 years ago

derylseale commented 3 years ago

I'm trying to deploy a new app resource, which is a docker image stored in an AWS ECR repository. The configuration is roughly this:

data "aws_ecr_authorization_token" "token" {}

resource "aptible_app" "service-app" {
  env_id = data.aptible_environment.env.env_id
  handle = "${var.service_name}-app-${var.resource_suffix}"

  service {
    process_type           = "cmd"
    container_count        = 1
    container_memory_limit = 512
  }

  config = {
    "APTIBLE_DOCKER_IMAGE"              = "${var.image_repository}/${var.image_name}:${var.image_tag}"
    "APTIBLE_PRIVATE_REGISTRY_USERNAME" = data.aws_ecr_authorization_token.token.user_name
    "APTIBLE_PRIVATE_REGISTRY_PASSWORD" = data.aws_ecr_authorization_token.token.password
    ... other config here ...
  }
}

When I run Terraform, it fails with the message "operation failed for op id: 12345678" but with no other information. I also cannot find any other way to get details about the failed operation.

When I look at the dashboard, I see that an app is there in a pending state but without any deployment, as if I had just created it manually. When I run aptible config I don't see any configuration for that application. If I run Terraform again, it destroys the app and then tries to recreate it (ultimately failing).

Is there something else I need to do to create this resource?

robertfairhead commented 3 years ago

I believe the specific issue with your deployment was discussed with our support team. Terraform's behavior here is as expected during its reconciliation process. If you do experience further unexpected operation failures, our customer support is the best place to raise them because they are best placed to investigate and get you a timely response.

We are investigating our options for providing more detailed information on the operations created by Terraform. Terraform by default will not pass them through even if we enable additional logging in our provider. So, we are looking at other options such as sending the logs to configured Log Drains on your account so that you can review them there. There isn't a specific timeline on that work, given it is still early in the discovery phase.