Skip to content

Bug: launch_template attribute mismatch between variables.tf and main.tf in v3.0.0 #42

Closed
@yng87

Description

@yng87

Description

There is an inconsistency between the variable definition and usage in the launch_template configuration in version 3.0.0, causing a "This object does not have an attribute named 'id'" error.

The module's variables.tf expects launch_template_id and launch_template_name, but the main.tf references launch_template.value.id and launch_template.value.name.

  • ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 3.0.0
  • Terraform version: >= 1.5.7
  • Provider version(s): aws >= 6.0

Reproduction Code [Required]

module "batch" {
  source  = "terraform-aws-modules/batch/aws"
  version = "3.0.0"

  compute_environments = {
    example = {
      name_prefix = "example"
      compute_resources = {
        type           = "EC2"
        min_vcpus      = 0
        max_vcpus      = 4
        instance_types = ["optimal"]
        
        launch_template = {
          launch_template_id   = "lt-xxxxxxxxx"
          launch_template_name = "example-template"
          version              = "$Latest"
        }

        security_group_ids = ["sg-xxxxxxxxx"]
        subnets            = ["subnet-xxxxxxxxx"]
      }
    }
  }
}

Steps to reproduce:

  1. Apply the above configuration with terraform-aws-modules/batch/aws version 3.0.0
  2. The error occurs during terraform plan/apply

Expected behavior

The module should accept the launch_template configuration with launch_template_id and launch_template_name as defined in the variables.tf.

Actual behavior

Error message:

          launch_template_id   = launch_template.value.id
launch_template.value is object with 3 attributes
This object does not have an attribute named "id".

          launch_template_name = launch_template.value.name
launch_template.value is object with 3 attributes
This object does not have an attribute named "name".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions