hashicorp / packer-plugin-amazon

Packer plugin for Amazon AMI Builder
https://www.packer.io/docs/builders/amazon
Mozilla Public License 2.0
75 stars 112 forks source link

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

Closed hc-github-team-packer closed 1 year ago

hc-github-team-packer commented 1 year ago

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


Community Note

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