aws-samples / eks-blueprints-for-proton

MIT No Attribution
28 stars 30 forks source link

Variable causes conflict #33

Closed mreferre closed 2 years ago

mreferre commented 2 years ago

This variable that has been added for local tests causes incompatibilities in Proton with terraform init:

variable "environment" {
  type = object({
    inputs = object({
      kubernetes_version           = any
      cluster_name                 = any
      vpc_cidr                     = any
      user                         = any
      aws_load_balancer_controller = any
      metrics_server               = any
      aws_for_fluentbit            = any
      cert_manager                 = any
      vpa                          = any
      karpenter                    = any
    })
  })
  default = {
    inputs = {
      kubernetes_version           = "1.21"
      cluster_name                 = "proton-blueprint-cluster"
      vpc_cidr                     = "10.0.0.0/16"
      user                         = "<user>"
      aws_load_balancer_controller = true
      metrics_server               = true
      aws_for_fluentbit            = true
      cert_manager                 = true
      vpa                          = true
      karpenter                    = true
    }
  }
}
There are some problems with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Duplicate variable declaration
│ 
│   on variables.tf line 14:
│   14: variable "environment" {
│ 
│ A variable named "environment" was already declared at
│ proton.environment.variables.tf:9,1-23. Variable names must be unique
│ within a module.
╵

Error: Process completed with exit code 1.

Changing the variable from environment to environment_for_local_test apparently has resolved the init issue.

I have already made this change.

mreferre commented 2 years ago

Can you confirm we can leave it like that and this would still enable you to test outside of Proton?

kcoleman731 commented 2 years ago

We can remove and keep this for local testing. We should discuss with the team however as this will be something I suspect many customers will want for local debugging.

mreferre commented 2 years ago

Yes this is definitely something we need to figure out.