hashicorp / packer-plugin-amazon

Packer plugin for Amazon AMI Builder

Home Page:https://www.packer.io/docs/builders/amazon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packer Failed to enable fast launch: %!s(<nil>)

hc-github-team-packer opened this issue Β· comments

This issue was originally opened by @Eddie4Frost in hashicorp/packer#12509 and has been migrated to this repository. The original issue description is below.


Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Overview of the Issue

During a Windows AMI creation, using the Amazon EBS Source, the feature related to Fast Launch is returning the following error:
Failed to enable fast launch: %!s(<nil>)

Important to mention, I tested with a custom fast-launch template forcing a default VPC, but the issue still occurs.

Reproduction Steps

To reproduce the issue, you can use an AMI template using the Amazon EBS source and enable the Fast Launch feature to Windows AMI

Packer version

From 1.9.1-1

Packer Template

variable "access_key" {
  type    = string
  default = "YOUR_ACCESS_KEY"
}

variable "secret_key" {
  type    = string
  default = "YOUR_SECRET_KEY"
}

variable "region" {
  type    = string
  default = "us-east-1"
}

variable "source_ami" {
  type    = string
  default = "ami-0123456789abcdef0"
}

variable "instance_type" {
  type    = string
  default = "t2.micro"
}

variable "ssh_username" {
  type    = string
  default = "Administrator"
}

variable "ami_name" {
  type    = string
  default = "MyWindowsAMI {{timestamp}}"
}

builders {
  name          = "amazon-ebs"
  type          = "amazon-ebs"
  access_key    = var.access_key
  secret_key    = var.secret_key
  region        = var.region
  source_ami    = var.source_ami
  instance_type = var.instance_type
  ssh_username  = var.ssh_username
  ami_name      = var.ami_name

  fast_launch {
    enable_fast_launch = true
    template_name = "packer_windows_fast_launch"
  }

provisioner "powershell" {
  inline = [
    "Write-Output 'Hello, World!'",
    "# Additional provisioning commands go here"
  ]
}

Operating system and Environment details

Docker using gitlab-runner 15.11.1 image as base