Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid required aws provider version #96

Open
faustikle opened this issue Jul 26, 2023 · 0 comments
Open

Invalid required aws provider version #96

faustikle opened this issue Jul 26, 2023 · 0 comments
Labels
bug 🐛 An issue with the system

Comments

@faustikle
Copy link

Describe the Bug

This output use the attribute storage_mode:

output "storage_mode" {
  value       = one(aws_msk_cluster.default[*].storage_mode)
  description = "Storage mode for supported storage tiers"
}

The problem is that AWS provider was only introduced in version 4.40.0, but in versions.tf (and in README) is accepted versions >= 4.0:

required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 4.0"
    }
  }

When a project set AWS provider version to 4.39.0 os less, terraform throws:

Error: Unsupported attribute
│
│   on .terraform/modules/kafka/outputs.tf line 12, in output "storage_mode":
│   12:   value       = one(aws_msk_cluster.default[*].storage_mode)
│
│ This object does not have an attribute named "storage_mode".

Expected Behavior

Set correct required version for aws provider to terraform handle compatibility.

Steps to Reproduce

Create a file main.tf and put this:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "4.35.0"
    }
  }
}

module "kafka" {
  source = "cloudposse/msk-apache-kafka-cluster/aws"

  kafka_version        = "3.3.2"
  namespace            = "eg"
  stage                = "prod"
  name                 = "app"
  vpc_id               = "vpc-XXXXXXXX"
  subnet_ids           = ["subnet-XXXXXXXXX", "subnet-YYYYYYYY"]
  broker_per_zone      = 2
  broker_instance_type = "kafka.m5.large"

  # A list of IDs of Security Groups to associate the created resource with, in addition to the created security group
  associated_security_group_ids = ["sg-XXXXXXXXX", "sg-YYYYYYYY"]
  
  # A list of IDs of Security Groups to allow access to the cluster
  allowed_security_group_ids = ["sg-XXXXXXXXX", "sg-YYYYYYYY"]
}

run:

$ terraform init
$ terraform plan

Screenshots

No response

Environment

  • Terraform: 1.5.2
  • AWS Provider: 4.35.0
  • Module version: 2.3.0

Additional Context

No response

@faustikle faustikle added the bug 🐛 An issue with the system label Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An issue with the system
Projects
None yet
Development

No branches or pull requests

1 participant