Imds_support use in packer 1.8.6

hi,

I am trying to use imds_support option with packer 1.8.6 version but validate command is throwing below error:
on build-ubuntu.pkr.hcl line 6:

62 (source code not available)

63An argument named “imds_support” is not expected here.

What am I missing here?

Thanks,
Amit

1 Like

Hey, should be better if you publish your code right here cause no one knows what you’re trying to do, and how :wink:

Hi,

Here is my source file which is throwing error.

source "amazon-ebs" "ubuntu-builder-1" {
  ami_name        = "ubuntu-AMI-2023-04-24T06-01-48Z"
  skip_create_ami = false
  instance_type   = "t2.micro"
  communicator    = "ssh"
  region          = "us-east-1"
  subnet_id       = "subnet-99999"
  source_ami_filter {
    filters = {
      name                = "EC2-Ubuntu18.04-*"
      root-device-type    = "ebs"
      virtualization-type = "hvm"

    }
    most_recent = true
    owners      = ["22222"]
  }
  ami_regions = []
  ami_users   = []
  winrm_username                        = "Administrator"
  ssh_username                          = "ubuntu"
  imds_support                          = "v2.0"
  aws_polling {
    delay_seconds = 120
    max_attempts  = 60
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_put_response_hop_limit = "1"
    http_tokens                 = "required"
  }
  force_deregister      = false
  force_delete_snapshot = false
  iam_instance_profile = "AmazonSSMRoleForInstancesQuickSetup"

}