Skip to content

[BUG] - Terraform provider version inconsistency within stages #2614

@viniciusdc

Description

@viniciusdc

Describe the bug

We must be more consistent in Terraform provider versions across different deployment stages. This discrepancy can lead to unpredictable behavior and potential issues during deployment. For example, on a recent AWS deployment, I noticed the following in deployment logs from Terraform:

Stage 01 -- Terraform State:

  • hashicorp/aws: v5.12.0

Stage 02:

  • hashicorp/aws: v5.33.0
  • hashicorp/local: v2.5.1
  • hashicorp/tls: v4.0.5

Stage 03:

  • hashicorp/aws: v5.61.0
  • hashicorp/kubernetes: v2.20.0
  • hashicorp/helm: v2.1.2

While we do set the version for the most important infrastructure resources:

terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.33.0"
}
}
required_version = ">= 1.0"
}

The order stages use the terraform.Provider to instantiate the providers across the deployment:

elif self.config.provider == schema.ProviderEnum.aws:
return [
terraform.Provider(
"aws", region=self.config.amazon_web_services.region
),
]

We should make sure that it becomes consistent. Also, the exciting thing is that after stage 3, it becomes consistent across all calls; I guess it comes from the backend being already set up.

Expected behavior

At least the cloud provider versions respect the versions described in their infra modules, as that would be expected.

OS and architecture in which you are running Nebari

Linux

How to Reproduce the problem?

Any cloud provider deployment might lead to the same problem.

Command output

No response

Versions and dependencies used.

No response

Compute environment

AWS

Integrations

No response

Anything else?

No response

Metadata

Metadata

Type

No type

Projects

Status

In review/QA 👀

Relationships

None yet

Development

No branches or pull requests

Issue actions