Terraform-provider-nexus: No field `password` available for http_client authentication section.

Created on 9 Jun 2020  ·  13Comments  ·  Source: datadrivers/terraform-provider-nexus

When I try to create it I get the error as follow:

 Error: could not update repository 'maven-release': HTTP: 400, [ {
  "id" : "FIELD password",
  "message" : "may not be empty"
} ]

TF code block for this looks as follow:

  http_client {
      blocked = false
      auto_block = false
      authentication {
        type = "username"
        username = "nexus"
        ntlm_host = ""
        ntlm_domain = ""
      }
  }

If I try to provide a field called password I got a message:
An argument named "password" is not expected here.

enhancement

Most helpful comment

Hi all,

the attribute is undocumented within Nexus 3.24.0 API but available for use. I'm currently working on the implementation.

All 13 comments

Nexus version 3.24.0
Nexus provider version: v1.7.0

Hi @fog1985 ,

could you please provide complete TF resource code so we can reproduce? Seems like you're trying to ensure a maven proxy repo.

Hi @Nosmoht ,

Yeap. It's Maven Proxy:

resource "nexus_repository" "maven-release" {
  name   = "maven-release"
  format = "maven2"
  type   = "proxy"

  maven {
    version_policy = "SNAPSHOT"
    layout_policy = "STRICT"
  }

  http_client {
      blocked = false
      auto_block = false
      # authentication {
      #   type = "username"
      #   username = "nexus"
      #   ntlm_host = ""
      #   ntlm_domain = ""
      # }
  }

  negative_cache {
    enabled = false
    ttl     = 0
  }

  proxy {
    remote_url  = "https://remote_url/"
    metadata_max_age = "1440"
    content_max_age = "-1"
  }

  storage {
    blob_store_name                = "maven"
    strict_content_type_validation = true
    write_policy                     = "ALLOW"
  }
}

Thanks @fog1985, we are now able to reproduce the error.

I started to get this error after upgrade to 3.24.0
On 3.23.0 same scripts are working fine.

After I left empty http_client { } block, everything started to work fine

my maven central: https://gist.github.com/android-leha/8f5729f6322dc4b943f735bf7f0573b2

Hi all,

the attribute is undocumented within Nexus 3.24.0 API but available for use. I'm currently working on the implementation.

I created PR #64 to fix this issue.

But I have another problem:
@Nosmoht, may be you aware:
I need also mark this checkbox
image

Is this parameter existed in API?

After I rerun plan, this mark become disable

Hi All, any news on this or #64? Is there anything blocking the merge?

I‘ll create a new release with your change this weekend. Stay tuned 😉

There is one thing left to do. As the Nexus API does not return the password, we must set it into state from input value.

@Nosmoht do you have any example, how it can be done?

@android-leha what exactly do you mean ?

Was this page helpful?
0 / 5 - 0 ratings