fluxcd / terraform-provider-flux

Terraform and OpenTofu provider for bootstrapping Flux

Home Page:https://registry.terraform.io/providers/fluxcd/flux/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Value Conversion Error - can't handle unknown value type

qlemaire-dvt opened this issue · comments

Please note that i'm not very proficient in terraform so it might very well be an error from my part

provider version = ">= 1.1.1"

So i'm trying to make the installation of flux modulable in my terraform script, and I got this error :

│ Error: Value Conversion Error
│
│   with provider["registry.terraform.io/fluxcd/flux"],
│   on provider.tf line 65, in provider "flux":
│   65: provider "flux" {
│
│ An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the provider developer:
│
│ Received unknown value, however the target type cannot handle unknown values. Use the corresponding `types` package type or a custom type that handles unknown values.
│
│ Path: git.ssh
│ Target Type: *provider.Ssh
│ Suggested Type: basetypes.ObjectValue

The lines throwing the error are the following : ( git.ssh )

provider "flux" {
  kubernetes = {
    host                   = module.eks.cluster_endpoint
    cluster_ca_certificate = base64decode(module.eks.cluster_certificate_authority_data)
    token                  = data.aws_eks_cluster_auth.this.token
  }
  git = {
    url = var.enable_gitops ? "ssh://git@gitlab.example.com/${module.gitops[0].gitops_repo_path}.git" : null
    ssh = var.enable_gitops ? {
      username    = "git"
      private_key = module.gitops[0].tls_private_key_pem
    } : null
  }
}

and this is how i call the module :

module "gitops" {
  count       = var.enable_gitops ? 1 : 0
  source      = "./modules/gitops"
  environment = var.environment
}

Cheers

same error with provider version = "1.1.2" my provider config

provider "flux" {
  kubernetes = {
    config_path = "./${var.cluster_name}"
  }
  git = {
    url    = local.gitlab_url
    branch = var.gitlab_branch
    ssh = var.gitlab_prject_protocol == "ssh" ? {
      username    = "git"
      private_key = tls_private_key.flux.private_key_pem
    } : null
    http = var.gitlab_prject_protocol == "http" ? {
      username = var.gitlab_username
      password = var.gitlab_token
    } : null
  }
}

Hello @qlemaire-dvt / @shencan👋

I hope all is well with you. I'm just contacting you as part of our initiative to ensure the quality and responsiveness of our project's issue tracking. Thank you for your previous contributions by reporting issues you've encountered; your engagement is invaluable to the health and progress of our project.

I've reviewed the issue you reported and noted that it involves using supported resources, which is great. However, I also noticed that there has been little activity on this issue lately. We understand that circumstances change and priorities shift, which may affect the urgency or relevance of an issue.

We're implementing a policy regarding inactive issues to keep our project's issue tracker effective and up-to-date. If there's no further activity on this issue within the next 3 weeks, we will mark it inactive and close it. This approach helps us maintain focus on current and actively pursued concerns, ensuring resources are well allocated.

That said, we are still very much interested in resolving the issue you've encountered. If the problem persists or if you have any new information that could help us address it, please don't hesitate to update the issue or comment. Your input could be crucial in finding a resolution. Alternatively, if the issue no longer affects you or has been resolved, let us know so we can close it with the right resolution.

We're here to support and work with you to overcome any challenges you face using our project. Your continued feedback and participation are essential to our community's success.

Thank you once again for your contribution. I look forward to your update and am here to assist with any further questions or issues you might have.

Best regards,

Steve

Closing due to the lack of activity on the issue. If this issue is still important to you please feel free to raise another one.