Skip to content

version_pin argument in tfe_registry_module is not optional as described. #1867

@shoekstra

Description

@shoekstra

Terraform version

Terraform v1.11.2
on darwin_arm64
+ provider registry.terraform.io/gitlabhq/gitlab v17.11.0
+ provider registry.terraform.io/hashicorp/tfe v0.70.0

Terraform Configuration Files

...
resource "tfe_no_code_module" "default" {
  for_each = var.terraform_modules

  organization    = var.tfe_organization
  registry_module = tfe_registry_module.private[each.key].id

  dynamic "variable_options" {
    for_each = each.value.variable_options

    content {
      name    = variable_options.key
      type    = variable_options.value.type
      options = variable_options.value.options
    }
  }
}
...

Expected Behavior

Terraform should run, the resource should be created without needing the version_pin argument, as per the docs.

Actual Behavior

terraform validate returns an error:

Error: Missing required argument

  with tfe_no_code_module.default,
  on main.tf line 44, in resource "tfe_no_code_module" "default":
  44: resource "tfe_no_code_module" "default" {

"variable_options": all of `variable_options,version_pin` must be specified

Good to know that removing the variable_options argument does not return an error; that works as described in the documentation but not as the provider describes.

Should the version_pin documentation be updated or should the argument be made optional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions