[Terraform] Bug with cloning app repo to be used for deployment

This is my terrafrom root module

module "qovery_app" {

  source = "./modules/qovery/app-docker"

  app_name = "sample-app"

  git_url = "git@github.com:Non-Fungible-Labs/qovery-sample-app.git"

  branch = "develop"

  min_running_instances = 1

  max_running_instances = 1

  qovery_environment_id = var.qovery_environment_id

  auto_preview = "true"

  qovery_token = var.qovery_token

}

This is thr resource in my child module

resource "qovery_application" "docker_application" {
  environment_id = var.qovery_environment_id
  name           = var.app_name
  git_repository = {
    url       = var.git_url
    branch    = var.branch    # Optional
    root_path = var.root_path # Optional
  }

  build_mode            = var.docker_build_mode
  dockerfile_path       = var.dockerfile_path
  state                 = var.state
  auto_preview          = var.auto_preview
  cpu                   = var.cpu
  memory                = var.memory
  min_running_instances = var.min_running_instances
  max_running_instances = var.max_running_instances
}

now this is the error that i get when i run a terraform apply

Error: Error on application create
│ 
│   with module.qovery_app.qovery_application.docker_application,
│   on modules/qovery/app-docker/app.tf line 1, in resource "qovery_application" "docker_application":
│    1: resource "qovery_application" "docker_application" {
│ 
│ Could not create application 'sample-app', unexpected error: 400 Bad
│ Request - Invalid git repository url: Only support for GITHUB, GITLAB,
│ BITBUCKET
╵
Operation failed: failed running terraform apply (exit 1)

Hi @dugwa ,

Can you use https://github.com/Non-Fungible-Labs/qovery-sample-app.git instead?

It should better work.

switching to https worked

thanks @rophilogene

but i am not getting a different error

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to
│ module.qovery_app.qovery_application.docker_application, provider
│ "module.qovery_app.provider[\"registry.terraform.io/qovery/qovery\"]"
│ produced an unexpected new value: .auto_preview: was cty.True, but now
│ cty.False.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
Operation failed: failed running terraform apply (exit 1)

turned of auto_preview and it works

1 Like

Well done :+1: - We should definitely share more Terraform examples. cc @a_carrano @Anouck_Colson