You can use one of the following methods to install the EC2Launch v2 agent on your EC2 instance:
-
Download the agent from Amazon S3 and install with Windows PowerShell. For download URLs, see EC2Launch v2 downloads on Amazon S3.
-
Install with SSM Distributor.
-
Install from an EC2 Image Builder component when you create a custom image.
-
Launch your instance from an AMI that has EC2Launch v2 pre-installed.
Warning
AmazonEC2Launch.msi uninstalls previous versions of the EC2 launch services, such as EC2Launch (v1) and EC2Config.
For install steps, select the tab that matches your preferred method.
To install the latest version of EC2Launch v2 agent with Windows PowerShell, follow these steps.
-
Create your local directory.
New-Item -Path "$env:USERPROFILE\Desktop\EC2Launchv2" -ItemType Directory
-
Set the URL for your download location. Run the following command with the Amazon S3 URL you'll use. For download URLs, see EC2Launch v2 downloads on Amazon S3
$Url = "
Amazon S3 URL
/AmazonEC2Launch.msi" -
Use the following compound command to download the agent and run the install
$DownloadFile = "$env:USERPROFILE\Desktop\EC2Launchv2\" + $(Split-Path -Path $Url -Leaf) Invoke-WebRequest -Uri $Url -OutFile $DownloadFile msiexec /i "$DownloadFile"
Note
If you receive an error when downloading the file, and you are using Windows Server 2016 or earlier, TLS 1.2 might need to be enabled for your PowerShell terminal. You can enable TLS 1.2 for the current PowerShell session with the following command and then try again:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
-
The msiexec command installs EC2Launch v2 in the following location on Windows Server instances:
%ProgramFiles%\Amazon\EC2Launch
. To verify that the install ran, you can check the local file system on your instance.
Automatically install and update EC2Launch v2 with AWS Systems Manager Distributor Quick Setup
With AWS Systems Manager Distributor Quick Setup, you can set up automatic updates for EC2Launch v2. The following process sets up a Systems Manager Association on your instance that automatically updates the EC2Launch v2 agent at a frequency that you specify. The Association that the Distributor Quick Setup creates can include instances within an AWS account and Region, or instances within an AWS Organization. For more information about setting up an organization, see Tutorial: Creating and configuring an organization in the AWS Organizations User Guide.
Before you begin, make sure that your instances meet all of the prerequisites.
Prerequisites
To set up automatic updates with Distributor Quick Setup, your instances must meet the following prerequisites.
-
You have at least one running instance that supports EC2Launch v2. See supported operating systems for EC2Launch v2.
-
You've performed the Systems Manager set-up tasks on your instances. For more information, see Setting up Systems Manager in the AWS Systems Manager User Guide.
-
EC2Launch v2 must be the only launch agent installed on your instance. If you have more than one launch agent installed, your Distributor Quick Setup configuration will fail. Before you configure EC2Launch v2 with a Distributor Quick Setup, uninstall EC2Config or EC2Launch v1 launch agents, if they exist.
Configure Distributor Quick Setup for EC2Launch v2
To create a configuration for EC2Launch v2 with Distributor Quick Setup, use the following settings when you complete the steps for Distributor package deployment:
-
Software packages: Amazon EC2Launch v2 agent.
-
Update frequency: Select a frequency from the list.
-
Targets: Choose from the available deployment options.
To check the status of your configuration, navigate to the Systems Manager Quick Setup Configurations tab in the AWS Management Console.
-
Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/
. -
In the navigation pane, choose Quick Setup.
-
In the Configurations tab, select the row that's associated with the configuration that you created. The Configurations tab lists your configurations, and includes a summary of key details, such as Region, Deployment status, and Association status.
Note
The association name for every EC2Launch v2 Distributor configuration begins with the following prefix:
AWS-QuickSetup-Distributor-EC2Launch-Agent-
. -
To view details, select the configuration and choose View details.
For more information and troubleshooting steps, see Troubleshooting Quick Setup results in the AWS Systems Manager User Guide.
EC2Launch v2 downloads on Amazon S3
To install the latest version of EC2Launch v2, download the installer from the following location:
Configure install options
When you install or upgrade EC2Launch v2, you can configure installation options with the EC2Launch v2 install dialog or with the msiexec command in a command line shell.
The first time the EC2Launch v2 installer runs on an instance, it initializes launch agent settings on your instance as follows:
-
It creates the local path and writes the launch agent file to it. This is sometimes referred to as a clean install.
-
It creates the
EC2LAUNCH_TELEMETRY
environment variable if it doesn't already exist, and sets it based on your configuration.
For configuration details, select the tab that matches the configuration method that you'll use.
When you install or upgrade EC2Launch v2, you can configure the following installation options through the EC2Launch v2 install dialog.
Basic Install options
- Send Telemetry
-
When you include this feature in the setup dialog, the installer sets the
EC2LAUNCH_TELEMETRY
environment variable to a value of1
. If you disable Send Telemetry, the installer sets the environment variable to a value of0
.When the EC2Launch v2 agent runs, it reads the
EC2LAUNCH_TELEMETRY
environment variable to determine whether to upload telemetry data. If the value equals1
, it uploads the data. Otherwise, it doesn't upload. - Default configuration
-
The default configuration for EC2Launch v2 is to overwrite the local launch agent if it exists already. The first time you run an install on an instance, the default configuration performs a clean install. If you disable the default configuration on the initial install, the installation fails.
If you run the install again on the instance, you can disable the default configuration to perform an upgrade that doesn't replace the
%ProgramData%/Amazon/EC2Launch/config/agent-config.yml
file.
Example: Upgrade EC2Launch v2 with telemetry
The following example shows the EC2Launch v2 setup dialog configured to upgrade
the current installation and enable telemetry. This configuration performs an
install without replacing the agent configuration file, and sets the
EC2LAUNCH_TELEMETRY
environment variable to a value of 1
.
![EC2Launch v2 upgrade configuration.](/images/AWSEC2/latest/UserGuide/images/ec2launchv2-clean-default-config.png)
Verify the EC2Launch v2 version
Use one of the following procedures to verify the version of EC2Launch v2 that is installed on your instances.
Verify the installed version of EC2Launch v2 with Windows PowerShell, as follows.
-
Launch an instance from your AMI and connect to it.
-
Run the following command in PowerShell to verify the installed version of EC2Launch v2:
& "C:\Program Files\Amazon\EC2Launch\EC2Launch.exe" version
To view the latest updates for the AWS Windows AMIs, see Windows AMI version history in the AWS Windows AMI Reference.
For the latest version of EC2Launch v2, see EC2Launch v2 version history.
For the latest version of the EC2Launch v2 migration tool, see EC2Launch v2 migration tool version history.
You can receive notifications when new versions of the EC2Launch v2 service are released. For more information, see Subscribe to EC2 Windows launch agent notifications.