packer-plugin-amazon icon indicating copy to clipboard operation
packer-plugin-amazon copied to clipboard

EC2 Fast Launch cannot be disabled when using additional parameters

Open ShawnHardwick opened this issue 4 months ago • 1 comments

Overview of the Issue

For the amazon-ebs plugin, setting enable_fast_launch to false for the fast_launch config does not disable fast launch if the fast_launch config contains other parameters.

The issue is most likely related to this line of code: https://github.com/hashicorp/packer-plugin-amazon/blob/b5f95e6d24014a9e3111ef8e35558d34a4d34fac/builder/ebs/fast_launch_setup.go#L191

Reproduction Steps

Add the below config to amazon-ebs in Packer build:

source "amazon-ebs" "windows_server_2022" {
[...]
  fast_launch {
    enable_fast_launch = false
    target_resource_count = 10
  }
[...]
}

I do have ami_regions configured, but did not test if that affects the behavior.

region    = "us-east-1"
ami_regions  = ["us-west-2"]

Observe the below in log output:

amazon-ebs.windows_server_2022: Waiting for fast launch to become ready on AMI "TRUNCATED" in region us-east-1...

Plugin and Packer version

Packer v1.12.0 packer-plugin-amazon_v1.3.7_x5.0_linux_amd64

Simplified Packer Buildfile

See reproduction steps

Operating system and Environment details

Ubuntu 22.04 (Jammy)

Justification

I would like have the EC2 fast launch configuration conditional based on other variables, but this isn't currently possible if I was to also set other parameters like target_resource_count.

ShawnHardwick avatar Jul 14 '25 19:07 ShawnHardwick