EC2Launch v2 overview - Amazon Elastic Compute Cloud

EC2Launch v2 overview

EC2Launch v2 is a service that performs tasks during instance startup and runs if an instance is stopped and later started, or restarted.

Compare Amazon EC2 launch services

The following table shows the major functional differences between EC2Config, EC2Launch v1, and EC2Launch v2.

Feature EC2Config EC2Launch v1 EC2Launch v2
Executed as Windows Service

PowerShell Scripts

Windows Service

Windows 2003

Windows 2008

Windows 2008 R2

Windows 2012

Windows 2012 R2

Windows 2016

Windows 2019 (LTSC and SAC)

Windows 2008

Windows 2008 R2

Windows 2012

Windows 2012 R2

Windows 2016

Windows 2019 (LTSC and SAC)

Configuration file



Set Administrator username

No No


User data size

16 KB 16 KB

60 KB (compressed)

Local user data baked on AMI

No No Yes, configurable
Task configuration in user data No No Yes

Configurable wallpaper

No No


Customize task execution order

No No


Configurable tasks



20 at launch

Supports Windows Event Viewer




Number of Event Viewer event types




EC2Launch v2 concepts

The following concepts are useful to understand when considering EC2Launch v2.


A task can be invoked to perform an action on an instance. For a complete list of available tasks for EC2Launch v2, see EC2Launch v2 tasks. Each task includes a set of stages in which it can run, a defined frequency, and inputs. Tasks can be configured in the agent-config file or through user-data.


A stage is a logical grouping of tasks that are run by the service. Some tasks can run only in a specific stage. Others can run in multiple stages. When using local data, you must specify the stage in which a task will run. When using user data, the stage is implied.

The following list shows the stages in the order in which they run:

  1. Boot

  2. Network

  3. PreReady

  4. PostReady

  5. UserData


Task frequency is used to schedule when tasks should run, depending on the boot context.

The following frequencies can be specified:

  • Once — The task runs once, when the AMI has booted for the first time (finished Sysprep).

  • Always — The task runs every time that the launch agent runs. The launch agent runs when:

    • an instance starts or restarts

    • the EC2Launch service runs

    • EC2Launch.exe run is invoked


agent-config is a file that is located in the configuration folder for EC2Launch v2. It includes configuration for the boot, network, preready, and postready stages. This file is used to specify the configuration for an instance for tasks that should run when the AMI is either booted for the first time or for subsequent times.

By default, the EC2Launch v2 installation installs an agent-config file that includes recommended configurations that are used in standard Amazon Windows AMIs. You can update the configuration file to alter the default boot experience for your AMI that EC2Launch v2 specifies.

User data

User data is data that is configurable when you launch an instance. You can update user data to dynamically change how custom AMIs or quickstart AMIs are configured. EC2Launch v2 supports 60 kB user data input length. User data includes only the UserData stage, and therefore runs after the agent-config file. You can enter user data when you launch an instance using the launch instance wizard, or you can modify user data from the EC2 console. For more information about working with user data, see Run commands on your Windows instance at launch.

EC2Launch v2 tasks

EC2Launch v2 can perform the following tasks at each boot:

  • Set up new and optionally customized wallpaper that renders information about the instance.

  • Set the attributes for the administrator account that is created on the local machine.

  • Add DNS suffixes to the list of search suffixes. Only suffixes that do not already exist are added to the list.

  • Set drive letters for any additional volumes and extend them to use available space.

  • Write files to the disk, either from the internet or from the configuration. If the content is in the configuration, it can be base64 decoded or encoded. If the content is from the internet, it can be unzipped.

  • Execute scripts either from the internet or from the configuration. If the script is from the configuration, it can be base64 decoded. If the script is from the internet, it can be unzipped.

  • Execute a program with given arguments.

  • Set the computer name.

  • Send instance information to the Amazon EC2 console.

  • Send the RDP certificate thumbprint to the EC2 console.

  • Dynamically extend the operating system partition to include any unpartitioned space.

  • Execute user data. For more information about specifying user data, see EC2Launch v2 task configuration.

  • Set persistent static routes to reach the metadata service and AWS KMS servers.

  • Set non-boot partitions to MBR or GPT.

  • Start the Systems Manager (SSM) service following Sysprep.

  • Optimize ENA settings.

  • Enable OpenSSH for later Windows versions.

  • Enable Jumbo Frames.

  • Set Sysprep to run with EC2Launch v2.

  • Publish Windows event logs.